Called when a Block is right-clicked with this Item @param pos The block being right-clicked @param side The side being right-clicked
(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
| 20 | * @param side The side being right-clicked |
| 21 | */ |
| 22 | public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) |
| 23 | { |
| 24 | if (!worldIn.isRemote) |
| 25 | { |
| 26 | EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(worldIn, (float)pos.getX() + hitX, (float)pos.getY() + hitY, (float)pos.getZ() + hitZ, stack); |
| 27 | worldIn.spawnEntityInWorld(entityfireworkrocket); |
| 28 | |
| 29 | if (!playerIn.capabilities.isCreativeMode) |
| 30 | { |
| 31 | --stack.stackSize; |
| 32 | } |
| 33 | |
| 34 | return true; |
| 35 | } |
| 36 | else |
| 37 | { |
| 38 | return false; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * allows items to add custom lines of information to the mouseover description |
nothing calls this directly
no test coverage detected