From 9c8baaf6d9bce8ff34f2608cfeba9fe0d43a6bfa Mon Sep 17 00:00:00 2001 From: MicrocontrollersDev Date: Mon, 28 Jul 2025 13:48:03 -0700 Subject: [PATCH] fix MC-133218 --- PATCHED.md | 1 + .../basic/mc133218/ServerPlayerMixin.java | 26 +++++++++++++++++++ src/main/resources/debugify.mixins.json | 1 + 3 files changed, 28 insertions(+) create mode 100644 src/main/java/dev/isxander/debugify/mixins/basic/mc133218/ServerPlayerMixin.java diff --git a/PATCHED.md b/PATCHED.md index 9023064e..4241b8b6 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -76,6 +76,7 @@ | Basic | [MC-123605](https://bugs.mojang.com/browse/MC-123605) | Debug world still sets clear weather time instead of deactivating gamerule doWeatherCycle | | 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-133218](https://bugs.mojang.com/browse/MC-133218) | Usable items continue to be used on the death screen after dying when the "keepInventory" gamerule is set to "true" | | Basic | [MC-134110](https://bugs.mojang.com/browse/MC-134110) | Structure mirroring breaking apart double chests | | Basic | [MC-136249](https://bugs.mojang.com/browse/MC-136249) | Wearing boots enchanted with depth strider decreases the strength of the riptide enchantment | | Basic | [MC-139041](https://bugs.mojang.com/browse/MC-139041) | The sounds of fishing bobbers aren't controlled by the "Players" sound slider | diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc133218/ServerPlayerMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc133218/ServerPlayerMixin.java new file mode 100644 index 00000000..517181a6 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc133218/ServerPlayerMixin.java @@ -0,0 +1,26 @@ +package dev.isxander.debugify.mixins.basic.mc133218; + +import com.mojang.authlib.GameProfile; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.Level; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@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 \"true\"") +@Mixin(ServerPlayer.class) +public abstract class ServerPlayerMixin extends Player { + public ServerPlayerMixin(Level level, GameProfile gameProfile) { + super(level, gameProfile); + } + + @Inject(method = "die", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/scores/Scoreboard;forAllObjectives(Lnet/minecraft/world/scores/criteria/ObjectiveCriteria;Lnet/minecraft/world/scores/ScoreHolder;Ljava/util/function/Consumer;)V")) + private void stopUsingItemOnDeath(DamageSource damageSource, CallbackInfo ci) { + this.stopUsingItem(); + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index cf77856d..12e00e9a 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -21,6 +21,7 @@ "basic.mc123605.MinecraftServerMixin", "basic.mc129909.ServerPlayerMixin", "basic.mc132878.ArmorStandMixin", + "basic.mc133218.ServerPlayerMixin", "basic.mc134110.ChestBlockMixin", "basic.mc136249.LivingEntityMixin", "basic.mc139041.FishingRodItemMixin",