Guest User

Untitled

a guest
Dec 17th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. @SubscribeEvent
  2.     public void onBlockUpdate(BlockEvent.NeighborNotifyEvent event)
  3.     {
  4.         for (EnumFacing f : EnumFacing.VALUES)
  5.         {
  6.             BlockPos pos = event.getPos().offset(f);
  7.             IBlockState state = event.getWorld().getBlockState(pos);
  8.             if ((state.getBlock() == this) && (state.getValue(FACING) == event.getState().getValue(FACING)))
  9.             {
  10.                 event.getWorld().setBlockState(pos, state.withProperty(OPEN, event.getState().getValue(OPEN)));
  11.             }
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment