From 762d8a3fc84c30b43f3ccb407bdbe0ee12a0d721 Mon Sep 17 00:00:00 2001 From: AViewFromTheTop <87103914+AViewFromTheTop@users.noreply.github.com> Date: Sat, 24 Aug 2024 02:31:22 -0400 Subject: [PATCH] ugh --- CHANGELOG.md | 2 +- .../mixin/entity/allay/AllayMixin.java | 41 ++++++++++++++----- .../models/block/template_nematocyst.json | 24 +++++------ 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7828cc7013..a728e0b3fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,4 +8,4 @@ Put the changelog BELOW the dashes. ANYTHING ABOVE IS IGNORED - Rain particles have recently been updated to only rotate in one specific direction in a recent update. Alongside new compatability fixes, Rain particle rendering has been reworked to match that of Wilder Wild's Wind particles, rendering at the angle the particle is moving. - Updated Falling Leaves compatability. - Added compat for Palm Fronds and Cypress Leaves through a mixin. -- Updated `rendertype_translucent.fsh` to match the current file. +- Altered the Nematocyst model to not cause as many issues with water. diff --git a/src/main/java/net/frozenblock/wilderwild/mixin/entity/allay/AllayMixin.java b/src/main/java/net/frozenblock/wilderwild/mixin/entity/allay/AllayMixin.java index 2a55a804e5..e7bef151e7 100644 --- a/src/main/java/net/frozenblock/wilderwild/mixin/entity/allay/AllayMixin.java +++ b/src/main/java/net/frozenblock/wilderwild/mixin/entity/allay/AllayMixin.java @@ -26,6 +26,7 @@ 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.Slice; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(Allay.class) @@ -42,16 +43,36 @@ public class AllayMixin implements WilderAllay { return this.wilderWild$dancingAnimationState; } - @Inject(method = "tick", at = @At(value = "TAIL")) - private void wilderWild$tickDancing(CallbackInfo info) { - Allay allay = Allay.class.cast(this); - if (allay.level().isClientSide) { - if (allay.isDancing()) { - this.wilderWild$getDancingAnimationState().startIfStopped((int) this.dancingAnimationTicks); - } else { - this.wilderWild$getDancingAnimationState().stop(); - } - } + @Inject( + method = "tick", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/world/entity/animal/allay/Allay;isSpinning()Z", + shift = At.Shift.BEFORE + ) + ) + private void wilderWild$animateDance(CallbackInfo info) { + this.wilderWild$getDancingAnimationState().startIfStopped((int) this.dancingAnimationTicks); + this.wilderWild$getDancingAnimationState().stop(); + } + + @Inject( + method = "tick", + at = @At( + value = "CONSTANT", + args = "floatValue=0", + ordinal = 0 + ), + slice = @Slice( + from = @At( + value = "FIELD", + target = "Lnet/minecraft/world/entity/animal/allay/Allay;dancingAnimationTicks:F", + ordinal = 2 + ) + ) + ) + private void wilderWild$stopDance(CallbackInfo info) { + this.wilderWild$getDancingAnimationState().stop(); } } diff --git a/src/main/resources/assets/wilderwild/models/block/template_nematocyst.json b/src/main/resources/assets/wilderwild/models/block/template_nematocyst.json index 510920c62a..d6965d6f8f 100644 --- a/src/main/resources/assets/wilderwild/models/block/template_nematocyst.json +++ b/src/main/resources/assets/wilderwild/models/block/template_nematocyst.json @@ -6,32 +6,32 @@ "elements": [ { "name": "large", - "from": [8, 0, 0], - "to": [8, 16, 12], + "from": [8, 2, 0], + "to": [8, 14, 12], "rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 0]}, "faces": { - "east": {"uv": [0, 4, 16, 16], "rotation": 270, "texture": "#large"}, - "west": {"uv": [0, 4, 16, 16], "rotation": 90, "texture": "#large"} + "east": {"uv": [2, 4, 14, 16], "rotation": 270, "texture": "#large"}, + "west": {"uv": [2, 4, 14, 16], "rotation": 90, "texture": "#large"} } }, { "name": "small_2", - "from": [9, 0, 0], - "to": [9, 16, 12], + "from": [9, 2, 0], + "to": [9, 14, 10], "rotation": {"angle": 22.5, "axis": "y", "origin": [9, 7, 0], "rescale": true}, "faces": { - "east": {"uv": [16, 4, 0, 16], "rotation": 270, "texture": "#small"}, - "west": {"uv": [0, 4, 16, 16], "rotation": 90, "texture": "#small"} + "east": {"uv": [14, 6, 2, 16], "rotation": 270, "texture": "#small"}, + "west": {"uv": [2, 6, 14, 16], "rotation": 90, "texture": "#small"} } }, { "name": "small_1", - "from": [7, 0, 0], - "to": [7, 16, 12], + "from": [7, 2, 0], + "to": [7, 14, 10], "rotation": {"angle": -22.5, "axis": "y", "origin": [8, 9, 0], "rescale": true}, "faces": { - "east": {"uv": [16, 4, 0, 16], "rotation": 270, "texture": "#small"}, - "west": {"uv": [0, 4, 16, 16], "rotation": 90, "texture": "#small"} + "east": {"uv": [14, 6, 2, 16], "rotation": 270, "texture": "#small"}, + "west": {"uv": [2, 6, 14, 16], "rotation": 90, "texture": "#small"} } } ],