Skip to content

Commit

Permalink
improv: two ticks of glow
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 4, 2025
1 parent 0c8347b commit f044554
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.zepalesque.redux.attachment;

import com.aetherteam.aether.entity.monster.dungeon.boss.Slider;
import net.minecraft.client.Minecraft;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundSource;
import net.neoforged.neoforge.network.PacketDistributor;
Expand All @@ -19,13 +20,13 @@ public void onUpdate(Slider slider) {

protected void tickSignal(Slider slider) {
if (this.signalTick > 0 && slider.level().isClientSide()) {
if (this.signalTick == 1) playSound(slider);
if (this.signalTick == 2) playSound(slider);
this.signalTick--;
}
}

public boolean shouldGlow(Slider slider) {
return this.signalTick == 7 || this.signalTick == 1;
return this.signalTick == 8 || this.signalTick == 7 || this.signalTick == 2 || this.signalTick == 1;
}

public static void sendPacket(Slider slider) {
Expand All @@ -34,13 +35,13 @@ public static void sendPacket(Slider slider) {

public void doBeep(Slider slider) {
if (this.getSignalTick() == 0) {
this.setSignalTick(7);
this.setSignalTick(8);
playSound(slider);
}
}

protected void playSound(Slider slider) {
slider.level().playSound(null, slider.getX(), slider.getY(), slider.getZ(), ReduxSounds.SLIDER_SIGNAL, SoundSource.HOSTILE, 1F, 1F);
slider.level().playSound(Minecraft.getInstance().player, slider.getX(), slider.getY(), slider.getZ(), ReduxSounds.SLIDER_SIGNAL, SoundSource.HOSTILE, 1F, 1F);
}

public static @NotNull SliderSignalAttachment get(@NotNull Slider slider) {
Expand Down

0 comments on commit f044554

Please sign in to comment.