diff --git a/PATCHED.md b/PATCHED.md index 9023064e..fe4e5231 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -81,6 +81,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-153010](https://bugs.mojang.com/browse/MC-153010) | doMobLoot gamerule doesn't prevent foxes from dropping their items | | 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 | diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc153010/FoxMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc153010/FoxMixin.java new file mode 100644 index 00000000..0f2bd721 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc153010/FoxMixin.java @@ -0,0 +1,19 @@ +package dev.isxander.debugify.mixins.basic.mc153010; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.animal.Fox; +import net.minecraft.world.level.GameRules; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@BugFix(id = "MC-153010", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "doMobLoot gamerule doesn't prevent foxes from dropping their items") +@Mixin(Fox.class) +public class FoxMixin { + @ModifyExpressionValue(method = "dropAllDeathLoot", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isEmpty()Z")) + private boolean dropAllDeathLoot(boolean original, ServerLevel level) { + return original || !level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT); + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index cf77856d..1702458b 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -26,6 +26,7 @@ "basic.mc139041.FishingRodItemMixin", "basic.mc147659.CatSpawnerMixin", "basic.mc147784.FletchingTableBlockMixin", + "basic.mc153010.FoxMixin", "basic.mc155509.PufferfishMixin", "basic.mc159283.DensityFunctionsMixin", "basic.mc160095.CactusBlockMixin",