Advertisement
smbarbour

Place directional block

Nov 5th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.         @Override
  2.         public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) {
  3.                 super.onBlockPlacedBy(world, i, j, k, entityliving, stack);
  4.  
  5.                 ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k));
  6.  
  7.                 world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(),1);
  8.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement