Advertisement
Guest User

Untitled

a guest
Aug 7th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.52 KB | None | 0 0
  1. @Override
  2.     public void shoot(ItemStack stack, EntityPlayer player, World world, float partialTicks, float rotationPitch, float rotationYawHead, float prevRotationPitch, float prevRotationYawHead) {
  3.         ICGCapability cap = player.getCapability(CounterGuns.CG_CAP, null);
  4.         cap.setLastShootTick(world.getTotalWorldTime());
  5.         if (!world.isRemote) {
  6.             NBTTagHelper nbt = new NBTTagHelper(stack);
  7.             if (!player.capabilities.isCreativeMode) {
  8.                 decrRemainingBullets(stack, player, world, 1);
  9.             }
  10.             RayTraceResult ray = RayTraceHelper.calcRayTraceForEntity(player, rotationPitch, rotationYawHead, prevRotationPitch, prevRotationYawHead, getMaxShootRange(), partialTicks);
  11.             if (ray != null && ray.typeOfHit != RayTraceResult.Type.MISS) {
  12.                 onShootHit(stack, player, world, ray, getCurrentLoadedMagazine(stack, player, world));
  13.             }
  14.             SoundEventInformation shootingSound = getShootingSound(player, world, stack);
  15.             if (shootingSound != null) {
  16.                 world.playSound(null, player.getPosition(), shootingSound.event, SoundCategory.PLAYERS, shootingSound.volume, shootingSound.pitch);
  17.             }
  18.         } else {
  19.             ClientProxy.handleRecoil(getRecoilMultiplierX(), getRecoilMultiplierY());
  20.             if (ClientProxy.getCurrentZoom().scope != EnumZoomScope.NONE && exitZoomAfterShootAndRejoin(stack, player, world)) {
  21.                 ClientProxy.handleShootWhileZoom();
  22.             }
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement