Skip to content

Commit a6c62de

Browse files
committed
fix MC-153010 (thanks Microcontrollers #478)
1 parent 25caa90 commit a6c62de

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.bugs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ patched 271899 server basic
105105
patched 272431 server basic
106106
patched 298066 server basic
107107
patched 263999 server basic
108+
patched 153010 server basic
108109

109110
previous 2025 17w47a
110111
previous 53312 22w17a
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package dev.isxander.debugify.mixins.basic.mc153010;
2+
3+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
4+
import dev.isxander.debugify.fixes.BugFix;
5+
import dev.isxander.debugify.fixes.FixCategory;
6+
import net.minecraft.server.level.ServerLevel;
7+
import net.minecraft.world.entity.animal.Fox;
8+
import net.minecraft.world.level.GameRules;
9+
import org.spongepowered.asm.mixin.Mixin;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
12+
@BugFix(id = "MC-153010", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "doMobLoot gamerule doesn't prevent foxes from dropping their items")
13+
@Mixin(Fox.class)
14+
public class FoxMixin {
15+
// gate dropping death loot with gamerule check
16+
@ModifyExpressionValue(method = "dropAllDeathLoot", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isEmpty()Z"))
17+
private boolean preventLootDropIfGameruleIsFalse(boolean isEmpty, ServerLevel level) {
18+
return isEmpty || !level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT);
19+
}
20+
}

src/main/resources/debugify.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"basic.mc136249.LivingEntityMixin",
2525
"basic.mc139041.FishingRodItemMixin",
2626
"basic.mc147659.CatSpawnerMixin",
27+
"basic.mc153010.FoxMixin",
2728
"basic.mc155509.PufferfishMixin",
2829
"basic.mc159283.DensityFunctionsMixin",
2930
"basic.mc160095.CactusBlockMixin",

0 commit comments

Comments
 (0)