Skip to content

Commit f6e8605

Browse files
committed
fix MC-133218 (thanks Microcontrollers #471)
1 parent 451a2be commit f6e8605

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.bugs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ patched 44654 server basic
110110
patched 264979 server basic
111111
patched 264285 server basic
112112
patched 131562 server basic
113+
patched 133218 server basic
113114

114115
previous 2025 17w47a
115116
previous 53312 22w17a
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package dev.isxander.debugify.mixins.basic.mc133218;
2+
3+
import com.mojang.authlib.GameProfile;
4+
import dev.isxander.debugify.fixes.BugFix;
5+
import dev.isxander.debugify.fixes.FixCategory;
6+
import net.minecraft.server.level.ServerPlayer;
7+
import net.minecraft.world.entity.player.Player;
8+
import net.minecraft.world.level.Level;
9+
import org.spongepowered.asm.mixin.Mixin;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
import org.spongepowered.asm.mixin.injection.Inject;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13+
14+
@BugFix(id = "MC-133218", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Usable items continue to be used on the death screen after dying when the keepInventory gamerule is set to enabled")
15+
@Mixin(ServerPlayer.class)
16+
public abstract class ServerPlayerMixin extends Player {
17+
public ServerPlayerMixin(Level level, GameProfile gameProfile) {
18+
super(level, gameProfile);
19+
}
20+
21+
@Inject(method = "die", at = @At("RETURN"))
22+
private void stopUsingItemOnDeath(CallbackInfo ci) {
23+
this.stopUsingItem();
24+
}
25+
}

src/main/resources/debugify.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"basic.mc129909.ServerPlayerMixin",
2222
"basic.mc131562.ServerGamePacketListenerImplMixin",
2323
"basic.mc132878.ArmorStandMixin",
24+
"basic.mc133218.ServerPlayerMixin",
2425
"basic.mc134110.ChestBlockMixin",
2526
"basic.mc136249.LivingEntityMixin",
2627
"basic.mc139041.FishingRodItemMixin",

0 commit comments

Comments
 (0)