Guest User

Untitled

a guest
May 20th, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. package yaboichips.modname.classes;
  2.  
  3. import net.minecraft.client.audio.SoundHandler;
  4. import net.minecraft.client.audio.TickableSound;
  5. import net.minecraft.client.entity.player.ClientPlayerEntity;
  6. import net.minecraft.util.SoundCategory;
  7. import net.minecraft.util.SoundEvent;
  8. import net.minecraft.util.SoundEvents;
  9. import net.minecraftforge.api.distmarker.Dist;
  10. import net.minecraftforge.api.distmarker.OnlyIn;
  11. import yaboichips.modname.lists.ItemList;
  12. import yaboichips.modname.lists.SoundList;
  13.  
  14. @OnlyIn(Dist.CLIENT)
  15. public class SaberSound {
  16. @OnlyIn(Dist.CLIENT)
  17. public static class SubSound extends TickableSound {
  18. private final ClientPlayerEntity player;
  19.  
  20. protected SubSound(ClientPlayerEntity playerIn, SoundEvent soundIn) {
  21. super(soundIn, SoundCategory.AMBIENT);
  22. this.player = playerIn;
  23. this.repeat = false;
  24. this.repeatDelay = 0;
  25. this.volume = 1.0F;
  26. this.priority = true;
  27. this.global = true;
  28. }
  29.  
  30. public void tick() {
  31. if (this.player.removed) {
  32. this.donePlaying = true;
  33. }
  34. }
  35. }
  36. @OnlyIn(Dist.CLIENT)
  37. public static class SaberSounds extends TickableSound {
  38. private final ClientPlayerEntity player;
  39. private int ticksInWater;
  40.  
  41. public SaberSounds(ClientPlayerEntity playerIn) {
  42. super(SoundList.BUZZ, SoundCategory.AMBIENT);
  43. this.player = playerIn;
  44. this.repeat = true;
  45. this.repeatDelay = 0;
  46. this.volume = 1.0F;
  47. this.priority = true;
  48. this.global = true;
  49. }
  50.  
  51. public void tick() {
  52. if (!this.player.removed) {
  53. } else
  54. this.ticksInWater -= 2;
  55. this.volume = Math.min(40.0F, 1.0F);
  56. this.donePlaying = true;
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment