diff --git a/PATCHED.md b/PATCHED.md index 9023064e..ef993d15 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -74,6 +74,7 @@ | Basic | [MC-121903](https://bugs.mojang.com/browse/MC-121903) | Command block minecarts do not save execution cooldown to NBT | | Basic | [MC-123450](https://bugs.mojang.com/browse/MC-123450) | Item frames play sounds when the item within them is read from NBT | | Basic | [MC-123605](https://bugs.mojang.com/browse/MC-123605) | Debug world still sets clear weather time instead of deactivating gamerule doWeatherCycle | +| Basic | [MC-123848](https://bugs.mojang.com/browse/MC-123848) | Item frames (and items within) when removed from a ceiling, drop atop, not under, the block | | Basic | [MC-129909](https://bugs.mojang.com/browse/MC-129909) | Players in spectator mode continue to consume foods and liquids shortly after switching game modes | | Basic | [MC-132878](https://bugs.mojang.com/browse/MC-132878) | Armor stands destroyed by explosions/lava/fire don't produce particles | | Basic | [MC-134110](https://bugs.mojang.com/browse/MC-134110) | Structure mirroring breaking apart double chests | @@ -81,6 +82,7 @@ | Basic | [MC-139041](https://bugs.mojang.com/browse/MC-139041) | The sounds of fishing bobbers aren't controlled by the "Players" sound slider | | Basic | [MC-147659](https://bugs.mojang.com/browse/MC-147659) | Some witch huts spawn the incorrect cat | | Basic | [MC-147784](https://bugs.mojang.com/browse/MC-147784) | Fletching table flashes crafting table's GUI for about a second upon right-clicking it in spectator mode | +| Basic | [MC-153086](https://bugs.mojang.com/browse/MC-153086) | Beacons always play deactivating sound when broken, even when not powered | | Basic | [MC-155509](https://bugs.mojang.com/browse/MC-155509) | Puffed pufferfish can hurt the player while dying | | Basic | [MC-159283](https://bugs.mojang.com/browse/MC-159283) | The End terrain does not generate in multiple rings centered around the world center | | Basic | [MC-160095](https://bugs.mojang.com/browse/MC-160095) | End Rods only break Cactus when moved by pistons | @@ -96,6 +98,7 @@ | Basic | [MC-202637](https://bugs.mojang.com/browse/MC-202637) | Last sound clip of eating will still play when Players volume is set to 0% | | Basic | [MC-206705](https://bugs.mojang.com/browse/MC-206705) | Spyglasses stay in use in spectator mode | | Basic | [MC-206922](https://bugs.mojang.com/browse/MC-206922) | Items dropped by entities that are killed by lightning instantly disappear | +| Basic | [MC-210802](https://bugs.mojang.com/browse/MC-210802) | Inactive sheep eat grass | | Basic | [MC-214147](https://bugs.mojang.com/browse/MC-214147) | Skeletons wearing leather armor still convert to strays in powder snow | | Basic | [MC-215530](https://bugs.mojang.com/browse/MC-215530) | The freezing effect isn't immediately removed when switching into spectator mode | | Basic | [MC-219981](https://bugs.mojang.com/browse/MC-219981) | If zombies spawned with max health over 20 (leader zombie bonus), they will have 20 health instead of their max health | @@ -107,7 +110,9 @@ | Basic | [MC-227337](https://bugs.mojang.com/browse/MC-227337) | When a shulker bullet hits an entity, the explodes sound is not played and particles are not produced | | Basic | [MC-231743](https://bugs.mojang.com/browse/MC-231743) | minecraft.used:minecraft.POTTABLE_PLANT doesn't increase when placing plants into flower pots | | Basic | [MC-232869](https://bugs.mojang.com/browse/MC-232869) | Adult striders can spawn with saddles in peaceful mode | +| Basic | [MC-243057](https://bugs.mojang.com/browse/MC-243057) | Furnace recipes don't consider alternatives when first option of recipe is used for fuel | | Basic | [MC-245394](https://bugs.mojang.com/browse/MC-245394) | The sounds of raid horns blaring aren't controlled by the correct sound slider | +| Basic | [MC-248588](https://bugs.mojang.com/browse/MC-248588) | The "mobGriefing" gamerule doesn't prevent burning entities from being able to decrease the levels of water or powder snow cauldrons | | Basic | [MC-251068](https://bugs.mojang.com/browse/MC-251068) | If you delete your only world, then you are no longer automatically thrown into the menu of creating a new world | | Basic | [MC-267125](https://bugs.mojang.com/browse/MC-267125) | Command suggestions for reloadable content are not affected by /reload | | Basic | [MC-268617](https://bugs.mojang.com/browse/MC-268617) | Structures can't be saved if the game directory is named in a certain way | diff --git a/build.gradle.kts b/build.gradle.kts index 1616d2d8..f321670c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,8 @@ modstitch { FlashyReese's Sodium Extra - Code used licensed under LGPLv3 Ampflower's 2x2 Surrounded Saplings Fix - Code used licensed under Zlib NoahvdAa's Thorium - Code used licensed under LGPLv3 - Moulberry's MoulberryTweaks - Code used licensed under MIT + Moulberry's MoulberrysTweaks - Code used licensed under MIT + PaperMC's Paper - Code used under MIT """.trimIndent() } diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc123848/ItemFrameMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc123848/ItemFrameMixin.java new file mode 100644 index 00000000..7cf1cc87 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc123848/ItemFrameMixin.java @@ -0,0 +1,33 @@ +package dev.isxander.debugify.mixins.basic.mc123848; + +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.decoration.HangingEntity; +import net.minecraft.world.entity.decoration.ItemFrame; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; + +/** + * Taken from a Paper patch attributed to BillyGalbreath + * patch + *

+ * Licensed under MIT + * license + */ +@BugFix(id = "MC-123848", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Item frames (and items within) when removed from a ceiling, drop atop, not under, the block") +@Mixin(ItemFrame.class) +public abstract class ItemFrameMixin extends HangingEntity { + protected ItemFrameMixin(EntityType entityType, Level level) { + super(entityType, level); + } + + @Override + public ItemEntity spawnAtLocation(ServerLevel level, ItemStack stack) { + return this.spawnAtLocation(level, stack, this.getDirection() == Direction.DOWN ? -0.6F: 0.0F); + } +} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc153086/BeaconBlockEntityMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc153086/BeaconBlockEntityMixin.java new file mode 100644 index 00000000..4376acda --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc153086/BeaconBlockEntityMixin.java @@ -0,0 +1,37 @@ +package dev.isxander.debugify.mixins.basic.mc153086; + +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.core.BlockPos; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BeaconBeamOwner; +import net.minecraft.world.level.block.entity.BeaconBlockEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; + +import java.util.List; + +/** + * Taken from a Paper patch attributed to Machine_Maker & BillyGalbreath + * patch + *

+ * Licensed under MIT + * license + */ +@BugFix(id = "MC-153086", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Beacons always play deactivating sound when broken, even when not powered") +@Mixin(BeaconBlockEntity.class) +public class BeaconBlockEntityMixin { + @Shadow + int levels; + + @Shadow + List beamSections; + + @WrapWithCondition(method = "setRemoved", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/BeaconBlockEntity;playSound(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/sounds/SoundEvent;)V")) + private boolean checkIfActive(Level level, BlockPos pos, SoundEvent sound) { + return (this.levels > 0 && !this.beamSections.isEmpty()); + } +} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc210802/ChunkMapAccessor.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc210802/ChunkMapAccessor.java new file mode 100644 index 00000000..1b8200c5 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc210802/ChunkMapAccessor.java @@ -0,0 +1,12 @@ +package dev.isxander.debugify.mixins.basic.mc210802; + +import net.minecraft.server.level.ChunkMap; +import net.minecraft.world.level.ChunkPos; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(ChunkMap.class) +public interface ChunkMapAccessor { + @Invoker("anyPlayerCloseEnoughForSpawning") + boolean getAnyPlayerCloseEnoughForSpawning(ChunkPos chunkPos); +} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc210802/EatBlockGoalMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc210802/EatBlockGoalMixin.java new file mode 100644 index 00000000..ad72b02d --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc210802/EatBlockGoalMixin.java @@ -0,0 +1,40 @@ +package dev.isxander.debugify.mixins.basic.mc210802; + +import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.ai.goal.EatBlockGoal; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +/** + * Taken from a Paper patch attributed to BillyGalbreath + * patch + *

+ * Licensed under MIT + * license + */ +@BugFix(id = "MC-210802", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Inactive sheep eat grass") +@Mixin(EatBlockGoal.class) +public class EatBlockGoalMixin { + @Shadow + @Final + private Level level; + + @Shadow + @Final + private Mob mob; + + @WrapMethod(method = "canUse") + private boolean checkDistance(Operation original) { + if (!((ChunkMapAccessor) ((ServerLevel) this.level).getChunkSource().chunkMap).getAnyPlayerCloseEnoughForSpawning(this.mob.chunkPosition())) { + return false; + } + return original.call(); + } +} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc243057/AbstractFurnaceBlockEntityMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc243057/AbstractFurnaceBlockEntityMixin.java new file mode 100644 index 00000000..79dbe328 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc243057/AbstractFurnaceBlockEntityMixin.java @@ -0,0 +1,42 @@ +package dev.isxander.debugify.mixins.basic.mc243057; + +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.core.NonNullList; +import net.minecraft.world.entity.player.StackedItemContents; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +/** + * Taken from a Paper patch attributed to Machine_Maker + * patch + *

+ * Licensed under MIT + * license + */ +@BugFix(id = "MC-243057", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Furnace recipes don't consider alternatives when first option of recipe is used for fuel") +@Mixin(AbstractFurnaceBlockEntity.class) +public class AbstractFurnaceBlockEntityMixin { + @Shadow + protected NonNullList items; + + @Shadow + @Final + protected static int SLOT_INPUT; + + @Shadow + @Final + protected static int SLOT_RESULT; + + @Inject(method = "fillStackedContents", at = @At("HEAD")) + private void fixFuelStacks(StackedItemContents stackedItemContents, CallbackInfo ci) { + stackedItemContents.accountStack(this.items.get(SLOT_INPUT)); + stackedItemContents.accountStack(this.items.get(SLOT_RESULT)); + } +} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc248588/LayeredCauldronBlockMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc248588/LayeredCauldronBlockMixin.java new file mode 100644 index 00000000..37274ecd --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc248588/LayeredCauldronBlockMixin.java @@ -0,0 +1,30 @@ +package dev.isxander.debugify.mixins.basic.mc248588; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.GameRules; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +/** + * Taken from a Paper patch attributed to Machine_Maker + * patch + *

+ * Licensed under MIT + * license + */ +@BugFix(id = "MC-248588", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "The \"mobGriefing\" gamerule doesn't prevent burning entities from being able to decrease the levels of water or powder snow cauldrons") +@Mixin(LayeredCauldronBlock.class) +public class LayeredCauldronBlockMixin { + @WrapOperation(method = "method_71627", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;mayInteract(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;)Z")) + private boolean checkMobGriefing(Entity instance, ServerLevel level, BlockPos pos, Operation original) { + return (instance instanceof Player || level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && original.call(instance, level, pos); + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index cf77856d..0964422c 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -19,6 +19,7 @@ "basic.mc121903.MinecraftCommandBlockMixin", "basic.mc123450.ItemFrameMixin", "basic.mc123605.MinecraftServerMixin", + "basic.mc123848.ItemFrameMixin", "basic.mc129909.ServerPlayerMixin", "basic.mc132878.ArmorStandMixin", "basic.mc134110.ChestBlockMixin", @@ -26,6 +27,7 @@ "basic.mc139041.FishingRodItemMixin", "basic.mc147659.CatSpawnerMixin", "basic.mc147784.FletchingTableBlockMixin", + "basic.mc153086.BeaconBlockEntityMixin", "basic.mc155509.PufferfishMixin", "basic.mc159283.DensityFunctionsMixin", "basic.mc160095.CactusBlockMixin", @@ -43,6 +45,8 @@ "basic.mc202637.FoodPropertiesMixin", "basic.mc206922.EntityMixin", "basic.mc206922.ItemEntityMixin", + "basic.mc210802.ChunkMapAccessor", + "basic.mc210802.EatBlockGoalMixin", "basic.mc215530.ServerPlayerMixin", "basic.mc219981.ZombieMixin", "basic.mc221257.ShulkerBulletMixin", @@ -53,7 +57,9 @@ "basic.mc227337.ShulkerBulletMixin", "basic.mc231743.FlowerPotBlockMixin", "basic.mc232869.StriderMixin", + "basic.mc243057.AbstractFurnaceBlockEntityMixin", "basic.mc245394.RaidMixin", + "basic.mc248588.LayeredCauldronBlockMixin", "basic.mc267125.MinecraftServerMixin", "basic.mc268617.FileUtilMixin", "basic.mc271899.StructureTemplateMixin",