Advertisement
Guest User

Untitled

a guest
Aug 6th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.07 KB | None | 0 0
  1. @Mod.EventHandler
  2.     public void init(FMLInitializationEvent event) {
  3.         ResourceLocation location;
  4.         location = new ResourceLocation(CounterGuns.MODID, "nova_shoot");
  5.         sound_nova_shoot = new SoundEvent(location);
  6.         GameRegistry.register(sound_nova_shoot, location);
  7.  
  8.         location = new ResourceLocation(CounterGuns.MODID, "nova_new_bullet");
  9.         sound_nova_new_bullet = new SoundEvent(location);
  10.         GameRegistry.register(sound_nova_new_bullet, location);
  11.  
  12.         location = new ResourceLocation(CounterGuns.MODID, "nova_reload");
  13.         sound_nova_reload = new SoundEvent(location);
  14.         GameRegistry.register(sound_nova_reload, location);
  15.  
  16.         proxy.init();
  17.     }
  18.  
  19. {
  20.   "novaShoot": {
  21.     "category": "players",
  22.     "subtitle": "counter_guns.subtitle.novaShoot",
  23.     "sounds": [
  24.       {
  25.         "name": "counter_guns:nova_shoot",
  26.         "stream": true
  27.       }]
  28.   },
  29.   "novaNewBullet": {
  30.     "category": "players",
  31.     "subtitle": "counter_guns.subtitle.novaShoot",
  32.     "sounds": [{
  33.       "name": "counter_guns:nova_new_bullet",
  34.       "stream": true
  35.     }]
  36.   },
  37.   "novaReload": {
  38.     "category": "players",
  39.     "subtitle": "counter_guns.subtitle.novaShoot",
  40.     "sounds": [{
  41.       "name": "counter_guns:nova_reload",
  42.       "stream": true
  43.     }]
  44.   }
  45. }
  46.  
  47. public static void handleShootingMessageRespondMessage(ShootingMessageResponseMessageToClient message) {
  48.         mc.addScheduledTask(() -> {
  49.             EntityPlayerSP player = mc.thePlayer;
  50.             WorldClient world = mc.theWorld;
  51.             ItemStack held = player.getHeldItemMainhand();
  52.             if (held != null && held.getItem() instanceof ItemGun) {
  53.                 ItemGun gun = (ItemGun) held.getItem();
  54.                 gun.shoot(held, player, world, getPartialTicks(), player.rotationPitch, player.rotationYawHead, player.prevRotationPitch, player.prevRotationYawHead);
  55.                 world.playSound(player.posX, player.posY, player.posZ, CounterGuns.sound_nova_shoot, SoundCategory.PLAYERS, 10, 1, true);
  56.             }
  57.         });
  58.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement