use of net.geforcemods.securitycraft.entity.EntityTaserBullet in project SecurityCraft by Geforce132.
the class ItemTaser method onItemRightClick.
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) {
if (!worldIn.isRemote) {
if (!itemStackIn.isItemDamaged()) {
worldIn.spawnEntityInWorld(new EntityTaserBullet(worldIn, playerIn));
mod_SecurityCraft.network.sendToAll(new PacketCPlaySoundAtPos(playerIn.posX, playerIn.posY, playerIn.posZ, SCSounds.TASERFIRED.path, 1.0F));
if (!playerIn.capabilities.isCreativeMode) {
itemStackIn.damageItem(150, playerIn);
}
}
}
return ActionResult.newResult(EnumActionResult.PASS, itemStackIn);
}
use of net.geforcemods.securitycraft.entity.EntityTaserBullet in project SecurityCraft by Geforce132.
the class ItemTaser method onItemRightClick.
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (!par2World.isRemote) {
if (!par1ItemStack.isItemDamaged()) {
par2World.spawnEntityInWorld(new EntityTaserBullet(par2World, par3EntityPlayer));
mod_SecurityCraft.network.sendToAll(new PacketCPlaySoundAtPos(par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, SCSounds.TASERFIRED.path, 1.0F));
if (!par3EntityPlayer.capabilities.isCreativeMode) {
par1ItemStack.damageItem(150, par3EntityPlayer);
}
}
}
return par1ItemStack;
}
Aggregations