Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean survives() {
- if (!this.world.getCubes(this, this.boundingBox).isEmpty()) {
- return false;
- } else {
- int i = Math.max(1, this.d() / 16);
- int j = Math.max(1, this.g() / 16);
- int k = this.x;
- int l = this.y;
- int i1 = this.z;
- if (this.direction == 2) {
- k = MathHelper.floor(this.locX - (double) ((float) this.d() / 32.0F));
- }
- if (this.direction == 1) {
- i1 = MathHelper.floor(this.locZ - (double) ((float) this.d() / 32.0F));
- }
- if (this.direction == 0) {
- k = MathHelper.floor(this.locX - (double) ((float) this.d() / 32.0F));
- }
- if (this.direction == 3) {
- i1 = MathHelper.floor(this.locZ - (double) ((float) this.d() / 32.0F));
- }
- l = MathHelper.floor(this.locY - (double) ((float) this.g() / 32.0F));
- for (int j1 = 0; j1 < i; ++j1) {
- for (int k1 = 0; k1 < j; ++k1) {
- Material material;
- if (this.direction != 2 && this.direction != 0) {
- material = this.world.getMaterial(this.x, l + k1, i1 + j1);
- } else {
- material = this.world.getMaterial(k + j1, l + k1, this.z);
- }
- if (!material.isBuildable()) {
- return false;
- }
- }
- }
- List list = this.world.getEntities(this, this.boundingBox);
- Iterator iterator = list.iterator();
- Entity entity;
- do {
- if (!iterator.hasNext()) {
- return true;
- }
- entity = (Entity) iterator.next();
- } while (!(entity instanceof EntityHanging));
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment