h31ix

Untitled

Jun 20th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. public boolean survives() {
  2. if (!this.world.getCubes(this, this.boundingBox).isEmpty()) {
  3. return false;
  4. } else {
  5. int i = Math.max(1, this.d() / 16);
  6. int j = Math.max(1, this.g() / 16);
  7. int k = this.x;
  8. int l = this.y;
  9. int i1 = this.z;
  10.  
  11. if (this.direction == 2) {
  12. k = MathHelper.floor(this.locX - (double) ((float) this.d() / 32.0F));
  13. }
  14.  
  15. if (this.direction == 1) {
  16. i1 = MathHelper.floor(this.locZ - (double) ((float) this.d() / 32.0F));
  17. }
  18.  
  19. if (this.direction == 0) {
  20. k = MathHelper.floor(this.locX - (double) ((float) this.d() / 32.0F));
  21. }
  22.  
  23. if (this.direction == 3) {
  24. i1 = MathHelper.floor(this.locZ - (double) ((float) this.d() / 32.0F));
  25. }
  26.  
  27. l = MathHelper.floor(this.locY - (double) ((float) this.g() / 32.0F));
  28.  
  29. for (int j1 = 0; j1 < i; ++j1) {
  30. for (int k1 = 0; k1 < j; ++k1) {
  31. Material material;
  32.  
  33. if (this.direction != 2 && this.direction != 0) {
  34. material = this.world.getMaterial(this.x, l + k1, i1 + j1);
  35. } else {
  36. material = this.world.getMaterial(k + j1, l + k1, this.z);
  37. }
  38.  
  39. if (!material.isBuildable()) {
  40. return false;
  41. }
  42. }
  43. }
  44.  
  45. List list = this.world.getEntities(this, this.boundingBox);
  46. Iterator iterator = list.iterator();
  47.  
  48. Entity entity;
  49.  
  50. do {
  51. if (!iterator.hasNext()) {
  52. return true;
  53. }
  54.  
  55. entity = (Entity) iterator.next();
  56. } while (!(entity instanceof EntityHanging));
  57.  
  58. return false;
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment