Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. I want my TE not to render some parts if there is another equal TE on its left, right or top. this is what I've come up with for now, I'm testing if it works right now. I was wondering what offset stands for ( english is not my first language) and if it can help me...
  2.  
  3. @Override
  4. public void updateEntity() {
  5.  
  6.  
  7. if(hasLeft()) System.out.println("d");
  8.  
  9.  
  10.  
  11.  
  12. }
  13.  
  14.  
  15. public boolean hasLeft() {
  16.  
  17. TileEntity te;
  18. switch(this.facing) {
  19. case NORTH: te = this.getWorldObj().getTileEntity(this.xCoord+1, this.yCoord, this.zCoord); break;
  20. case SOUTH: te = this.getWorldObj().getTileEntity(this.xCoord-1, this.yCoord, this.zCoord); break;
  21. case EAST: te = this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, this.zCoord-1); break;
  22. case WEST: te = this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, this.zCoord+1); break;
  23. default: te = null; break;
  24. }
  25.  
  26.  
  27.  
  28. if(te instanceof TileEntityShelve) {
  29. return true;
  30. } else
  31. return false;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement