From ad1ae6d7fdfc887c48c5c8f857457381101f8959 Mon Sep 17 00:00:00 2001 From: Zepalesque <60141811+Zepalesque@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:48:02 -0500 Subject: [PATCH] fix: hopefully fix stuff --- .../entity/layer/SliderSignalLayer.java | 2 +- .../mixin/mixins/common/entity/SliderMixin.java | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/zepalesque/redux/client/renderer/entity/layer/SliderSignalLayer.java b/src/main/java/net/zepalesque/redux/client/renderer/entity/layer/SliderSignalLayer.java index 80e569791..161ff2380 100644 --- a/src/main/java/net/zepalesque/redux/client/renderer/entity/layer/SliderSignalLayer.java +++ b/src/main/java/net/zepalesque/redux/client/renderer/entity/layer/SliderSignalLayer.java @@ -19,7 +19,7 @@ public class SliderSignalLayer extends RenderLayer { private static final RenderType[] DIRECTIONAL = ArrayUtil.generateContents(new RenderType[6], i -> - RenderType.eyes(ResourceLocation.fromNamespaceAndPath(Aether.MODID, "textures/entity/mobs/slider/slider_signal_" + Direction.values()[i].getName()))); + RenderType.eyes(ResourceLocation.fromNamespaceAndPath(Aether.MODID, "textures/entity/mobs/slider/slider_signal_" + Direction.values()[i].getName() + ".png"))); private static final RenderType CRITICAL = RenderType.eyes(ResourceLocation.fromNamespaceAndPath(Aether.MODID, "textures/entity/mobs/slider/slider_awake_glow.png")); diff --git a/src/main/java/net/zepalesque/redux/mixin/mixins/common/entity/SliderMixin.java b/src/main/java/net/zepalesque/redux/mixin/mixins/common/entity/SliderMixin.java index b0c5cf079..f9314b21f 100644 --- a/src/main/java/net/zepalesque/redux/mixin/mixins/common/entity/SliderMixin.java +++ b/src/main/java/net/zepalesque/redux/mixin/mixins/common/entity/SliderMixin.java @@ -1,6 +1,7 @@ package net.zepalesque.redux.mixin.mixins.common.entity; import com.aetherteam.aether.entity.monster.dungeon.boss.Slider; +import net.minecraft.core.Direction; import net.minecraft.sounds.SoundEvent; import net.zepalesque.redux.attachment.SliderSignalAttachment; import org.spongepowered.asm.mixin.Mixin; @@ -16,6 +17,8 @@ public abstract class SliderMixin extends LivingEntityMixin { @Shadow private int moveDelay; + @Shadow private Direction moveDirection; + @Inject(method = "getAmbientSound", at = @At("RETURN"), cancellable = true) protected void redux$getAmbientSound(CallbackInfoReturnable cir) { if (((Slider) (Object) this).isAwake()) { @@ -25,17 +28,25 @@ public abstract class SliderMixin extends LivingEntityMixin { @Inject(method = "calculateMoveDelay", at = @At("HEAD"), cancellable = true) protected void redux$calculateMoveDelay(CallbackInfoReturnable cir) { - int adjusted = this.isCritical() ? 4 + this.getRandom().nextInt(7) : 6 + this.getRandom().nextInt(10); + int adjusted = this.isCritical() ? 5 + this.getRandom().nextInt(6) : 7 + this.getRandom().nextInt(9); cir.setReturnValue(adjusted); } + + @Inject(method = "setMoveDirection", at = @At("HEAD")) + protected void redux$setMoveDirection(Direction moveDirection, CallbackInfo ci) { + if (moveDirection != null) { + SliderSignalAttachment signal = SliderSignalAttachment.get((Slider) (Object) this); + signal.syncMoveDirection((Slider) (Object) this); + } + } + @Inject(method = "customServerAiStep", at = @At("TAIL")) protected void redux$customServerAiStep(CallbackInfo ci) { SliderSignalAttachment signal = SliderSignalAttachment.get((Slider) (Object) this); if (!this.isCritical() && this.moveDelay == 6 || this.isCritical() && this.moveDelay == 4) { signal.doBeep((Slider) (Object) this); - signal.syncMoveDirection((Slider) (Object) this); - } else if (this.moveDelay == 1) { + } else if (this.moveDelay == 2) { signal.syncMoveDirection((Slider) (Object) this); } }