Advertisement
Nuparu00

7 Days to Mine [A4] - BufferedBlock.class

Jul 10th, 2017
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1.  
  2. public class BufferedBlock{
  3. int x;
  4. int y;
  5. int z;
  6. int meta;
  7.  
  8. Block block;
  9.  
  10. NBTTagCompound nbt;
  11. String lootTable;
  12. public BufferedBlock(int x,int y,int z,Block block,int meta){
  13. this.x = x;
  14. this.y = y;
  15. this.z = z;
  16.  
  17. this.meta = meta;
  18. this.block = block;
  19. this.nbt = null;
  20. this.lootTable = null;
  21. }
  22.  
  23. public BufferedBlock(int x,int y,int z,Block block,int meta, NBTTagCompound nbt){
  24. this.x = x;
  25. this.y = y;
  26. this.z = z;
  27.  
  28. this.meta = meta;
  29. this.block = block;
  30. this.nbt = nbt;
  31. this.lootTable = null;
  32. }
  33. public BufferedBlock(int x,int y,int z,Block block,int meta, NBTTagCompound nbt,String lootTable){
  34. this.x = x;
  35. this.y = y;
  36. this.z = z;
  37.  
  38. this.meta = meta;
  39. this.block = block;
  40. this.nbt = nbt;
  41. this.lootTable = lootTable;
  42. }
  43. public BufferedBlock rotate(float angle){
  44.    
  45. int i =(int)Math.abs(angle/90);
  46. if(i == 0){
  47. return this;
  48. }
  49. if(i == 1){
  50. return new BufferedBlock(z,y,-x,block,meta,nbt,lootTable);
  51. }
  52. if(i == 2){
  53. return new BufferedBlock(-x,y,-z,block,meta,nbt,lootTable);
  54. }
  55. if(i == 3){
  56. return new BufferedBlock(-z,y,x,block,meta,nbt,lootTable);
  57. }
  58. return this;
  59.  
  60. }
  61.  
  62. public BufferedBlock copy(){
  63.     return new BufferedBlock(x,y,z,block,meta,nbt,lootTable);
  64. }
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement