diff --git a/PATCHED.md b/PATCHED.md index 9023064e..7deead70 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -8,7 +8,6 @@ | Basic | [MC-12062](https://bugs.mojang.com/browse/MC-12062) | Hotbar selection resets to the far left when exiting the end | | Basic | [MC-22882](https://bugs.mojang.com/browse/MC-22882) | Ctrl + Q won't work on Mac (disabled by default) | | Basic | [MC-35361](https://bugs.mojang.com/browse/MC-35361) | Inventory opening is detected while in Nether Portal | -| Basic | [MC-46503](https://bugs.mojang.com/browse/MC-46503) | You can retain a mob's shader in spectator mode by running /kill | | Basic | [MC-46737](https://bugs.mojang.com/browse/MC-46737) | Entities' shaders are applied when beginning to spectate them in third person | | Basic | [MC-46766](https://bugs.mojang.com/browse/MC-46766) | Mining a block in Survival, then changing to Spectator creates a breaking animation and sound | | Basic | [MC-57057](https://bugs.mojang.com/browse/MC-57057) | Guardian laser attack sound ignores distance | @@ -32,7 +31,6 @@ | Basic | [MC-165381](https://bugs.mojang.com/browse/MC-165381) | Block breaking can be delayed by dropping/throwing the tool while breaking a block | | | Basic | [MC-168573](https://bugs.mojang.com/browse/MC-168573) | After breaking a shield, the player's off-hand can't finish using some items | | Basic | [MC-176559](https://bugs.mojang.com/browse/MC-176559) | Breaking process resets when a pickaxe enchanted with Mending mends by XP / Mending slows down breaking blocks again | -| Basic | [MC-183776](https://bugs.mojang.com/browse/MC-183776) | After switching gamemodes using F3+F4, you need to press F3 twice to toggle the debug screen | | Basic | [MC-188359](https://bugs.mojang.com/browse/MC-188359) | Burp sound does not play after drinking or after eating cake | | Basic | [MC-197260](https://bugs.mojang.com/browse/MC-197260) | Armor Stand renders itself and armor dark if its head is in a solid block | | Basic | [MC-201723](https://bugs.mojang.com/browse/MC-201723) | Statistics sprites don't look pressed when clicked | @@ -46,7 +44,6 @@ | Basic | [MC-242809](https://bugs.mojang.com/browse/MC-242809) | IP field in the multiplayer menu will not detect the IP if a space is put at the beginning/end of it | | Basic | [MC-259512](https://bugs.mojang.com/browse/MC-259512) | Horizontal camera rotation lags when riding | | Basic | [MC-267376](https://bugs.mojang.com/browse/MC-267376) | You can view through blocks on small scales (near plane clipping) | -| Basic | [MC-267469](https://bugs.mojang.com/browse/MC-267469) | GUI List Entry highlight border not always aligned properly | | Basic | [MC-268420](https://bugs.mojang.com/browse/MC-268420) | Cooldown indicator flashes when switching items with high attack speed attribute | | Basic | [MC-280220](https://bugs.mojang.com/browse/MC-280220) | When a Dolphin holds an item, it is rendered upside-down | | Basic | [MC-298225](https://bugs.mojang.com/browse/MC-298225) | Shapes appear in the end sky with certain distance settings | @@ -59,7 +56,6 @@ | Basic | [MC-7569](https://bugs.mojang.com/browse/MC-7569) | RCON output has newlines removed | | Gameplay | [MC-8187](https://bugs.mojang.com/browse/MC-8187) | Two-by-two arrangements of jungle or spruce saplings cannot grow when there are adjacent blocks located north or west of the sapling formation | | Basic | [MC-30391](https://bugs.mojang.com/browse/MC-30391) | Chickens, blazes and the wither emit particles when landing from a height, despite falling slowly | -| Basic | [MC-69216](https://bugs.mojang.com/browse/MC-69216) | Switching to spectator mode while fishing keeps rod cast | | Basic | [MC-81773](https://bugs.mojang.com/browse/MC-81773) | Bows and tridents drawn in survival/creative/adventure mode can be released in spectator mode | | Basic | [MC-82263](https://bugs.mojang.com/browse/MC-82263) | Ender dragon produces regular hurt sound on final hit | | Basic | [MC-84661](https://bugs.mojang.com/browse/MC-84661) | Glowing is considered a positive effect in potion item tooltips | @@ -68,7 +64,6 @@ | Basic | [MC-93018](https://bugs.mojang.com/browse/MC-93018) | Wild wolves show breeding hearts but do not breed | | Basic | [MC-94054](https://bugs.mojang.com/browse/MC-94054) | Cave spiders spin around when walking | | Basic | [MC-100991](https://bugs.mojang.com/browse/MC-100991) | Killing entities with a fishing rod doesn't count as a kill | -| Basic | [MC-119417](https://bugs.mojang.com/browse/MC-119417) | A spectator can occupy a bed if they enter it and then are switched to spectator mode | | Basic | [MC-119754](https://bugs.mojang.com/browse/MC-119754) | Firework boosting on elytra continues in spectator mode | | Basic | [MC-121706](https://bugs.mojang.com/browse/MC-121706) | Skeletons and illusioners aren't looking up / down at their target while strafing | | Basic | [MC-121903](https://bugs.mojang.com/browse/MC-121903) | Command block minecarts do not save execution cooldown to NBT | @@ -80,7 +75,6 @@ | 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 | | 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-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 | @@ -114,14 +108,13 @@ | Basic | [MC-271899](https://bugs.mojang.com/browse/MC-271899) | StructureTemplate Palette's caches are not thread safe | | Basic | [MC-272431](https://bugs.mojang.com/browse/MC-272431) | Ender Dragon incorrect vertical velocity causes erratic behavior | | Basic | [MC-298066](https://bugs.mojang.com/browse/MC-298066) | Directly entering a bed from a mount places the player in the wrong place | -| Basic | [MC-299115](https://bugs.mojang.com/browse/MC-299115) | Arrow losing owner tag when deflected whilst owner being offline | -| ## Previously patched Bugs that this mod has patched but has been superseded by a vanilla update. | Bug ID | Name | Fixed in | |-------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|-------------| +| [MC-2025](https://bugs.mojang.com/browse/MC-2025) | Mobs going out of fenced areas/suffocate in blocks when loading chunks | 17w47a | | [MC-53312](https://bugs.mojang.com/browse/MC-53312) | Illager/(zombie) villager/witch robes don't render the last two rows of pixels | 22w17a | | [MC-72687](https://bugs.mojang.com/browse/MC-145929) | There are no shadows on text displayed within the action bar | 22w24a | | [MC-148149](https://bugs.mojang.com/browse/MC-148149) | Linux game crash when opening links | 1.19.1-pre6 | @@ -151,5 +144,10 @@ Bugs that this mod has patched but has been superseded by a vanilla update. | [MC-55347](https://bugs.mojang.com/browse/MC-55347) | Title with long duration shows in other world | 24w44a | | [MC-111516](https://bugs.mojang.com/browse/MC-111516) | Player flickers/turns invisible when flying at high speeds | 24w44a | | [MC-112730](https://bugs.mojang.com/browse/MC-112730) | Beacon beam and structure block render twice per frame | 25w21a | - - +| [MC-183776](https://bugs.mojang.com/browse/MC-183776) | After switching gamemodes using F3+F4, you need to press F3 twice to toggle the debug screen | 25w31a | +| [MC-46503](https://bugs.mojang.com/browse/MC-46503) | You can retain a mob's shader in spectator mode by running /kill | 25w33a | +| [MC-69216](https://bugs.mojang.com/browse/MC-69216) | Switching to spectator mode while fishing keeps rod cast | 25w33a | +| [MC-119417](https://bugs.mojang.com/browse/MC-119417) | A spectator can occupy a bed if they enter it and then are switched to spectator mode | 25w33a | +| [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 | 25w34a | +| [MC-299115](https://bugs.mojang.com/browse/MC-299115) | Arrow losing owner tag when deflected whilst owner being offline | 25w34a | +| [MC-267469](https://bugs.mojang.com/browse/MC-267469) | GUI List Entry highlight border not always aligned properly | 1.21.9 | diff --git a/build.gradle.kts b/build.gradle.kts index 5d9db6e7..873bc208 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,12 +6,12 @@ plugins { } modstitch { - minecraftVersion = "1.21.9" - modLoaderVersion = "0.17.2" + minecraftVersion = "1.21.10" + modLoaderVersion = "0.17.3" parchment { - mappingsVersion = "2025.09.14" - minecraftVersion = "1.21.8" + mappingsVersion = "2025.10.12" + minecraftVersion = "1.21.10" } metadata { diff --git a/gradle.properties b/gradle.properties index a8711264..71420ff2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,6 @@ curseforgeId=596224 githubProject=isXander/Debugify # Libraries -fabricApiVersion=0.133.14+1.21.9 +fabricApiVersion=0.136.0+1.21.10 yaclVersion=3.8.0+1.21.9-fabric -modMenuVersion=15.0.0-beta.3 +modMenuVersion=16.0.0-rc.1 diff --git a/src/client/java/dev/isxander/debugify/client/gui/NoYACLScreen.java b/src/client/java/dev/isxander/debugify/client/gui/NoYACLScreen.java index 25160cdf..90cd04ff 100644 --- a/src/client/java/dev/isxander/debugify/client/gui/NoYACLScreen.java +++ b/src/client/java/dev/isxander/debugify/client/gui/NoYACLScreen.java @@ -61,15 +61,15 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { } } - @Override - public boolean mouseClicked(double mouseX, double mouseY, int button) { - if (super.mouseClicked(mouseX, mouseY, button)) { - return true; - } - - Style style = getStyle((int) mouseX, (int) mouseY); - return handleComponentClicked(style); - } +// @Override +// public boolean mouseClicked(double mouseX, double mouseY, int button) { +// if (super.mouseClicked(mouseX, mouseY, button)) { +// return true; +// } +// +// Style style = getStyle((int) mouseX, (int) mouseY); +// return handleComponentClicked(style); +// } protected Style getStyle(int mouseX, int mouseY) { int y = mouseY - 90; diff --git a/src/client/java/dev/isxander/debugify/client/helpers/mc197260/DebugifyLightProvider.java b/src/client/java/dev/isxander/debugify/client/helpers/mc197260/DebugifyLightProvider.java index 8093ffc4..b11868ef 100644 --- a/src/client/java/dev/isxander/debugify/client/helpers/mc197260/DebugifyLightProvider.java +++ b/src/client/java/dev/isxander/debugify/client/helpers/mc197260/DebugifyLightProvider.java @@ -5,7 +5,7 @@ import net.minecraft.client.renderer.entity.state.LivingEntityRenderState; public interface DebugifyLightProvider { - default int modifyLightLevel(int lightLevel, S livingEntity, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) { + default int modifyLightLevel(int lightLevel, S livingEntity) { return lightLevel; } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/LocalPlayerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/LocalPlayerMixin.java index 7e190e06..6d3a6ae1 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/LocalPlayerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/LocalPlayerMixin.java @@ -26,7 +26,7 @@ @Mixin(LocalPlayer.class) public abstract class LocalPlayerMixin extends Player implements LocalPlayerDuck { @Unique - private int visualAttackStrengthTicker = 0; + private int debugify$visualAttackStrengthTicker = 0; public LocalPlayerMixin(Level level, GameProfile gameProfile) { super(level, gameProfile); @@ -34,21 +34,21 @@ public LocalPlayerMixin(Level level, GameProfile gameProfile) { @Inject(method = "swing", at = @At("HEAD")) public void swing(InteractionHand interactionHand, CallbackInfo ci) { - this.visualAttackStrengthTicker = 0; + this.debugify$visualAttackStrengthTicker = 0; } @Override public float debugify$getVisualAttackStrengthScale(float partialTick) { - return Mth.clamp(((float)this.visualAttackStrengthTicker + partialTick) / this.getCurrentItemAttackStrengthDelay(), 0.0F, 1.0F); + return Mth.clamp(((float)this.debugify$visualAttackStrengthTicker + partialTick) / this.getCurrentItemAttackStrengthDelay(), 0.0F, 1.0F); } @Override public void debugify$resetVisualAttackStrengthScale() { - this.visualAttackStrengthTicker = 0; + this.debugify$visualAttackStrengthTicker = 0; } @Override public void debugify$incrementVisualAttackStrengthScale() { - this.visualAttackStrengthTicker += 1; + this.debugify$visualAttackStrengthTicker += 1; } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/PlayerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/PlayerMixin.java index b4938954..fe23752a 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/PlayerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc118740/PlayerMixin.java @@ -26,7 +26,7 @@ public void resetAttackStrengthTicker(CallbackInfo ci) { } } - @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;moveCloak()V")) + @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;clamp(DDD)D", ordinal = 0)) public void tick(CallbackInfo ci) { if (this instanceof LocalPlayerDuck localPlayerExt) { localPlayerExt.debugify$incrementVisualAttackStrengthScale(); diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc143474/ClientPacketListenerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc143474/ClientPacketListenerMixin.java index 9e1c52ee..86e49732 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc143474/ClientPacketListenerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc143474/ClientPacketListenerMixin.java @@ -21,7 +21,7 @@ protected ClientPacketListenerMixin(Minecraft client, Connection connection, Com super(client, connection, commonListenerCookie); } - @Inject(method = "handleRespawn", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientPacketListener;startWaitingForNewLevel(Lnet/minecraft/client/player/LocalPlayer;Lnet/minecraft/client/multiplayer/ClientLevel;Lnet/minecraft/client/gui/screens/ReceivingLevelScreen$Reason;)V")) + @Inject(method = "handleRespawn", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/ClientPacketListener;startWaitingForNewLevel(Lnet/minecraft/client/player/LocalPlayer;Lnet/minecraft/client/multiplayer/ClientLevel;Lnet/minecraft/client/gui/screens/LevelLoadingScreen$Reason;)V")) private void persistInventorySlot2(CallbackInfo ci, @Local(ordinal = 0) LocalPlayer oldPlayer, @Local(ordinal = 1) LocalPlayer newPlayer) { newPlayer.getInventory().setSelectedSlot(oldPlayer.getInventory().getSelectedSlot()); } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/ArmorStandRendererMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/ArmorStandRendererMixin.java index fd8af537..dc38b92b 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/ArmorStandRendererMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/ArmorStandRendererMixin.java @@ -1,6 +1,5 @@ package dev.isxander.debugify.client.mixins.basic.mc197260; -import com.mojang.blaze3d.vertex.PoseStack; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.Minecraft; @@ -12,7 +11,6 @@ import java.util.stream.IntStream; import net.minecraft.client.model.ArmorStandArmorModel; import net.minecraft.client.renderer.LightTexture; -import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.ArmorStandRenderer; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.decoration.ArmorStand; @@ -35,7 +33,7 @@ protected ArmorStandRendererMixin(EntityRendererProvider.Context context) { * */ @Override - public int modifyLightLevel(int providedLightLevel, ArmorStandRenderState livingEntity, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) { + public int modifyLightLevel(int providedLightLevel, ArmorStandRenderState livingEntity) { BlockPos mainPos = BlockPos.containing(livingEntity.x, livingEntity.y, livingEntity.z); ClientLevel level = Minecraft.getInstance().level; diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/LivingEntityRendererMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/LivingEntityRendererMixin.java index 953fa839..63312e1d 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/LivingEntityRendererMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc197260/LivingEntityRendererMixin.java @@ -1,10 +1,10 @@ package dev.isxander.debugify.client.mixins.basic.mc197260; -import com.mojang.blaze3d.vertex.PoseStack; +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.client.model.EntityModel; -import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.LivingEntityRenderer; @@ -14,7 +14,6 @@ import dev.isxander.debugify.client.helpers.mc197260.DebugifyLightProvider; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; @BugFix(id = "MC-197260", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "Armor Stand renders itself and armor dark if its head is in a solid block") @Mixin(LivingEntityRenderer.class) @@ -23,8 +22,9 @@ protected LivingEntityRendererMixin(EntityRendererProvider.Context context) { super(context); } - @ModifyVariable(method = "render(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("HEAD"), index = 4, argsOnly = true) - private int modifyProvidedLightLevel(int lightLevel, S livingEntityRenderState, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) { - return modifyLightLevel(lightLevel, livingEntityRenderState, matrixStack, vertexConsumerProvider); + // TODO: doesnt work + @WrapOperation(method = "submit(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/CameraRenderState;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/LivingEntityRenderer;getOverlayCoords(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)I")) + private int modifyProvidedLightLevel(S renderState, float overlay, Operation original) { + return modifyLightLevel(original.call(renderState, overlay), renderState); } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc201723/StatsScreenMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc201723/StatsScreenMixin.java index 1338409a..32752cd8 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc201723/StatsScreenMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc201723/StatsScreenMixin.java @@ -19,27 +19,27 @@ * * @author NoahvdAa */ -@BugFix(id = "MC-201723", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "Statistics sprites don't look pressed when clicked") -@Mixin(StatsScreen.ItemStatisticsList.class) -public class StatsScreenMixin extends ObjectSelectionList { - @Shadow - protected int headerPressed; - - public StatsScreenMixin(Minecraft minecraft, int i, int j, int k, int l) { - super(minecraft, i, j, k, l); - } - - @WrapOperation(method = "renderHeader", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;isLeftPressed()Z")) - private boolean forceLeftClick(MouseHandler instance, Operation original) { - return true; - } - - @Override - public boolean mouseReleased(double mouseX, double mouseY, int button) { - if (button == 0) { - this.headerPressed = -1; - } - - return super.mouseReleased(mouseX, mouseY, button); - } -} +//@BugFix(id = "MC-201723", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "Statistics sprites don't look pressed when clicked") +//@Mixin(StatsScreen.ItemStatisticsList.class) +//public class StatsScreenMixin extends ObjectSelectionList { +// @Shadow +// protected int headerPressed; +// +// public StatsScreenMixin(Minecraft minecraft, int i, int j, int k, int l) { +// super(minecraft, i, j, k, l); +// } +// +// @WrapOperation(method = "renderHeader", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;isLeftPressed()Z")) +// private boolean forceLeftClick(MouseHandler instance, Operation original) { +// return true; +// } +// +// @Override +// public boolean mouseReleased(double mouseX, double mouseY, int button) { +// if (button == 0) { +// this.headerPressed = -1; +// } +// +// return super.mouseReleased(mouseX, mouseY, button); +// } +//} diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/AbstractContainerScreenMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/AbstractContainerScreenMixin.java index 7e2bbfd4..250b1177 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/AbstractContainerScreenMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/AbstractContainerScreenMixin.java @@ -2,6 +2,7 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.mojang.blaze3d.platform.InputConstants; +import com.mojang.blaze3d.platform.Window; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import dev.isxander.debugify.fixes.OS; @@ -14,9 +15,9 @@ @BugFix(id = "MC-22882", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, os = OS.MAC, modConflicts = "ctrl-q", description = "Ctrl + Q won't work on Mac") @Mixin(AbstractContainerScreen.class) public class AbstractContainerScreenMixin { - @ModifyExpressionValue(method = "keyPressed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/inventory/AbstractContainerScreen;hasControlDown()Z")) + @ModifyExpressionValue(method = "keyPressed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/input/KeyEvent;hasControlDown()Z")) private boolean hasControlDown(boolean ctrl) { - long window = Minecraft.getInstance().getWindow().getWindow(); + Window window = Minecraft.getInstance().getWindow(); return InputConstants.isKeyDown(window, GLFW.GLFW_KEY_LEFT_CONTROL) || InputConstants.isKeyDown(window, GLFW.GLFW_KEY_RIGHT_CONTROL); } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/MinecraftMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/MinecraftMixin.java index e3d5147a..dd58b690 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/MinecraftMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc22882/MinecraftMixin.java @@ -1,6 +1,7 @@ package dev.isxander.debugify.client.mixins.basic.mc22882; import com.mojang.blaze3d.platform.InputConstants; +import com.mojang.blaze3d.platform.Window; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import dev.isxander.debugify.fixes.OS; @@ -15,7 +16,7 @@ public class MinecraftMixin { @ModifyArg(method = "handleKeybinds", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;drop(Z)Z")) private boolean shouldDropEntireStack(boolean ctrlPressed) { - long window = Minecraft.getInstance().getWindow().getWindow(); + Window window = Minecraft.getInstance().getWindow(); return InputConstants.isKeyDown(window, GLFW.GLFW_KEY_LEFT_CONTROL) || InputConstants.isKeyDown(window, GLFW.GLFW_KEY_RIGHT_CONTROL); } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc242809/EditServerScreenMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc242809/EditServerScreenMixin.java index 49a96550..2b47164b 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc242809/EditServerScreenMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc242809/EditServerScreenMixin.java @@ -5,16 +5,16 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; -import net.minecraft.client.gui.screens.EditServerScreen; +import net.minecraft.client.gui.screens.ManageServerScreen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @BugFix(id = "MC-242809", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "IP field in the multiplayer menu will not detect the IP if a space is put at the beginning/end of it") -@Mixin(EditServerScreen.class) +@Mixin(ManageServerScreen.class) public class EditServerScreenMixin { - @Definition(id = "ipEdit", field = "Lnet/minecraft/client/gui/screens/EditServerScreen;ipEdit:Lnet/minecraft/client/gui/components/EditBox;") + @Definition(id = "ipEdit", field = "Lnet/minecraft/client/gui/screens/ManageServerScreen;ipEdit:Lnet/minecraft/client/gui/components/EditBox;") @Definition(id = "getValue", method = "Lnet/minecraft/client/gui/components/EditBox;getValue()Ljava/lang/String;") - @Expression("?.? = @(?.ipEdit.getValue())") + @Expression("?.?.? = @(?.ipEdit.getValue())") @ModifyExpressionValue(method = "onAdd", at = @At("MIXINEXTRAS:EXPRESSION")) private String trimIp(String ip) { return ip.trim(); diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java index 23b3305d..61cf3e77 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc251068/WorldSelectionListMixin.java @@ -20,7 +20,7 @@ public class WorldSelectionListMixin { @Final private Minecraft minecraft; - @WrapWithCondition(method = "method_20170", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V", ordinal = 1)) + @WrapWithCondition(method = "method_20170", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V")) private boolean dontShowEmptyWorldList(Minecraft instance, Screen screen) { return (this.minecraft.screen instanceof ProgressScreen || this.minecraft.screen instanceof ConfirmScreen); } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc263865/KeyboardHandlerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc263865/KeyboardHandlerMixin.java index 21ee7faa..abf549e0 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc263865/KeyboardHandlerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc263865/KeyboardHandlerMixin.java @@ -4,6 +4,7 @@ import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.KeyboardHandler; import net.minecraft.client.Minecraft; +import net.minecraft.client.input.KeyEvent; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -22,7 +23,7 @@ public class KeyboardHandlerMixin { at = @At(value = "INVOKE", target = "Lnet/minecraft/client/OptionInstance;set(Ljava/lang/Object;)V", ordinal = 0, shift = At.Shift.AFTER), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/Options;fullscreen()Lnet/minecraft/client/OptionInstance;")) ) - private void saveOptionsOnFullscreen(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) { + private void saveOptionsOnFullscreen(long window, int action, KeyEvent event, CallbackInfo ci) { this.minecraft.options.save(); } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc267469/AbstractSelectionListMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc267469/AbstractSelectionListMixin.java deleted file mode 100644 index fa3bfe34..00000000 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc267469/AbstractSelectionListMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -package dev.isxander.debugify.client.mixins.basic.mc267469; - -import com.llamalad7.mixinextras.expression.Expression; -import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import dev.isxander.debugify.fixes.BugFix; -import dev.isxander.debugify.fixes.FixCategory; -import net.minecraft.client.gui.components.AbstractSelectionList; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; - -@BugFix(id = "MC-267469", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "GUI List Entry highlight border not always aligned properly") -@Mixin(AbstractSelectionList.class) -public abstract class AbstractSelectionListMixin { - @Shadow - public abstract int getRowLeft(); - - @Shadow - public abstract int getRowRight(); - - @Expression("? = @(? + (? - ?) / 2)") - @ModifyExpressionValue(method = "renderSelection", at = @At("MIXINEXTRAS:EXPRESSION")) - private int modifyLeft(int i) { - return getRowLeft() - 2; - } - - @Expression("? = @(? + (? + ?) / 2)") - @ModifyExpressionValue(method = "renderSelection", at = @At("MIXINEXTRAS:EXPRESSION")) - private int modifyRight(int j) { - return getRowRight() - 2; - } -} diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc280220/DolphinCarryingItemLayerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc280220/DolphinCarryingItemLayerMixin.java index 358de6a6..e00778b3 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc280220/DolphinCarryingItemLayerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc280220/DolphinCarryingItemLayerMixin.java @@ -5,6 +5,7 @@ import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.SubmitNodeCollector; import net.minecraft.client.renderer.entity.layers.DolphinCarryingItemLayer; import net.minecraft.client.renderer.entity.state.DolphinRenderState; import org.spongepowered.asm.mixin.Mixin; @@ -15,8 +16,8 @@ @BugFix(id = "MC-280220", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "When a Dolphin holds an item, it is rendered upside-down") @Mixin(DolphinCarryingItemLayer.class) public class DolphinCarryingItemLayerMixin { - @Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/renderer/entity/state/DolphinRenderState;FF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/item/ItemStackRenderState;render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V")) - private void flipItem(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, DolphinRenderState dolphinRenderState, float f, float g, CallbackInfo ci) { + @Inject(method = "submit(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;ILnet/minecraft/client/renderer/entity/state/DolphinRenderState;FF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/item/ItemStackRenderState;submit(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;III)V")) + private void flipItem(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int i, DolphinRenderState dolphinRenderState, float f, float g, CallbackInfo ci) { poseStack.mulPose(Axis.ZP.rotationDegrees(180F)); poseStack.translate(0F, -0.4F, 0F); // Eyeballed value to make items not float } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc577/AbstractContainerScreenMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc577/AbstractContainerScreenMixin.java index 946e9ad3..f065c3ee 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc577/AbstractContainerScreenMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc577/AbstractContainerScreenMixin.java @@ -1,13 +1,16 @@ package dev.isxander.debugify.client.mixins.basic.mc577; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Local; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.client.input.MouseButtonEvent; import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.Slot; +import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -22,27 +25,33 @@ public abstract class AbstractContainerScreenMixin extends Screen { @Shadow protected abstract void slotClicked(Slot slot, int slotId, int button, ClickType actionType); + @Shadow + @Nullable + protected abstract Slot getHoveredSlot(double mouseX, double mouseY); + protected AbstractContainerScreenMixin(Component title) { super(title); } - @ModifyExpressionValue(method = "mouseClicked", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;mouseClicked(DDI)Z")) - private boolean shouldReturn(boolean parentMouseClicked, double mouseX, double mouseY, int button) { - return parentMouseClicked || mouseInventoryClose(button); + @ModifyExpressionValue(method = "mouseClicked", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;mouseClicked(Lnet/minecraft/client/input/MouseButtonEvent;Z)Z")) + private boolean shouldReturn(boolean parentMouseClicked, MouseButtonEvent event) { + return parentMouseClicked || debugify$mouseInventoryClose(event); } - @Inject(method = "mouseClicked", at = @At(value = "INVOKE", target = "Lnet/minecraft/Util;getMillis()J"), locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true) - private void dropWithMouse(double mouseX, double mouseY, int button, CallbackInfoReturnable cir, boolean isPickItem, Slot hoveredSlot) { - if (minecraft.options.keyDrop.matchesMouse(button)) { - if (hoveredSlot == null) return; - slotClicked(hoveredSlot, hoveredSlot.index, hasControlDown() ? 1 : 0, ClickType.THROW); + @Inject(method = "mouseClicked", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/inventory/AbstractContainerScreen;getHoveredSlot(DD)Lnet/minecraft/world/inventory/Slot;", shift = At.Shift.AFTER), cancellable = true) + private void dropWithMouse(MouseButtonEvent event, boolean isDoubleClick, CallbackInfoReturnable cir, @Local(ordinal = 1) boolean isPickedItem) { + // I am unable to capture this with @Local, so doing this instead + Slot slot = this.getHoveredSlot(event.x(), event.y()); + if (minecraft.options.keyDrop.matchesMouse(event)) { + if (slot == null) return; + slotClicked(slot, slot.index, event.hasControlDown() ? 1 : 0, ClickType.THROW); cir.setReturnValue(true); } } @Unique - private boolean mouseInventoryClose(int button) { - if (minecraft.options.keyInventory.matchesMouse(button)) { + private boolean debugify$mouseInventoryClose(MouseButtonEvent event) { + if (minecraft.options.keyInventory.matchesMouse(event)) { onClose(); return true; } diff --git a/src/client/resources/debugify.client.mixins.json b/src/client/resources/debugify.client.mixins.json index 0f1c0427..7b7dced1 100644 --- a/src/client/resources/debugify.client.mixins.json +++ b/src/client/resources/debugify.client.mixins.json @@ -24,10 +24,8 @@ "basic.mc165305.RenderPipelinesMixin", "basic.mc165381.LocalPlayerMixin", "basic.mc176559.MultiPlayerGameModeMixin", - "basic.mc183776.KeyboardHandlerMixin", "basic.mc197260.ArmorStandRendererMixin", "basic.mc197260.LivingEntityRendererMixin", - "basic.mc201723.StatsScreenMixin", "basic.mc210318.BookSignScreenMixin", "basic.mc211561.FishingHookRendererMixin", "basic.mc215531.GuiMixin", @@ -46,12 +44,10 @@ "basic.mc267376.GameRendererMixin", "basic.mc268420.GuiMixin", "basic.mc280220.DolphinCarryingItemLayerMixin", - "basic.mc267469.AbstractSelectionListMixin", "basic.mc298225.GameRendererMixin", "basic.mc298558.AtmosphericFogEnvironmentMixin", "basic.mc35361.MinecraftMixin", "basic.mc4490.FishingHookRendererMixin", - "basic.mc46503.ClientPacketListenerMixin", "basic.mc46737.GameRendererMixin", "basic.mc46766.MinecraftMixin", "basic.mc57057.GuardianAttackSoundInstanceMixin", diff --git a/src/main/java/dev/isxander/debugify/helpers/mc2025/AABBSerialization.java b/src/main/java/dev/isxander/debugify/helpers/mc2025/AABBSerialization.java deleted file mode 100644 index 1440af12..00000000 --- a/src/main/java/dev/isxander/debugify/helpers/mc2025/AABBSerialization.java +++ /dev/null @@ -1,16 +0,0 @@ -package dev.isxander.debugify.helpers.mc2025; - -import com.mojang.serialization.Codec; -import net.minecraft.Util; -import net.minecraft.world.phys.AABB; - -import java.util.List; - -public class AABBSerialization { - public static final Codec CODEC = Codec.DOUBLE - .listOf() - .comapFlatMap( - list -> Util.fixedSize(list, 6).map(listx -> new AABB(listx.get(0), listx.get(1), listx.get(2), listx.get(3), listx.get(4), listx.get(5))), - aabb -> List.of(aabb.minX, aabb.minY, aabb.minZ, aabb.maxX, aabb.maxY, aabb.maxZ) - ); -} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc147659/CatSpawnerMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc147659/CatSpawnerMixin.java new file mode 100644 index 00000000..5995563f --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc147659/CatSpawnerMixin.java @@ -0,0 +1,28 @@ +package dev.isxander.debugify.mixins.basic.mc147659; + +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import com.llamalad7.mixinextras.sugar.Local; +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.animal.Cat; +import net.minecraft.world.entity.npc.CatSpawner; +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-147659", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Some witch huts spawn the incorrect cat") +@Mixin(CatSpawner.class) +public class CatSpawnerMixin { + @WrapWithCondition(method = "spawnCat", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/animal/Cat;snapTo(Lnet/minecraft/core/BlockPos;FF)V")) + private boolean removeOldCatSnap(Cat instance, BlockPos blockPos, float yaw, float pitch) { + return false; + } + + @Inject(method = "spawnCat", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/animal/Cat;finalizeSpawn(Lnet/minecraft/world/level/ServerLevelAccessor;Lnet/minecraft/world/DifficultyInstance;Lnet/minecraft/world/entity/EntitySpawnReason;Lnet/minecraft/world/entity/SpawnGroupData;)Lnet/minecraft/world/entity/SpawnGroupData;")) + private void addNewCatSnap(BlockPos blockPos, ServerLevel serverLevel, boolean bl, CallbackInfo ci, @Local Cat cat) { + cat.snapTo(blockPos, 0F, 0F); + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index 32b992a1..b9b4ff10 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -13,7 +13,6 @@ "mixins": [ "basic.mc100991.FishingHookMixin", "basic.mc100991.ProjectileMixin", - "basic.mc119417.ServerPlayerMixin", "basic.mc119754.FireworkRocketEntityMixin", "basic.mc121706.RangedBowAttackGoalMixin", "basic.mc121903.MinecraftCommandBlockMixin", @@ -25,7 +24,6 @@ "basic.mc136249.LivingEntityMixin", "basic.mc139041.FishingRodItemMixin", "basic.mc147659.CatSpawnerMixin", - "basic.mc147784.FletchingTableBlockMixin", "basic.mc155509.PufferfishMixin", "basic.mc159283.DensityFunctionsMixin", "basic.mc160095.CactusBlockMixin", @@ -39,7 +37,6 @@ "basic.mc199467.MthMixin", "basic.mc200418.ZombieVillagerMixin", "basic.mc201374.CampfireBlockMixin", - "basic.mc2025.EntityMixin", "basic.mc202637.FoodPropertiesMixin", "basic.mc206922.EntityMixin", "basic.mc206922.ItemEntityMixin", @@ -60,9 +57,7 @@ "basic.mc272431.EnderDragonMixin", "basic.mc297837.WaypointTransmitterMixin", "basic.mc298066.LivingEntityMixin", - "basic.mc299115.ProjectileMixin", "basic.mc30391.LivingEntityMixin", - "basic.mc69216.ServerPlayerMixin", "basic.mc7569.RconConsoleSourceMixin", "basic.mc82263.EnderDragonMixin", "basic.mc84661.MobEffectsMixin", diff --git a/src/main/templates/fabric.mod.json b/src/main/templates/fabric.mod.json index cc17296f..2ba6a3da 100644 --- a/src/main/templates/fabric.mod.json +++ b/src/main/templates/fabric.mod.json @@ -31,7 +31,7 @@ }, "depends": { "fabricloader": ">=0.14.0", - "minecraft": "~1.21.6", + "minecraft": "1.21.10", "java": ">=21", "fabric-resource-loader-v0": "*" },