summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityWither.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityWither.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityWither.java84
1 files changed, 43 insertions, 41 deletions
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
index b4ce3a80..ea709e91 100644
--- a/src/main/java/net/minecraft/server/EntityWither.java
+++ b/src/main/java/net/minecraft/server/EntityWither.java
@@ -16,7 +16,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
private int[] h = new int[2];
private int[] i = new int[2];
private int j;
- private static final IEntitySelector bK = new EntitySelectorNotUndead();
+ private static final IEntitySelector bI = new EntitySelectorNotUndead();
public EntityWither(World world) {
super(world);
@@ -24,15 +24,15 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
this.texture = "/mob/wither.png";
this.a(0.9F, 4.0F);
this.fireProof = true;
- this.bI = 0.6F;
+ this.bG = 0.6F;
this.getNavigation().e(true);
this.goalSelector.a(0, new PathfinderGoalFloat(this));
- this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bI, 40, 20.0F));
- this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bI));
+ this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bG, 40, 20.0F));
+ this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bG));
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
- this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 30.0F, 0, false, false, bK));
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 30.0F, 0, false, false, bI));
this.bc = 50;
}
@@ -52,19 +52,19 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
- this.s(nbttagcompound.getInt("Invul"));
+ this.t(nbttagcompound.getInt("Invul"));
this.datawatcher.watch(16, Integer.valueOf(this.health));
}
- protected String aW() {
+ protected String aY() {
return "mob.wither.idle";
}
- protected String aX() {
+ protected String aZ() {
return "mob.wither.hurt";
}
- protected String aY() {
+ protected String ba() {
return "mob.wither.death";
}
@@ -78,8 +78,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
double d1;
double d2;
- if (!this.world.isStatic && this.t(0) > 0) {
- Entity entity = this.world.getEntity(this.t(0));
+ if (!this.world.isStatic && this.u(0) > 0) {
+ Entity entity = this.world.getEntity(this.u(0));
if (entity != null) {
if (this.locY < entity.locY || !this.o() && this.locY < entity.locY + 5.0D) {
@@ -118,7 +118,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
int j;
for (i = 0; i < 2; ++i) {
- j = this.t(i + 1);
+ j = this.u(i + 1);
Entity entity1 = null;
if (j > 0) {
@@ -126,9 +126,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
if (entity1 != null) {
- d0 = this.u(i + 1);
- d1 = this.v(i + 1);
- d2 = this.w(i + 1);
+ d0 = this.v(i + 1);
+ d1 = this.w(i + 1);
+ d2 = this.x(i + 1);
double d4 = entity1.locX - d0;
double d5 = entity1.locY + (double) entity1.getHeadHeight() - d1;
double d6 = entity1.locZ - d2;
@@ -146,9 +146,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
boolean flag = this.o();
for (j = 0; j < 3; ++j) {
- double d8 = this.u(j);
- double d9 = this.v(j);
- double d10 = this.w(j);
+ double d8 = this.v(j);
+ double d9 = this.w(j);
+ double d10 = this.x(j);
this.world.addParticle("smoke", d8 + this.random.nextGaussian() * 0.30000001192092896D, d9 + this.random.nextGaussian() * 0.30000001192092896D, d10 + this.random.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
if (flag && this.world.random.nextInt(4) == 0) {
@@ -163,7 +163,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
}
- protected void bi() {
+ protected void bl() {
int i;
if (this.n() > 0) {
@@ -181,12 +181,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
this.world.e(1013, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
}
- this.s(i);
+ this.t(i);
if (this.ticksLived % 10 == 0) {
this.heal(10, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit
}
} else {
- super.bi();
+ super.bl();
int j;
@@ -210,11 +210,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
}
- j = this.t(i);
+ j = this.u(i);
if (j > 0) {
Entity entity = this.world.getEntity(j);
- if (entity != null && entity.isAlive() && this.e(entity) <= 900.0D && this.m(entity)) {
+ if (entity != null && entity.isAlive() && this.e(entity) <= 900.0D && this.n(entity)) {
this.a(i + 1, (EntityLiving) entity);
this.h[i - 1] = this.ticksLived + 40 + this.random.nextInt(20);
this.i[i - 1] = 0;
@@ -222,7 +222,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
this.c(i, 0);
}
} else {
- List list = this.world.a(EntityLiving.class, this.boundingBox.grow(20.0D, 8.0D, 20.0D), bK);
+ List list = this.world.a(EntityLiving.class, this.boundingBox.grow(20.0D, 8.0D, 20.0D), bI);
for (int i1 = 0; i1 < 10 && !list.isEmpty(); ++i1) {
EntityLiving entityliving = (EntityLiving) list.get(this.random.nextInt(list.size()));
@@ -244,8 +244,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
}
- if (this.aF() != null) {
- this.c(0, this.aF().id);
+ if (this.aG() != null) {
+ this.c(0, this.aG().id);
} else {
this.c(0, 0);
}
@@ -266,7 +266,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
int l2 = j1 + l1;
int i3 = this.world.getTypeId(j2, k2, l2);
- if (i3 > 0 && i3 != Block.BEDROCK.id) {
+ if (i3 > 0 && i3 != Block.BEDROCK.id && i3 != Block.ENDER_PORTAL.id && i3 != Block.ENDER_PORTAL_FRAME.id) {
int j3 = this.world.getData(j2, k2, l2);
// CraftBukkit start
@@ -297,17 +297,17 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
public void m() {
- this.s(220);
+ this.t(220);
this.setHealth(this.getMaxHealth() / 3);
}
public void am() {}
- public int aU() {
+ public int aW() {
return 4;
}
- private double u(int i) {
+ private double v(int i) {
if (i <= 0) {
return this.locX;
} else {
@@ -318,11 +318,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
}
- private double v(int i) {
+ private double w(int i) {
return i <= 0 ? this.locY + 3.0D : this.locY + 2.2D;
}
- private double w(int i) {
+ private double x(int i) {
if (i <= 0) {
return this.locZ;
} else {
@@ -353,9 +353,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
private void a(int i, double d0, double d1, double d2, boolean flag) {
this.world.a((EntityHuman) null, 1014, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
- double d3 = this.u(i);
- double d4 = this.v(i);
- double d5 = this.w(i);
+ double d3 = this.v(i);
+ double d4 = this.w(i);
+ double d5 = this.x(i);
double d6 = d0 - d3;
double d7 = d1 - d4;
double d8 = d2 - d5;
@@ -376,7 +376,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
}
public boolean damageEntity(DamageSource damagesource, int i) {
- if (damagesource == DamageSource.DROWN) {
+ if (this.isInvulnerable()) {
+ return false;
+ } else if (damagesource == DamageSource.DROWN) {
return false;
} else if (this.n() > 0) {
return false;
@@ -415,8 +417,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
// CraftBukkit end
}
- protected void bh() {
- this.bC = 0;
+ protected void bk() {
+ this.bA = 0;
}
public boolean L() {
@@ -431,7 +433,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
public void addEffect(MobEffect mobeffect) {}
- protected boolean bb() {
+ protected boolean be() {
return true;
}
@@ -443,11 +445,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
return this.datawatcher.getInt(20);
}
- public void s(int i) {
+ public void t(int i) {
this.datawatcher.watch(20, Integer.valueOf(i));
}
- public int t(int i) {
+ public int u(int i) {
return this.datawatcher.getInt(17 + i);
}