Advertisement
Guest User

update block please!

a guest
Dec 11th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float faceX, float faceY, float faceZ)
  2. {
  3. if (!world.isRemote && player.getHeldItem() == null && !player.isSneaking())
  4. {
  5. Logger.Info(String.format("onBlockActivated (%d,%d,%d)", x, y, z));
  6. //world.setBlockMetadataWithNotify(x, y, z, 1, 3);
  7. //this.setLightLevel(15);
  8.  
  9. TileEntity te = world.getTileEntity(x,y,z);
  10.  
  11. if (te instanceof TileEntityScreen)
  12. {
  13. TileEntityScreen screen = (TileEntityScreen)te;
  14. float fDepth = screen.Depth;
  15.  
  16. fDepth = fDepth-0.1f < 0.1f ? 1.0f : fDepth-0.1f;
  17.  
  18. screen.Depth = fDepth;
  19. setBlockBoundsBasedOnState(world, x, y, z);
  20. world.markBlockForUpdate(x, y, z);
  21. }
  22.  
  23. return true;
  24. }
  25. else
  26. return false;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement