Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package yaboichips.modname.classes;
- import net.minecraft.client.audio.SoundHandler;
- import net.minecraft.client.audio.TickableSound;
- import net.minecraft.client.entity.player.ClientPlayerEntity;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.SoundEvents;
- import net.minecraftforge.api.distmarker.Dist;
- import net.minecraftforge.api.distmarker.OnlyIn;
- import yaboichips.modname.lists.ItemList;
- import yaboichips.modname.lists.SoundList;
- @OnlyIn(Dist.CLIENT)
- public class SaberSound {
- @OnlyIn(Dist.CLIENT)
- public static class SubSound extends TickableSound {
- private final ClientPlayerEntity player;
- protected SubSound(ClientPlayerEntity playerIn, SoundEvent soundIn) {
- super(soundIn, SoundCategory.AMBIENT);
- this.player = playerIn;
- this.repeat = false;
- this.repeatDelay = 0;
- this.volume = 1.0F;
- this.priority = true;
- this.global = true;
- }
- public void tick() {
- if (this.player.removed) {
- this.donePlaying = true;
- }
- }
- }
- @OnlyIn(Dist.CLIENT)
- public static class SaberSounds extends TickableSound {
- private final ClientPlayerEntity player;
- private int ticksInWater;
- public SaberSounds(ClientPlayerEntity playerIn) {
- super(SoundList.BUZZ, SoundCategory.AMBIENT);
- this.player = playerIn;
- this.repeat = true;
- this.repeatDelay = 0;
- this.volume = 1.0F;
- this.priority = true;
- this.global = true;
- }
- public void tick() {
- if (!this.player.removed) {
- } else
- this.ticksInWater -= 2;
- this.volume = Math.min(40.0F, 1.0F);
- this.donePlaying = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment