diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0c53a4e6d4..a1464e1eca 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,8 +4,5 @@ Make sure to clear this after each release What's new: ----------------- -- Removed embedded NBT Crafting (backported from 1.20.2) -- Updated block registration to start on class load -- Updated liquid block renderer mixin requirements to 0 -- Changed creative tab handling to be more safe -- Updated embedded FrozenLib to 1.3.13 +- Updated mixins to be more lenient if they can't be applied +- Added compatibility for Embeddium if used on Forge via Sinytra Connector diff --git a/gradle.properties b/gradle.properties index 58438b8857..e990039556 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ # Mod Properties mod_id = wilderwild - mod_version = 2.1.7 + mod_version = 2.1.8 mod_loader = Fabric maven_group = net.frozenblock archives_base_name = WilderWild diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/WilderWildMixinPlugin.java b/src/main/java/net/frozenblock/wilderwild/mixin/WilderWildMixinPlugin.java index a136f1b056..6f8dc1f376 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/WilderWildMixinPlugin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/WilderWildMixinPlugin.java @@ -21,6 +21,8 @@ import java.util.List; import java.util.Set; import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.loader.api.Version; +import net.fabricmc.loader.api.VersionParsingException; import net.frozenblock.lib.FrozenBools; import net.frozenblock.wilderwild.misc.WilderPreMixinInjectConstants; import org.jetbrains.annotations.NotNull; @@ -31,6 +33,7 @@ public class WilderWildMixinPlugin implements IMixinConfigPlugin { private static final String MIXIN_PATH = "net.frozenblock.wilderwild.mixin."; + private static final boolean FORGE = FabricLoader.getInstance().isModLoaded("connector"); @Override public void onLoad(String mixinPackage) { @@ -46,9 +49,16 @@ public String getRefMapperConfig() { @Override public boolean shouldApplyMixin(String targetClassName, @NotNull String mixinClassName) { if (mixinClassName.contains("sodium")) { + if (FORGE) + try { + return FabricLoader.getInstance().isModLoaded("embeddium") && FabricLoader.getInstance().getModContainer("embeddium").orElseThrow().getMetadata().getVersion().compareTo(Version.parse("0.2")) > 0; + } catch (VersionParsingException e) { + return false; + } return FrozenBools.HAS_SODIUM && FabricLoader.getInstance().getModContainer("sodium").orElseThrow().getMetadata().getVersion().getFriendlyString().contains("0.5."); } if (mixinClassName.contains("LiquidBlockRenderer") || mixinClassName.contains("CloudRenderer") || mixinClassName.contains("EntityRenderDispatcher")) { + if (FORGE) return !FabricLoader.getInstance().isModLoaded("embeddium"); return !FrozenBools.HAS_SODIUM; } if (mixinClassName.contains("fallingleaves")) { diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/MerpSlimeRenderer.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/MerpSlimeRenderer.java index 3a4f4a009f..fc5ccd8f8a 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/MerpSlimeRenderer.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/MerpSlimeRenderer.java @@ -40,7 +40,7 @@ public final class MerpSlimeRenderer { @Unique private static final ResourceLocation WILDERWILD$MERP_SLIME = WilderSharedConstants.id("textures/entity/slime/merp_slime.png"); - @Inject(method = "getTextureLocation(Lnet/minecraft/world/entity/monster/Slime;)Lnet/minecraft/resources/ResourceLocation;", at = @At("RETURN"), cancellable = true) + @Inject(method = "getTextureLocation(Lnet/minecraft/world/entity/monster/Slime;)Lnet/minecraft/resources/ResourceLocation;", at = @At("RETURN"), cancellable = true, require = 0) public void wilderWild$getTextureLocation(@NotNull Slime slimeEntity, CallbackInfoReturnable info) { if (Objects.equals(ChatFormatting.stripFormatting(slimeEntity.getName().getString()), "Merp")) { info.setReturnValue(WILDERWILD$MERP_SLIME); diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/ScottTheWozMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/ScottTheWozMixin.java index c1fc885a05..c80ccc9bea 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/ScottTheWozMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/ScottTheWozMixin.java @@ -45,7 +45,7 @@ public class ScottTheWozMixin { @Final private User user; - @Inject(method = "getSplash", at = @At("TAIL"), cancellable = true) + @Inject(method = "getSplash", at = @At("TAIL"), cancellable = true, require = 0) public void wilderWild$getSplash(CallbackInfoReturnable info) { String lowerName = this.user.getName().toLowerCase(); if (this.user != null && (RANDOM.nextInt(this.splashes.size()) == 42 || lowerName.contains("scot") || lowerName.contains("skot") || lowerName.contains("sct") || lowerName.contains("skt"))) { diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/UppyBalloo.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/UppyBalloo.java index 0fcb4369f8..b32ee6e7b2 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/UppyBalloo.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/easter/UppyBalloo.java @@ -38,7 +38,7 @@ public final class UppyBalloo { @Unique private static final ResourceLocation WILDERWILD$UPPY_BALLOO = WilderSharedConstants.id("textures/entity/pig/uppy_balloo.png"); - @Inject(method = "getTextureLocation(Lnet/minecraft/world/entity/animal/Pig;)Lnet/minecraft/resources/ResourceLocation;", at = @At("RETURN"), cancellable = true) + @Inject(method = "getTextureLocation(Lnet/minecraft/world/entity/animal/Pig;)Lnet/minecraft/resources/ResourceLocation;", at = @At("RETURN"), cancellable = true, require = 0) public void wilderWild$getTextureLocation(Pig pig, CallbackInfoReturnable info) { String string = ChatFormatting.stripFormatting(pig.getName().getString()); if (string != null && string.equalsIgnoreCase("a view from the top")) { diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/general/AllayModelMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/general/AllayModelMixin.java index 170a1d58f8..1096804d8a 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/general/AllayModelMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/general/AllayModelMixin.java @@ -52,7 +52,7 @@ public abstract class AllayModelMixin extends HierarchicalModel implement @Final private ModelPart root; - @Inject(method = "setupAnim(Lnet/minecraft/world/entity/animal/allay/Allay;FFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;lerp(FFF)F")) + @Inject(method = "setupAnim(Lnet/minecraft/world/entity/animal/allay/Allay;FFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;lerp(FFF)F"), require = 0) private void wilderWild$setupAnim(Allay allay, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, CallbackInfo info) { if (EntityConfig.get().allay.keyframeAllayDance) { this.root.yRot = 0.0F; diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/general/EntityRenderDispatcherMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/general/EntityRenderDispatcherMixin.java index 3345dc696a..8eea2111cb 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/general/EntityRenderDispatcherMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/general/EntityRenderDispatcherMixin.java @@ -43,13 +43,13 @@ public class EntityRenderDispatcherMixin { @Unique private static BlockState wilderWild$currentBlockState; - @ModifyExpressionValue(method = "renderBlockShadow", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/chunk/ChunkAccess;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;")) + @ModifyExpressionValue(method = "renderBlockShadow", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/chunk/ChunkAccess;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;"), require = 0) private static BlockState wilderWild$captureBlockState(BlockState original) { wilderWild$currentBlockState = original; return original; } - @Inject(method = "renderBlockShadow", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LightTexture;getBrightness(Lnet/minecraft/world/level/dimension/DimensionType;I)F", shift = At.Shift.BEFORE), cancellable = true) + @Inject(method = "renderBlockShadow", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LightTexture;getBrightness(Lnet/minecraft/world/level/dimension/DimensionType;I)F", shift = At.Shift.BEFORE), cancellable = true, require = 0) private static void wilderWild$stopRenderIfMesoglea(PoseStack.Pose pose, VertexConsumer vertexConsumer, ChunkAccess chunkAccess, LevelReader levelReader, BlockPos blockPos, double d, double e, double f, float g, float h, CallbackInfo info) { if (wilderWild$currentBlockState.getBlock() instanceof MesogleaBlock && (wilderWild$currentBlockState.hasProperty(BlockStateProperties.WATERLOGGED) && wilderWild$currentBlockState.getValue(BlockStateProperties.WATERLOGGED))) { info.cancel(); diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/general/LevelRendererMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/general/LevelRendererMixin.java index 4dd84bb3f6..f957313298 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/general/LevelRendererMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/general/LevelRendererMixin.java @@ -44,7 +44,7 @@ public class LevelRendererMixin { @Nullable private ClientLevel level; - @ModifyExpressionValue(method = "levelEvent", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getValue(Lnet/minecraft/world/level/block/state/properties/Property;)Ljava/lang/Comparable;", ordinal = 0)) + @ModifyExpressionValue(method = "levelEvent", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getValue(Lnet/minecraft/world/level/block/state/properties/Property;)Ljava/lang/Comparable;", ordinal = 0), require = 0) private Comparable wilderWild$shriekerGargle(Comparable original, int eventId, BlockPos pos, int data) { if (BlockConfig.get().shriekerGargling) { if (original.compareTo(true) == 0 || this.level.getFluidState(pos.above()).is(FluidTags.WATER)) { diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/mesoglea_column/BubbleColumnAmbientSoundHandlerMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/mesoglea_column/BubbleColumnAmbientSoundHandlerMixin.java index 3ef1ac8a6b..2c38be9286 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/mesoglea_column/BubbleColumnAmbientSoundHandlerMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/mesoglea_column/BubbleColumnAmbientSoundHandlerMixin.java @@ -32,17 +32,17 @@ @Mixin(BubbleColumnAmbientSoundHandler.class) public class BubbleColumnAmbientSoundHandlerMixin { - @WrapOperation(method = "method_29714(Lnet/minecraft/world/level/block/state/BlockState;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z", ordinal = 0)) + @WrapOperation(method = "method_29714(Lnet/minecraft/world/level/block/state/BlockState;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z", ordinal = 0), require = 0) private static boolean wilderWild$filterWithMesoglea(BlockState state, Block block, Operation operation) { return operation.call(state, block) || MesogleaBlock.hasBubbleColumn(state); } - @WrapOperation(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z", ordinal = 0)) + @WrapOperation(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/world/level/block/Block;)Z", ordinal = 0), require = 0) private static boolean wilderWild$mesogleaAndBubbleCheck(BlockState state, Block block, Operation operation) { return operation.call(state, block) || MesogleaBlock.hasBubbleColumn(state); } - @WrapOperation(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getValue(Lnet/minecraft/world/level/block/state/properties/Property;)Ljava/lang/Comparable;", ordinal = 0)) + @WrapOperation(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getValue(Lnet/minecraft/world/level/block/state/properties/Property;)Ljava/lang/Comparable;", ordinal = 0), require = 0) private static Comparable wilderWild$blockStateValueCheckWithMesoglea(BlockState state, Property property, Operation> operation) { return state.hasProperty(BubbleColumnBlock.DRAG_DOWN) ? operation.call(state, property) : MesogleaBlock.isDraggingDown(state); } diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenAnimationOverwrites.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenAnimationOverwrites.java index 322e77a3e0..15ada22e43 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenAnimationOverwrites.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenAnimationOverwrites.java @@ -41,19 +41,19 @@ public class WardenAnimationOverwrites { @Final @Mutable @Shadow - public static AnimationDefinition WARDEN_EMERGE; + private static AnimationDefinition WARDEN_EMERGE; @Final @Mutable @Shadow - public static AnimationDefinition WARDEN_SNIFF; + private static AnimationDefinition WARDEN_SNIFF; @Shadow @Final @Mutable - public static AnimationDefinition WARDEN_DIG; + private static AnimationDefinition WARDEN_DIG; - @Inject(method = "", at = @At("TAIL")) + @Inject(method = "", at = @At("TAIL"), require = 0) private static void wilderWild$config(CallbackInfo info) { //TODO: config option for improved & dig WARDEN_DIG = AnimationDefinition.Builder.withLength(5.167667f) diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenModelMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenModelMixin.java index 03695cd9d9..028d7a3196 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenModelMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/warden/WardenModelMixin.java @@ -75,9 +75,9 @@ public class WardenModelMixin { @Shadow protected ModelPart rightArm; - @Inject(at = @At("TAIL"), method = "animateTendrils", locals = LocalCapture.CAPTURE_FAILHARD) + @Inject(at = @At("TAIL"), method = "animateTendrils", locals = LocalCapture.CAPTURE_FAILHARD, require = 0) private void wilderWild$animateCustomTendrils(T warden, float animationProgress, float tickDelta, CallbackInfo info, float cos) { //CUSTOM TENDRIL ANIMATION - float sin = warden.getTendrilAnimation(tickDelta) * (float) (-Math.sin((double) animationProgress * 2.25D) * Math.PI * 0.1F); + float sin = warden.getTendrilAnimation(tickDelta) * (float) (-Math.sin(animationProgress * 2.25D) * Math.PI * 0.1F); if (EntityConfig.get().warden.wardenCustomTendrils) { this.leftTendril.xRot = cos; @@ -93,7 +93,7 @@ public class WardenModelMixin { } } - @Inject(method = "setupAnim(Lnet/minecraft/world/entity/monster/warden/Warden;FFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/WardenModel;animate(Lnet/minecraft/world/entity/AnimationState;Lnet/minecraft/client/animation/AnimationDefinition;F)V", ordinal = 0, shift = At.Shift.BEFORE)) + @Inject(method = "setupAnim(Lnet/minecraft/world/entity/monster/warden/Warden;FFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/WardenModel;animate(Lnet/minecraft/world/entity/AnimationState;Lnet/minecraft/client/animation/AnimationDefinition;F)V", ordinal = 0, shift = At.Shift.BEFORE), require = 0) private void wilderWild$setupAnim(T wardenEntity, float angle, float distance, float anim, float headYaw, float headPitch, CallbackInfo info) { boolean canSwim = !wardenEntity.hasPose(Pose.EMERGING) && !wardenEntity.hasPose(Pose.DIGGING) && !wardenEntity.hasPose(Pose.DYING) && !((WilderWarden) wardenEntity).wilderWild$getSwimmingDyingAnimationState().isStarted() && !((WilderWarden) wardenEntity).wilderWild$getKirbyDeathAnimationState().isStarted(); boolean shouldMoveLimbs = !wardenEntity.hasPose(Pose.ROARING) && !wardenEntity.hasPose(Pose.EMERGING) && !wardenEntity.hasPose(Pose.DIGGING); diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/CloudRendererMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/CloudRendererMixin.java index 7be2b7de2b..02095c621b 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/CloudRendererMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/CloudRendererMixin.java @@ -41,28 +41,28 @@ public class CloudRendererMixin { return MiscConfig.get().cloudMovement && ClientWindManager.shouldUseWind(); } - @ModifyVariable(method = "renderClouds", at = @At(value = "STORE"), ordinal = 4) + @ModifyVariable(method = "renderClouds", at = @At(value = "STORE"), ordinal = 4, require = 0) private double wilderWild$modifyXScroll(double original) { return (this.wilderWild$useWind = wilderWild$useWind()) ? 0 : original; } - @ModifyVariable(method = "renderClouds", at = @At(value = "STORE"), ordinal = 5) + @ModifyVariable(method = "renderClouds", at = @At(value = "STORE"), ordinal = 5, require = 0) private double wilderWild$modifyX(double original, PoseStack poseStack, Matrix4f projectionMatrix, float partialTick, double camX) { return this.wilderWild$useWind ? original - WilderClientWindManager.getCloudX(partialTick) : original; } - @ModifyVariable(method = "renderClouds", at = @At("STORE"), ordinal = 6) + @ModifyVariable(method = "renderClouds", at = @At("STORE"), ordinal = 6, require = 0) private double wilderWild$modifyY(double original, PoseStack poseStack, Matrix4f projectionMatrix, float partialTick, double camX, double camY) { return this.wilderWild$useWind ? original + Mth.clamp(WilderClientWindManager.getCloudY(partialTick), -10D, 10D) : original; } - @ModifyVariable(method = "renderClouds", at = @At("STORE"), ordinal = 7) + @ModifyVariable(method = "renderClouds", at = @At("STORE"), ordinal = 7, require = 0) private double wilderWild$modifyZ(double original, PoseStack poseStack, Matrix4f projectionMatrix, float partialTick, double camX, double camY, double camZ) { return this.wilderWild$useWind ? original - WilderClientWindManager.getCloudZ(partialTick) diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/fallingleaves/FallingLeafParticleMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/fallingleaves/FallingLeafParticleMixin.java index 84a9f86d69..4256089979 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/fallingleaves/FallingLeafParticleMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/fallingleaves/FallingLeafParticleMixin.java @@ -34,7 +34,7 @@ public class FallingLeafParticleMixin { return MiscConfig.get().cloudMovement && ClientWindManager.shouldUseWind(); } - @ModifyExpressionValue(method = "tick", at = @At(value = "FIELD", target = "Lrandommcsomethin/fallingleaves/util/Wind;windX:F")) + @ModifyExpressionValue(method = "tick", at = @At(value = "FIELD", target = "Lrandommcsomethin/fallingleaves/util/Wind;windX:F"), require = 0) private float wilderWild$modifyWindX(float original) { if (wilderWild$useWind()) { return (float) ClientWindManager.windX * 0.7F; @@ -42,7 +42,7 @@ public class FallingLeafParticleMixin { return original; } - @ModifyExpressionValue(method = "tick", at = @At(value = "FIELD", target = "Lrandommcsomethin/fallingleaves/util/Wind;windZ:F")) + @ModifyExpressionValue(method = "tick", at = @At(value = "FIELD", target = "Lrandommcsomethin/fallingleaves/util/Wind;windZ:F"), require = 0) private float wilderWild$modifyWindZ(float original) { if (wilderWild$useWind()) { return (float) ClientWindManager.windZ * 0.7F; diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/DesertDustParticleMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/DesertDustParticleMixin.java index 068c1c6eb9..46bc359704 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/DesertDustParticleMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/DesertDustParticleMixin.java @@ -36,7 +36,7 @@ public class DesertDustParticleMixin { return MiscConfig.get().cloudMovement && ClientWindManager.shouldUseWind(); } - @Inject(method = "tick", at = @At("TAIL")) + @Inject(method = "tick", at = @At("TAIL"), require = 0) private void wilderWild$modifyWind(CallbackInfo info) { if (wilderWild$useWind()) { DesertDustParticle.class.cast(this).xd = Mth.clamp(ClientWindManager.windX * 3, -0.4, 0.4); diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/RainDropParticleMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/RainDropParticleMixin.java index e505ff028f..c8e033aa89 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/RainDropParticleMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/RainDropParticleMixin.java @@ -36,7 +36,7 @@ public class RainDropParticleMixin { return MiscConfig.get().cloudMovement && ClientWindManager.shouldUseWind(); } - @Inject(method = "tick", at = @At("TAIL")) + @Inject(method = "tick", at = @At("TAIL"), require = 0) private void wilderWild$modifyWind(CallbackInfo info) { if (wilderWild$useWind()) { RainDropParticle.class.cast(this).xd += Mth.clamp(ClientWindManager.windX, -0.003, 0.003); diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/SnowFlakeParticleMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/SnowFlakeParticleMixin.java index d28dce486c..416d9a08db 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/SnowFlakeParticleMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/client/wind/particlerain/SnowFlakeParticleMixin.java @@ -36,7 +36,7 @@ public class SnowFlakeParticleMixin { return MiscConfig.get().cloudMovement && ClientWindManager.shouldUseWind(); } - @Inject(method = "tick", at = @At("TAIL")) + @Inject(method = "tick", at = @At("TAIL"), require = 0) private void wilderWild$modifyWind(CallbackInfo info) { if (wilderWild$useWind()) { SnowFlakeParticle.class.cast(this).xd += Mth.clamp(ClientWindManager.windX, -0.0015, 0.0015); diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/sodium/CloudRendererMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/sodium/CloudRendererMixin.java index 046ec01eeb..02a6e9f391 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/sodium/CloudRendererMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/sodium/CloudRendererMixin.java @@ -44,21 +44,21 @@ public class CloudRendererMixin { return MiscConfig.get().cloudMovement && ClientWindManager.shouldUseWind(); } - @ModifyVariable(method = "render", at = @At(value = "STORE"), ordinal = 2) + @ModifyVariable(method = "render", at = @At(value = "STORE"), ordinal = 2, require = 0) private float wilderWild$modifyY(float original, @Nullable ClientLevel world, LocalPlayer player, PoseStack matrices, Matrix4f projectionMatrix, float ticks, float tickDelta, double cameraX, double cameraY, double cameraZ) { return (this.wilderWild$useWind = wilderWild$useWind()) ? (float) (original + 0.33D + Mth.clamp(WilderClientWindManager.getCloudY(tickDelta) * 12, -10, 10)) : original; } - @ModifyVariable(method = "render", at = @At(value = "STORE"), ordinal = 4) + @ModifyVariable(method = "render", at = @At(value = "STORE"), ordinal = 4, require = 0) private double wilderWild$modifyX(double original, @Nullable ClientLevel world, LocalPlayer player, PoseStack matrices, Matrix4f projectionMatrix, float ticks, float tickDelta, double cameraX, double cameraY, double cameraZ) { return this.wilderWild$useWind ? cameraX - WilderClientWindManager.getCloudX(tickDelta) * 12 : original; } - @ModifyVariable(method = "render", at = @At("STORE"), ordinal = 5) + @ModifyVariable(method = "render", at = @At("STORE"), ordinal = 5, require = 0) private double wilderWild$modifyZ(double original, @Nullable ClientLevel world, LocalPlayer player, PoseStack matrices, Matrix4f projectionMatrix, float ticks, float tickDelta, double cameraX, double cameraY, double cameraZ) { return this.wilderWild$useWind ? (cameraZ + 0.33D) - WilderClientWindManager.getCloudZ(tickDelta) * 12 diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/sodium/FluidRendererMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/sodium/FluidRendererMixin.java index d7bac6a22c..2141a0e01f 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/sodium/FluidRendererMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/sodium/FluidRendererMixin.java @@ -93,14 +93,14 @@ public abstract class FluidRendererMixin { private static void setVertex(ModelQuadViewMutable quad, int i, float x, float y, float z, float u, float v) { } - @Inject(method = "isFluidOccluded", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/BlockPos$MutableBlockPos;set(III)Lnet/minecraft/core/BlockPos$MutableBlockPos;", ordinal = 1), cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT) + @Inject(method = "isFluidOccluded", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/BlockPos$MutableBlockPos;set(III)Lnet/minecraft/core/BlockPos$MutableBlockPos;", ordinal = 1), cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT, require = 0) private void wilderWild$isFluidOccluded(BlockAndTintGetter world, int x, int y, int z, Direction dir, Fluid fluid, CallbackInfoReturnable info, BlockPos pos, BlockState blockState) { if (blockState.getBlock() instanceof MesogleaBlock && dir != Direction.UP) { info.setReturnValue(true); } } - @Inject(method = "render", at = @At(value = "HEAD"), cancellable = true) + @Inject(method = "render", at = @At(value = "HEAD"), cancellable = true, require = 0) private void wilderWild$getIsWater(WorldSlice world, FluidState fluidState, BlockPos pos, BlockPos offset, ChunkBuildBuffers buffers, CallbackInfo info) { BlockState blockState = world.getBlockState(pos); if (BlockConfig.get().mesoglea.mesogleaLiquid && blockState.getBlock() instanceof MesogleaBlock) { @@ -328,14 +328,14 @@ private static void setVertex(ModelQuadViewMutable quad, int i, float x, float y } } - @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;setSprite(Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;)V", ordinal = 1)) + @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;setSprite(Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;)V", ordinal = 1), require = 0) private void wilderWild$switchSprites(Args args) { if (this.wilderWild$isWater) { args.set(0, this.wilderWild$waterOverlay); } } - @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 4)) + @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 4), require = 0) private void wilderWild$sideTextureBottom1(Args args) { if (this.wilderWild$isWater) { this.wilderWild$u0 = this.wilderWild$waterOverlay.getU0(); @@ -347,7 +347,7 @@ private static void setVertex(ModelQuadViewMutable quad, int i, float x, float y } } - @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 5)) + @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 5), require = 0) private void wilderWild$sideTextureBottom2(Args args) { if (this.wilderWild$isWater) { args.set(5, this.wilderWild$u0); @@ -355,7 +355,7 @@ private static void setVertex(ModelQuadViewMutable quad, int i, float x, float y } } - @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 6)) + @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 6), require = 0) private void wilderWild$sideTextureBottom3(Args args) { if (this.wilderWild$isWater) { args.set(5, this.wilderWild$u1); @@ -363,7 +363,7 @@ private static void setVertex(ModelQuadViewMutable quad, int i, float x, float y } } - @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 7)) + @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/render/chunk/compile/pipeline/FluidRenderer;setVertex(Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadViewMutable;IFFFFF)V", ordinal = 7), require = 0) private void wilderWild$sideTextureBottom4(Args args) { if (this.wilderWild$isWater) { args.set(5, this.wilderWild$u1);