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)
| 25 | * @param side The side being right-clicked |
| 26 | */ |
| 27 | public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) |
| 28 | { |
| 29 | Block block = worldIn.getBlockState(pos).getBlock(); |
| 30 | |
| 31 | if (block instanceof BlockFence) |
| 32 | { |
| 33 | if (worldIn.isRemote) |
| 34 | { |
| 35 | return true; |
| 36 | } |
| 37 | else |
| 38 | { |
| 39 | attachToFence(playerIn, worldIn, pos); |
| 40 | return true; |
| 41 | } |
| 42 | } |
| 43 | else |
| 44 | { |
| 45 | return false; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | public static boolean attachToFence(EntityPlayer player, World worldIn, BlockPos fence) |
| 50 | { |
nothing calls this directly
no test coverage detected