diff --git a/PATCHED.md b/PATCHED.md index 71363a69..81f9cf3f 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -43,7 +43,6 @@ | 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 | | Gameplay | [MC-31819](https://bugs.mojang.com/browse/MC-31819) | Hunger saturation depletes on Peaceful | | Basic | [MC-69216](https://bugs.mojang.com/browse/MC-69216) | Switching to spectator mode while fishing keeps rod cast | -| Basic | [MC-72151](https://bugs.mojang.com/browse/MC-72151) | Snow Golem's snowballs damage wolves instead of pushing them | | 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-88371](https://bugs.mojang.com/browse/MC-88371) | Ender Dragon flies down in the void when the exit portal is destroyed | | Basic | [MC-89146](https://bugs.mojang.com/browse/MC-89146) | Pistons forget update when being reloaded | @@ -96,3 +95,5 @@ Bugs that this mod has patched but has been superseded by a vanilla update. | [MC-121772](https://bugs.mojang.com/browse/MC-121772) | Can't scroll while holding SHIFT on macOS | 23w31a | | [MC-140646](https://bugs.mojang.com/browse/MC-140646) | Text fields don't scroll while selecting text with Shift | 23w31a | | [MC-90084](https://bugs.mojang.com/browse/MC-90084) | When sitting in boats and boats with chest mobs legs penetrate the hull | 23w31a | +| [MC-72151](https://bugs.mojang.com/browse/MC-72151) | Snow Golem's snowballs damage wolves instead of pushing them | 24w06a | + diff --git a/build.gradle.kts b/build.gradle.kts index de4eab23..6f1e557c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ import ru.vyarus.gradle.plugin.python.task.PythonTask plugins { java - id("fabric-loom") version "1.4.+" + id("fabric-loom") version "1.6.+" id("com.modrinth.minotaur") version "2.7.+" id("me.hypherionmc.cursegradle") version "2.+" @@ -18,7 +18,7 @@ plugins { } group = "dev.isxander" -version = "1.20.4+1.1" +version = "1.20.5+1.0" loom { splitEnvironmentSourceSets() @@ -94,7 +94,7 @@ dependencies { modImplementation(fabricApi.module("fabric-resource-loader-v0", fabricApiVersion)) modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion") - "modClientImplementation"("dev.isxander.yacl:yet-another-config-lib-fabric:$yaclVersion") { exclude(module = "fabric-loader") } + "modClientImplementation"("dev.isxander:yet-another-config-lib:$yaclVersion") { exclude(module = "fabric-loader") } "modClientImplementation"("com.terraformersmc:modmenu:$modMenuVersion") { exclude(module = "fabric-loader") } "gametestImplementation"(sourceSets.main.get().output) @@ -104,7 +104,7 @@ dependencies { tasks.withType { options.encoding = "UTF-8" - options.release.set(17) + options.release.set(21) } java { @@ -177,7 +177,7 @@ if (hasProperty("curseforge.token")) { addGameVersion(minecraftVersion) addGameVersion("Fabric") addGameVersion("Quilt") - addGameVersion("Java 17") + addGameVersion("Java 21") relations(closureOf { requiredDependency("yacl") diff --git a/gradle.properties b/gradle.properties index 23656eb1..bfdd6547 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,11 @@ org.gradle.jvmargs=-Xmx4G org.gradle.parallel=true org.gradle.parallel.threads=2 -minecraftVersion=1.20.4 -fabricLoaderVersion=0.15.2 +minecraftVersion=1.20.5 +fabricLoaderVersion=0.15.10 qmBuild=0 # Libraries -fabricApiVersion=0.91.3+1.20.4 -yaclVersion=3.3.1+1.20.4 -modMenuVersion=9.0.0-pre.1 +fabricApiVersion=0.97.2+1.20.5 +yaclVersion=3.4.0+1.20.5-fabric +modMenuVersion=10.0.0-alpha.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 27313fbc..d951fac2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc111516/PlayerRendererMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc111516/PlayerRendererMixin.java index e941648c..c4da8020 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc111516/PlayerRendererMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc111516/PlayerRendererMixin.java @@ -18,7 +18,7 @@ @BugFix(id = "MC-111516", category = FixCategory.BASIC, env = BugFix.Env.CLIENT) @Mixin(PlayerRenderer.class) public final class PlayerRendererMixin { - @ModifyArg(method = "setupRotations(Lnet/minecraft/client/player/AbstractClientPlayer;Lcom/mojang/blaze3d/vertex/PoseStack;FFF)V", at = @At(value = "INVOKE", target = "java/lang/Math.acos(D)D")) + @ModifyArg(method = "setupRotations(Lnet/minecraft/client/player/AbstractClientPlayer;Lcom/mojang/blaze3d/vertex/PoseStack;FFFF)V", at = @At(value = "INVOKE", target = "java/lang/Math.acos(D)D")) private double clampAcos(double a) { return Math.min(a, 1.0); } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc116379/FishingHookRendererMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc116379/FishingHookRendererMixin.java index 9eb09282..d46af85f 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc116379/FishingHookRendererMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc116379/FishingHookRendererMixin.java @@ -15,7 +15,7 @@ @BugFix(id = "MC-116379", category = FixCategory.BASIC, env = BugFix.Env.CLIENT) @Mixin(FishingHookRenderer.class) public class FishingHookRendererMixin { - @ModifyVariable(method = "render", at = @At("STORE"), ordinal = 2) + @ModifyVariable(method = "render(Lnet/minecraft/world/entity/projectile/FishingHook;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("STORE"), ordinal = 2) private float modifyHandSwingProgress(float handSwingProgress, FishingHook bobber) { Player player = bobber.getPlayerOwner(); int j = player.getMainArm() == HumanoidArm.RIGHT ? 1 : -1; diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/ItemStackAccessor.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/ItemStackAccessor.java new file mode 100644 index 00000000..6d36d98a --- /dev/null +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/ItemStackAccessor.java @@ -0,0 +1,12 @@ +package dev.isxander.debugify.client.mixins.basic.mc176559; + +import net.minecraft.core.component.PatchedDataComponentMap; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(ItemStack.class) +public interface ItemStackAccessor { + @Accessor + PatchedDataComponentMap getComponents(); +} diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/MultiPlayerGameModeMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/MultiPlayerGameModeMixin.java index d1c91e70..c4232cd5 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/MultiPlayerGameModeMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc176559/MultiPlayerGameModeMixin.java @@ -1,72 +1,47 @@ package dev.isxander.debugify.client.mixins.basic.mc176559; -import com.llamalad7.mixinextras.injector.ModifyReturnValue; +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 org.spongepowered.asm.mixin.Final; +import net.minecraft.core.component.PatchedDataComponentMap; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.Slice; -import java.util.HashSet; import java.util.Objects; -import java.util.Set; -import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.MultiPlayerGameMode; -import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; -@BugFix(id = "MC-176559", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, modConflicts = "fabric-api") -@Mixin(MultiPlayerGameMode.class) +@BugFix(id = "MC-176559", category = FixCategory.BASIC, env = BugFix.Env.CLIENT) +@Mixin(value = MultiPlayerGameMode.class, priority = 1010) public class MultiPlayerGameModeMixin { - @Shadow private ItemStack destroyingItem; - - @Shadow @Final private Minecraft minecraft; - - @Redirect(method = "sameDestroyTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isSameItemSameTags(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)Z")) - private boolean isSameItem(ItemStack itemStack, ItemStack itemStack2) { - return !canCauseBlockBreakReset(destroyingItem, minecraft.player.getMainHandItem()); + // Fabric API also redirects here. WrapOperation is compatible + @WrapOperation(method = "sameDestroyTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isSameItemSameComponents(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)Z")) + private boolean isSameItem(ItemStack mainHandItem, ItemStack destroyingItem, Operation original) { + return isSameItemSameComponentsIgnoringDurability(mainHandItem, destroyingItem); } - /** - * Taken from MinecraftForge - * under LGPLv2.1 license - *
- * It has been adapted into a mixin with yarn mappings for use in fabric - * - * @author BlueAgent - */ - private boolean canCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack) { - try { - if (!newStack.is(oldStack.getItem())) - return true; - - if (!newStack.isDamageableItem() || !oldStack.isDamageableItem()) - return !ItemStack.isSameItemSameTags(newStack, oldStack); - - CompoundTag newTag = newStack.getTag(); - CompoundTag oldTag = oldStack.getTag(); - - if (newTag == null || oldTag == null) - return !(newTag == null && oldTag == null); - - Set newKeys = new HashSet<>(newTag.getAllKeys()); - Set oldKeys = new HashSet<>(oldTag.getAllKeys()); - - newKeys.remove(ItemStack.TAG_DAMAGE); - oldKeys.remove(ItemStack.TAG_DAMAGE); - - if (!newKeys.equals(oldKeys)) - return true; - - return !newKeys.stream().allMatch(key -> Objects.equals(newTag.get(key), oldTag.get(key))); - } catch (Throwable t) { - t.printStackTrace(); + @Unique + private boolean isSameItemSameComponentsIgnoringDurability(ItemStack stack1, ItemStack stack2) { + if (!stack1.is(stack2.getItem())) { return false; + } else if (stack1.isEmpty() && stack2.isEmpty()) { + return true; + } else { + int damage1 = stack1.getDamageValue(); + int damage2 = stack2.getDamageValue(); + stack1.setDamageValue(0); + stack2.setDamageValue(0); + + PatchedDataComponentMap components1 = ((ItemStackAccessor) (Object) stack1).getComponents(); + PatchedDataComponentMap components2 = ((ItemStackAccessor) (Object) stack2).getComponents(); + boolean comparison = Objects.equals(components1, components2); + + stack1.setDamageValue(damage1); + stack2.setDamageValue(damage2); + + return comparison; } - } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc215531/GuiMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc215531/GuiMixin.java index a4c5404e..829463e5 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc215531/GuiMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc215531/GuiMixin.java @@ -15,7 +15,7 @@ public class GuiMixin { @Shadow @Final private Minecraft minecraft; - @ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z")) + @ModifyExpressionValue(method = "renderCameraOverlays", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z")) private boolean shouldRenderPumpkinOverlay(boolean pumpkinOnHead) { return pumpkinOnHead && !minecraft.player.isSpectator(); } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc217716/GameRendererMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc217716/GameRendererMixin.java index 04a71b61..9a0ee761 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc217716/GameRendererMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc217716/GameRendererMixin.java @@ -1,8 +1,10 @@ package dev.isxander.debugify.client.mixins.basic.mc217716; +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.GameRenderer; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import org.spongepowered.asm.mixin.Final; @@ -13,10 +15,10 @@ @BugFix(id = "MC-217716", category = FixCategory.BASIC, env = BugFix.Env.CLIENT) @Mixin(GameRenderer.class) public class GameRendererMixin { - @Shadow @Final private Minecraft minecraft; + @Shadow @Final Minecraft minecraft; - @ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;hasEffect(Lnet/minecraft/world/effect/MobEffect;)Z")) - private boolean shouldShowNauseaOverlay(boolean hasNausea) { - return hasNausea && !minecraft.player.isSpectator(); + @WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;renderConfusionOverlay(Lnet/minecraft/client/gui/GuiGraphics;F)V")) + private boolean shouldShowNauseaOverlay(GameRenderer instance, GuiGraphics guiGraphics, float f) { + return !minecraft.player.isSpectator(); } } diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc4490/FishingHookRendererMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc4490/FishingHookRendererMixin.java index 0f92052d..bfe023f4 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc4490/FishingHookRendererMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc4490/FishingHookRendererMixin.java @@ -1,16 +1,18 @@ package dev.isxander.debugify.client.mixins.basic.mc4490; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.renderer.entity.FishingHookRenderer; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Constant; import org.spongepowered.asm.mixin.injection.ModifyConstant; @BugFix(id = "MC-4490", category = FixCategory.BASIC, env = BugFix.Env.CLIENT) @Mixin(FishingHookRenderer.class) public class FishingHookRendererMixin { - @ModifyConstant(method = "render", constant = @Constant(floatValue = -0.1875F)) + @ModifyExpressionValue(method = "getPlayerHandPos", at = @At(value = "CONSTANT", args = "floatValue=-0.1875")) private float renderSneakOffset(float constant) { return -0.2875F; } 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 8d84634d..0a2398f2 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 @@ -10,6 +10,7 @@ import net.minecraft.world.inventory.Slot; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -37,6 +38,7 @@ private void dropWithMouse(double mouseX, double mouseY, int button, CallbackInf } } + @Unique private boolean mouseInventoryClose(int button) { if (minecraft.options.keyInventory.matchesMouse(button)) { onClose(); diff --git a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc90683/ClientPacketListenerMixin.java b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc90683/ClientPacketListenerMixin.java index 8c5cf0bf..fa85ef5a 100644 --- a/src/client/java/dev/isxander/debugify/client/mixins/basic/mc90683/ClientPacketListenerMixin.java +++ b/src/client/java/dev/isxander/debugify/client/mixins/basic/mc90683/ClientPacketListenerMixin.java @@ -1,6 +1,6 @@ package dev.isxander.debugify.client.mixins.basic.mc90683; -import com.llamalad7.mixinextras.injector.WrapWithCondition; +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.client.multiplayer.ClientPacketListener; diff --git a/src/client/resources/debugify.client.mixins.json b/src/client/resources/debugify.client.mixins.json index c22b3778..e4a86e6c 100644 --- a/src/client/resources/debugify.client.mixins.json +++ b/src/client/resources/debugify.client.mixins.json @@ -45,5 +45,8 @@ "basic.mc93384.LivingEntityMixin", "gameplay.mc12829.LivingEntityMixin", "gameplay.mc12829.PlayerMixin" + ], + "mixins": [ + "basic.mc176559.ItemStackAccessor" ] } diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc124177/ServerPlayerMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc124177/ServerPlayerMixin.java index c893fb62..298996af 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc124177/ServerPlayerMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc124177/ServerPlayerMixin.java @@ -30,7 +30,7 @@ public ServerPlayerMixin(Level world, BlockPos pos, float yaw, GameProfile gameP @Inject(method = "teleportTo(Lnet/minecraft/server/level/ServerLevel;DDDFF)V", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/server/players/PlayerList;sendAllPlayerInfo(Lnet/minecraft/server/level/ServerPlayer;)V")) public void afterCrossDimensionalTeleport(CallbackInfo cb) { for (MobEffectInstance eff : getActiveEffects()) { - connection.send(new ClientboundUpdateMobEffectPacket(this.getId(), eff)); + connection.send(new ClientboundUpdateMobEffectPacket(this.getId(), eff, false)); } this.connection.send(new ClientboundSetExperiencePacket(experienceProgress, totalExperience, experienceLevel)); diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc179072/SwellMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc179072/SwellGoalMixin.java similarity index 96% rename from src/main/java/dev/isxander/debugify/mixins/basic/mc179072/SwellMixin.java rename to src/main/java/dev/isxander/debugify/mixins/basic/mc179072/SwellGoalMixin.java index fdaed26b..7476ed8f 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc179072/SwellMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc179072/SwellGoalMixin.java @@ -12,7 +12,7 @@ @BugFix(id = "MC-179072", category = FixCategory.BASIC, env = BugFix.Env.SERVER) @Mixin(SwellGoal.class) -public class SwellMixin { +public class SwellGoalMixin { @Shadow private @Nullable LivingEntity target; @ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/ai/sensing/Sensing;hasLineOfSight(Lnet/minecraft/world/entity/Entity;)Z")) diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc231743/FlowerPotBlockMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc231743/FlowerPotBlockMixin.java index 75419f94..ed2fbb7e 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc231743/FlowerPotBlockMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc231743/FlowerPotBlockMixin.java @@ -5,8 +5,9 @@ import net.minecraft.core.BlockPos; import net.minecraft.stats.Stats; import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; +import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.FlowerPotBlock; import net.minecraft.world.level.block.state.BlockState; @@ -19,8 +20,8 @@ @BugFix(id = "MC-231743", category = FixCategory.BASIC, env = BugFix.Env.SERVER) @Mixin(FlowerPotBlock.class) public class FlowerPotBlockMixin { - @Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;awardStat(Lnet/minecraft/resources/ResourceLocation;)V")) - private void onIncrementPottedPlantStat(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit, CallbackInfoReturnable cir) { + @Inject(method = "useItemOn", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;awardStat(Lnet/minecraft/resources/ResourceLocation;)V")) + private void onIncrementPottedPlantStat(ItemStack itemStack, BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult blockHitResult, CallbackInfoReturnable cir) { player.awardStat(Stats.ITEM_USED.get(player.getItemInHand(hand).getItem())); } } diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc30391/LivingEntityMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc30391/LivingEntityMixin.java index df3b9013..9d46f1e4 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc30391/LivingEntityMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc30391/LivingEntityMixin.java @@ -13,9 +13,9 @@ @BugFix(id = "MC-30391", category = FixCategory.BASIC, env = BugFix.Env.SERVER) @Mixin(LivingEntity.class) public class LivingEntityMixin { - @ModifyExpressionValue(method = "checkFallDamage", at = @At(value = "FIELD", target = "Lnet/minecraft/world/level/Level;isClientSide:Z", ordinal = 1)) - private boolean shouldntSpawnParticles(boolean isClient) { + @ModifyExpressionValue(method = "checkFallDamage", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;isAir()Z")) + private boolean shouldntSpawnParticles(boolean isAir) { LivingEntity self = (LivingEntity) (Object) this; - return isClient || self instanceof Chicken || self instanceof Blaze || self instanceof WitherBoss; + return isAir || self instanceof Chicken || self instanceof Blaze || self instanceof WitherBoss; } } diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc72151/WolfMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc72151/WolfMixin.java deleted file mode 100644 index 1313332b..00000000 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc72151/WolfMixin.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.isxander.debugify.mixins.basic.mc72151; - -import dev.isxander.debugify.fixes.BugFix; -import dev.isxander.debugify.fixes.FixCategory; -import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.animal.Wolf; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.entity.projectile.AbstractArrow; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyVariable; - -@BugFix(id = "MC-72151", category = FixCategory.BASIC, env = BugFix.Env.SERVER) -@Mixin(Wolf.class) -public class WolfMixin { - @ModifyVariable(method = "hurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/TamableAnimal;hurt(Lnet/minecraft/world/damagesource/DamageSource;F)Z", shift = At.Shift.BEFORE), ordinal = 0, argsOnly = true) - private float modifyAmount(float amount, DamageSource source) { - Entity entity = source.getEntity(); - - if (entity != null && !(entity instanceof Player) && !(entity instanceof AbstractArrow)) { - // wolves modify damage = (amount + 1) / 2 - // so (0 + 1) / 2 = 0.5 - if (amount == 0.5) - return 0; - } - - // else just turn the original - return amount; - } -} diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc89146/ChunkAccessMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc89146/ChunkAccessMixin.java index 14a95349..10fb580c 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc89146/ChunkAccessMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc89146/ChunkAccessMixin.java @@ -1,22 +1,25 @@ package dev.isxander.debugify.mixins.basic.mc89146; -import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; +import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; -import java.util.HashMap; -import java.util.LinkedHashMap; +import java.util.Map; + import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.chunk.ChunkAccess; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @BugFix(id = "MC-89146", category = FixCategory.BASIC, env = BugFix.Env.SERVER) @Mixin(ChunkAccess.class) public class ChunkAccessMixin { - @ModifyExpressionValue(method = "", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Maps;newHashMap()Ljava/util/HashMap;", ordinal = 3)) - private HashMap wrapLinkedHashMap(HashMap hashMap) { - return new LinkedHashMap<>(hashMap); - } + @Shadow @Final @Mutable + protected Map blockEntities = new Object2ObjectLinkedOpenHashMap<>(); } diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc93018/AnimalMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc93018/AnimalMixin.java index c9151c5e..4a1954f8 100644 --- a/src/main/java/dev/isxander/debugify/mixins/basic/mc93018/AnimalMixin.java +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc93018/AnimalMixin.java @@ -1,6 +1,6 @@ package dev.isxander.debugify.mixins.basic.mc93018; -import com.llamalad7.mixinextras.injector.WrapWithCondition; +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; import dev.isxander.debugify.fixes.BugFix; import dev.isxander.debugify.fixes.FixCategory; import net.minecraft.world.entity.animal.Animal; diff --git a/src/main/resources/debugify.accesswidener b/src/main/resources/debugify.accesswidener index a814ce6c..55028891 100644 --- a/src/main/resources/debugify.accesswidener +++ b/src/main/resources/debugify.accesswidener @@ -1,6 +1,6 @@ accessWidener v2 named accessible class net/minecraft/client/Options$FieldAccess -accessible method net/minecraft/client/Options$FieldAccess process (Ljava/lang/String;Lnet/minecraft/client/OptionInstance;)V +#accessible method net/minecraft/client/Options$FieldAccess process (Ljava/lang/String;Lnet/minecraft/client/OptionInstance;)V accessible class net/minecraft/client/gui/screens/telemetry/TelemetryEventWidget$ContentBuilder accessible class net/minecraft/client/gui/screens/telemetry/TelemetryEventWidget$Content diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index 349e6bf2..35a09370 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -21,7 +21,7 @@ "basic.mc14923.ServerGamePacketListenerImplMixin", "basic.mc155509.PufferfishMixin", "basic.mc160095.CactusBlockMixin", - "basic.mc179072.SwellMixin", + "basic.mc179072.SwellGoalMixin", "basic.mc183990.MobMixin", "basic.mc193343.PlayerMixin", "basic.mc199467.MthMixin", @@ -36,7 +36,6 @@ "basic.mc232869.StriderMixin", "basic.mc30391.LivingEntityMixin", "basic.mc69216.ServerPlayerMixin", - "basic.mc72151.WolfMixin", "basic.mc7569.RconConsoleSourceMixin", "basic.mc88371.DragonLandingPhaseMixin", "basic.mc89146.ChunkAccessMixin", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3e81f486..aa6b0ac1 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -39,7 +39,7 @@ "accessWidener": "debugify.accesswidener", "depends": { "fabricloader": ">=0.14.0", - "minecraft": ["1.20.3", "1.20.4"], + "minecraft": "1.20.5", "java": ">=17", "fabric-resource-loader-v0": "*" },