Skip to content

Commit

Permalink
fix: hopefully fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 3, 2025
1 parent 4ff4a53 commit ad1ae6d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class SliderSignalLayer extends RenderLayer<Slider, SliderModel> {

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"));

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<SoundEvent> cir) {
if (((Slider) (Object) this).isAwake()) {
Expand All @@ -25,17 +28,25 @@ public abstract class SliderMixin extends LivingEntityMixin {

@Inject(method = "calculateMoveDelay", at = @At("HEAD"), cancellable = true)
protected void redux$calculateMoveDelay(CallbackInfoReturnable<Integer> 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);
}
}
Expand Down

0 comments on commit ad1ae6d

Please sign in to comment.