Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Mod.EventHandler
- public void init(FMLInitializationEvent event) {
- ResourceLocation location;
- location = new ResourceLocation(CounterGuns.MODID, "nova_shoot");
- sound_nova_shoot = new SoundEvent(location);
- GameRegistry.register(sound_nova_shoot, location);
- location = new ResourceLocation(CounterGuns.MODID, "nova_new_bullet");
- sound_nova_new_bullet = new SoundEvent(location);
- GameRegistry.register(sound_nova_new_bullet, location);
- location = new ResourceLocation(CounterGuns.MODID, "nova_reload");
- sound_nova_reload = new SoundEvent(location);
- GameRegistry.register(sound_nova_reload, location);
- proxy.init();
- }
- {
- "novaShoot": {
- "category": "players",
- "subtitle": "counter_guns.subtitle.novaShoot",
- "sounds": [
- {
- "name": "counter_guns:nova_shoot",
- "stream": true
- }]
- },
- "novaNewBullet": {
- "category": "players",
- "subtitle": "counter_guns.subtitle.novaShoot",
- "sounds": [{
- "name": "counter_guns:nova_new_bullet",
- "stream": true
- }]
- },
- "novaReload": {
- "category": "players",
- "subtitle": "counter_guns.subtitle.novaShoot",
- "sounds": [{
- "name": "counter_guns:nova_reload",
- "stream": true
- }]
- }
- }
- public static void handleShootingMessageRespondMessage(ShootingMessageResponseMessageToClient message) {
- mc.addScheduledTask(() -> {
- EntityPlayerSP player = mc.thePlayer;
- WorldClient world = mc.theWorld;
- ItemStack held = player.getHeldItemMainhand();
- if (held != null && held.getItem() instanceof ItemGun) {
- ItemGun gun = (ItemGun) held.getItem();
- gun.shoot(held, player, world, getPartialTicks(), player.rotationPitch, player.rotationYawHead, player.prevRotationPitch, player.prevRotationYawHead);
- world.playSound(player.posX, player.posY, player.posZ, CounterGuns.sound_nova_shoot, SoundCategory.PLAYERS, 10, 1, true);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement