Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void shoot(ItemStack stack, EntityPlayer player, World world, float partialTicks, float rotationPitch, float rotationYawHead, float prevRotationPitch, float prevRotationYawHead) {
- ICGCapability cap = player.getCapability(CounterGuns.CG_CAP, null);
- cap.setLastShootTick(world.getTotalWorldTime());
- if (!world.isRemote) {
- NBTTagHelper nbt = new NBTTagHelper(stack);
- if (!player.capabilities.isCreativeMode) {
- decrRemainingBullets(stack, player, world, 1);
- }
- RayTraceResult ray = RayTraceHelper.calcRayTraceForEntity(player, rotationPitch, rotationYawHead, prevRotationPitch, prevRotationYawHead, getMaxShootRange(), partialTicks);
- if (ray != null && ray.typeOfHit != RayTraceResult.Type.MISS) {
- onShootHit(stack, player, world, ray, getCurrentLoadedMagazine(stack, player, world));
- }
- SoundEventInformation shootingSound = getShootingSound(player, world, stack);
- if (shootingSound != null) {
- world.playSound(null, player.getPosition(), shootingSound.event, SoundCategory.PLAYERS, shootingSound.volume, shootingSound.pitch);
- }
- } else {
- ClientProxy.handleRecoil(getRecoilMultiplierX(), getRecoilMultiplierY());
- if (ClientProxy.getCurrentZoom().scope != EnumZoomScope.NONE && exitZoomAfterShootAndRejoin(stack, player, world)) {
- ClientProxy.handleShootWhileZoom();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement