Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ){
- if(!world.isRemote){
- TilePointer tile = (TilePointer) world.getTileEntity(pos);
- if(tile != null){
- int[] d = RotationHelper.rotateXZByDir(-2, 1, tile.direction.getIndex());
- BlockPos p = pos.add(d[0], 0, d[1]);
- if(world.getBlockState(p).getBlock() instanceof BlockTrackSWNE){
- TileTrackSWNE track = (TileTrackSWNE) world.getTileEntity(p);
- if(track != null){
- track.activated = !track.activated;
- world.notifyBlockUpdate(pos, state, world.getBlockState(p), 3);
- return true;
- }
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement