2012-10-25 05:53:23 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
|
|
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
|
|
|
|
|
|
private float[] d = new float[2];
|
|
|
|
private float[] e = new float[2];
|
|
|
|
private float[] f = new float[2];
|
|
|
|
private float[] g = new float[2];
|
|
|
|
private int[] h = new int[2];
|
|
|
|
private int[] i = new int[2];
|
|
|
|
private int j;
|
2013-03-13 23:33:27 +01:00
|
|
|
private static final IEntitySelector bK = new EntitySelectorNotUndead();
|
2012-10-25 05:53:23 +02:00
|
|
|
|
|
|
|
public EntityWither(World world) {
|
|
|
|
super(world);
|
|
|
|
this.setHealth(this.getMaxHealth());
|
|
|
|
this.texture = "/mob/wither.png";
|
|
|
|
this.a(0.9F, 4.0F);
|
|
|
|
this.fireProof = true;
|
2013-03-13 23:33:27 +01:00
|
|
|
this.bI = 0.6F;
|
2012-10-25 05:53:23 +02:00
|
|
|
this.getNavigation().e(true);
|
|
|
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
2013-03-13 23:33:27 +01:00
|
|
|
this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, this.bI, 40, 20.0F));
|
|
|
|
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, this.bI));
|
2012-10-25 05:53:23 +02:00
|
|
|
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));
|
2013-03-13 23:33:27 +01:00
|
|
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityLiving.class, 30.0F, 0, false, false, bK));
|
|
|
|
this.be = 50;
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void a() {
|
|
|
|
super.a();
|
|
|
|
this.datawatcher.a(16, new Integer(100));
|
|
|
|
this.datawatcher.a(17, new Integer(0));
|
|
|
|
this.datawatcher.a(18, new Integer(0));
|
|
|
|
this.datawatcher.a(19, new Integer(0));
|
|
|
|
this.datawatcher.a(20, new Integer(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void b(NBTTagCompound nbttagcompound) {
|
|
|
|
super.b(nbttagcompound);
|
|
|
|
nbttagcompound.setInt("Invul", this.n());
|
|
|
|
}
|
|
|
|
|
|
|
|
public void a(NBTTagCompound nbttagcompound) {
|
|
|
|
super.a(nbttagcompound);
|
2012-11-06 13:05:28 +01:00
|
|
|
this.t(nbttagcompound.getInt("Invul"));
|
2012-10-25 05:53:23 +02:00
|
|
|
this.datawatcher.watch(16, Integer.valueOf(this.health));
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected String bb() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return "mob.wither.idle";
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected String bc() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return "mob.wither.hurt";
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected String bd() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return "mob.wither.death";
|
|
|
|
}
|
|
|
|
|
|
|
|
public void c() {
|
|
|
|
if (!this.world.isStatic) {
|
2012-12-23 12:49:03 +01:00
|
|
|
this.datawatcher.watch(16, Integer.valueOf(this.getScaledHealth())); // CraftBukkit - this.health -> this.getScaledHealth()
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
this.motY *= 0.6000000238418579D;
|
|
|
|
double d0;
|
|
|
|
double d1;
|
|
|
|
double d2;
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
if (!this.world.isStatic && this.u(0) > 0) {
|
|
|
|
Entity entity = this.world.getEntity(this.u(0));
|
2012-10-25 05:53:23 +02:00
|
|
|
|
|
|
|
if (entity != null) {
|
|
|
|
if (this.locY < entity.locY || !this.o() && this.locY < entity.locY + 5.0D) {
|
|
|
|
if (this.motY < 0.0D) {
|
|
|
|
this.motY = 0.0D;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.motY += (0.5D - this.motY) * 0.6000000238418579D;
|
|
|
|
}
|
|
|
|
|
|
|
|
double d3 = entity.locX - this.locX;
|
|
|
|
|
|
|
|
d0 = entity.locZ - this.locZ;
|
|
|
|
d1 = d3 * d3 + d0 * d0;
|
|
|
|
if (d1 > 9.0D) {
|
|
|
|
d2 = (double) MathHelper.sqrt(d1);
|
|
|
|
this.motX += (d3 / d2 * 0.5D - this.motX) * 0.6000000238418579D;
|
|
|
|
this.motZ += (d0 / d2 * 0.5D - this.motZ) * 0.6000000238418579D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.motX * this.motX + this.motZ * this.motZ > 0.05000000074505806D) {
|
|
|
|
this.yaw = (float) Math.atan2(this.motZ, this.motX) * 57.295776F - 90.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
super.c();
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 2; ++i) {
|
|
|
|
this.g[i] = this.e[i];
|
|
|
|
this.f[i] = this.d[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
for (i = 0; i < 2; ++i) {
|
2012-11-06 13:05:28 +01:00
|
|
|
j = this.u(i + 1);
|
2012-10-25 05:53:23 +02:00
|
|
|
Entity entity1 = null;
|
|
|
|
|
|
|
|
if (j > 0) {
|
|
|
|
entity1 = this.world.getEntity(j);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (entity1 != null) {
|
2012-11-06 13:05:28 +01:00
|
|
|
d0 = this.v(i + 1);
|
|
|
|
d1 = this.w(i + 1);
|
|
|
|
d2 = this.x(i + 1);
|
2012-10-25 05:53:23 +02:00
|
|
|
double d4 = entity1.locX - d0;
|
|
|
|
double d5 = entity1.locY + (double) entity1.getHeadHeight() - d1;
|
|
|
|
double d6 = entity1.locZ - d2;
|
|
|
|
double d7 = (double) MathHelper.sqrt(d4 * d4 + d6 * d6);
|
|
|
|
float f = (float) (Math.atan2(d6, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
|
|
|
|
float f1 = (float) (-(Math.atan2(d5, d7) * 180.0D / 3.1415927410125732D));
|
|
|
|
|
|
|
|
this.d[i] = this.b(this.d[i], f1, 40.0F);
|
|
|
|
this.e[i] = this.b(this.e[i], f, 10.0F);
|
|
|
|
} else {
|
2013-03-13 23:33:27 +01:00
|
|
|
this.e[i] = this.b(this.e[i], this.ay, 10.0F);
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean flag = this.o();
|
|
|
|
|
|
|
|
for (j = 0; j < 3; ++j) {
|
2012-11-06 13:05:28 +01:00
|
|
|
double d8 = this.v(j);
|
|
|
|
double d9 = this.w(j);
|
|
|
|
double d10 = this.x(j);
|
2012-10-25 05:53:23 +02:00
|
|
|
|
|
|
|
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) {
|
|
|
|
this.world.addParticle("mobSpell", d8 + this.random.nextGaussian() * 0.30000001192092896D, d9 + this.random.nextGaussian() * 0.30000001192092896D, d10 + this.random.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.n() > 0) {
|
|
|
|
for (j = 0; j < 3; ++j) {
|
|
|
|
this.world.addParticle("mobSpell", this.locX + this.random.nextGaussian() * 1.0D, this.locY + (double) (this.random.nextFloat() * 3.3F), this.locZ + this.random.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected void bo() {
|
2012-10-25 05:53:23 +02:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (this.n() > 0) {
|
|
|
|
i = this.n() - 1;
|
|
|
|
if (i <= 0) {
|
|
|
|
// CraftBukkit start
|
|
|
|
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false);
|
|
|
|
this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, event.getRadius(), event.getFire(), this.world.getGameRules().getBoolean("mobGriefing"));
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
this.world.d(1013, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
this.t(i);
|
2012-10-25 05:53:23 +02:00
|
|
|
if (this.ticksLived % 10 == 0) {
|
|
|
|
this.heal(10, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit
|
|
|
|
}
|
|
|
|
} else {
|
2013-03-13 23:33:27 +01:00
|
|
|
super.bo();
|
2012-10-25 05:53:23 +02:00
|
|
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
for (i = 1; i < 3; ++i) {
|
|
|
|
if (this.ticksLived >= this.h[i - 1]) {
|
|
|
|
this.h[i - 1] = this.ticksLived + 10 + this.random.nextInt(10);
|
|
|
|
if (this.world.difficulty >= 2) {
|
|
|
|
int i1001 = i - 1;
|
|
|
|
int i1003 = this.i[i - 1];
|
|
|
|
|
|
|
|
this.i[i1001] = this.i[i - 1] + 1;
|
|
|
|
if (i1003 > 15) {
|
|
|
|
float f = 10.0F;
|
|
|
|
float f1 = 5.0F;
|
|
|
|
double d0 = MathHelper.a(this.random, this.locX - (double) f, this.locX + (double) f);
|
|
|
|
double d1 = MathHelper.a(this.random, this.locY - (double) f1, this.locY + (double) f1);
|
|
|
|
double d2 = MathHelper.a(this.random, this.locZ - (double) f, this.locZ + (double) f);
|
|
|
|
|
|
|
|
this.a(i + 1, d0, d1, d2, true);
|
|
|
|
this.i[i - 1] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
j = this.u(i);
|
2012-10-25 05:53:23 +02:00
|
|
|
if (j > 0) {
|
|
|
|
Entity entity = this.world.getEntity(j);
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
if (entity != null && entity.isAlive() && this.e(entity) <= 900.0D && this.n(entity)) {
|
2012-10-25 05:53:23 +02:00
|
|
|
this.a(i + 1, (EntityLiving) entity);
|
|
|
|
this.h[i - 1] = this.ticksLived + 40 + this.random.nextInt(20);
|
|
|
|
this.i[i - 1] = 0;
|
|
|
|
} else {
|
|
|
|
this.c(i, 0);
|
|
|
|
}
|
|
|
|
} else {
|
2013-03-13 23:33:27 +01:00
|
|
|
List list = this.world.a(EntityLiving.class, this.boundingBox.grow(20.0D, 8.0D, 20.0D), bK);
|
2012-10-25 05:53:23 +02:00
|
|
|
|
|
|
|
for (int i1 = 0; i1 < 10 && !list.isEmpty(); ++i1) {
|
|
|
|
EntityLiving entityliving = (EntityLiving) list.get(this.random.nextInt(list.size()));
|
|
|
|
|
2012-11-18 22:27:15 +01:00
|
|
|
if (entityliving != this && entityliving.isAlive() && this.n(entityliving)) {
|
2012-10-25 05:53:23 +02:00
|
|
|
if (entityliving instanceof EntityHuman) {
|
|
|
|
if (!((EntityHuman) entityliving).abilities.isInvulnerable) {
|
|
|
|
this.c(i, entityliving.id);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.c(i, entityliving.id);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
list.remove(entityliving);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-17 10:28:44 +01:00
|
|
|
if (this.getGoalTarget() != null) {
|
|
|
|
this.c(0, this.getGoalTarget().id);
|
2012-10-25 05:53:23 +02:00
|
|
|
} else {
|
|
|
|
this.c(0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.j > 0) {
|
|
|
|
--this.j;
|
|
|
|
if (this.j == 0 && this.world.getGameRules().getBoolean("mobGriefing")) {
|
|
|
|
i = MathHelper.floor(this.locY);
|
|
|
|
j = MathHelper.floor(this.locX);
|
|
|
|
int j1 = MathHelper.floor(this.locZ);
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
for (int k1 = -1; k1 <= 1; ++k1) {
|
|
|
|
for (int l1 = -1; l1 <= 1; ++l1) {
|
|
|
|
for (int i2 = 0; i2 <= 3; ++i2) {
|
|
|
|
int j2 = j + k1;
|
|
|
|
int k2 = i + i2;
|
|
|
|
int l2 = j1 + l1;
|
|
|
|
int i3 = this.world.getTypeId(j2, k2, l2);
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
if (i3 > 0 && i3 != Block.BEDROCK.id && i3 != Block.ENDER_PORTAL.id && i3 != Block.ENDER_PORTAL_FRAME.id) {
|
2012-10-25 05:53:23 +02:00
|
|
|
// CraftBukkit start
|
2012-12-01 00:50:09 +01:00
|
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, j2, k2, l2, 0, 0).isCancelled()) {
|
2012-10-25 05:53:23 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
flag = this.world.setAir(j2, k2, l2, true) || flag;
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
this.world.a((EntityHuman) null, 1012, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.ticksLived % 20 == 0) {
|
|
|
|
this.heal(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void m() {
|
2012-11-06 13:05:28 +01:00
|
|
|
this.t(220);
|
2012-10-25 05:53:23 +02:00
|
|
|
this.setHealth(this.getMaxHealth() / 3);
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public void al() {}
|
2012-10-25 05:53:23 +02:00
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public int aZ() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
private double v(int i) {
|
2012-10-25 05:53:23 +02:00
|
|
|
if (i <= 0) {
|
|
|
|
return this.locX;
|
|
|
|
} else {
|
2013-03-13 23:33:27 +01:00
|
|
|
float f = (this.ay + (float) (180 * (i - 1))) / 180.0F * 3.1415927F;
|
2012-10-25 05:53:23 +02:00
|
|
|
float f1 = MathHelper.cos(f);
|
|
|
|
|
|
|
|
return this.locX + (double) f1 * 1.3D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
private double w(int i) {
|
2012-10-25 05:53:23 +02:00
|
|
|
return i <= 0 ? this.locY + 3.0D : this.locY + 2.2D;
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
private double x(int i) {
|
2012-10-25 05:53:23 +02:00
|
|
|
if (i <= 0) {
|
|
|
|
return this.locZ;
|
|
|
|
} else {
|
2013-03-13 23:33:27 +01:00
|
|
|
float f = (this.ay + (float) (180 * (i - 1))) / 180.0F * 3.1415927F;
|
2012-10-25 05:53:23 +02:00
|
|
|
float f1 = MathHelper.sin(f);
|
|
|
|
|
|
|
|
return this.locZ + (double) f1 * 1.3D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private float b(float f, float f1, float f2) {
|
|
|
|
float f3 = MathHelper.g(f1 - f);
|
|
|
|
|
|
|
|
if (f3 > f2) {
|
|
|
|
f3 = f2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (f3 < -f2) {
|
|
|
|
f3 = -f2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return f + f3;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void a(int i, EntityLiving entityliving) {
|
|
|
|
this.a(i, entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight() * 0.5D, entityliving.locZ, i == 0 && this.random.nextFloat() < 0.001F);
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2012-11-06 13:05:28 +01:00
|
|
|
double d3 = this.v(i);
|
|
|
|
double d4 = this.w(i);
|
|
|
|
double d5 = this.x(i);
|
2012-10-25 05:53:23 +02:00
|
|
|
double d6 = d0 - d3;
|
|
|
|
double d7 = d1 - d4;
|
|
|
|
double d8 = d2 - d5;
|
|
|
|
EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.world, this, d6, d7, d8);
|
|
|
|
|
|
|
|
if (flag) {
|
2013-03-13 23:33:27 +01:00
|
|
|
entitywitherskull.a(true);
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
entitywitherskull.locY = d4;
|
|
|
|
entitywitherskull.locX = d3;
|
|
|
|
entitywitherskull.locZ = d5;
|
|
|
|
this.world.addEntity(entitywitherskull);
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public void a(EntityLiving entityliving, float f) {
|
2012-10-25 05:53:23 +02:00
|
|
|
this.a(0, entityliving);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
2012-11-06 13:05:28 +01:00
|
|
|
if (this.isInvulnerable()) {
|
|
|
|
return false;
|
|
|
|
} else if (damagesource == DamageSource.DROWN) {
|
2012-10-25 05:53:23 +02:00
|
|
|
return false;
|
|
|
|
} else if (this.n() > 0) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
Entity entity;
|
|
|
|
|
|
|
|
if (this.o()) {
|
2013-03-13 23:33:27 +01:00
|
|
|
entity = damagesource.h();
|
2012-10-25 05:53:23 +02:00
|
|
|
if (entity instanceof EntityArrow) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
entity = damagesource.getEntity();
|
|
|
|
if (entity != null && !(entity instanceof EntityHuman) && entity instanceof EntityLiving && ((EntityLiving) entity).getMonsterType() == this.getMonsterType()) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
if (this.j <= 0) {
|
|
|
|
this.j = 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int j = 0; j < this.i.length; ++j) {
|
|
|
|
this.i[j] += 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
return super.damageEntity(damagesource, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void dropDeathLoot(boolean flag, int i) {
|
|
|
|
// CraftBukkit start
|
|
|
|
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
|
|
|
|
loot.add(new org.bukkit.inventory.ItemStack(Item.NETHER_STAR.id, 1));
|
|
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected void bn() {
|
|
|
|
this.bC = 0;
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public boolean K() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return !this.dead;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int b() {
|
|
|
|
return this.datawatcher.getInt(16);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void a(float f) {}
|
|
|
|
|
|
|
|
public void addEffect(MobEffect mobeffect) {}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected boolean bh() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getMaxHealth() {
|
|
|
|
return 300;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int n() {
|
|
|
|
return this.datawatcher.getInt(20);
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
public void t(int i) {
|
2012-10-25 05:53:23 +02:00
|
|
|
this.datawatcher.watch(20, Integer.valueOf(i));
|
|
|
|
}
|
|
|
|
|
2012-11-06 13:05:28 +01:00
|
|
|
public int u(int i) {
|
2012-10-25 05:53:23 +02:00
|
|
|
return this.datawatcher.getInt(17 + i);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void c(int i, int j) {
|
|
|
|
this.datawatcher.watch(17 + i, Integer.valueOf(j));
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean o() {
|
2012-12-23 12:49:03 +01:00
|
|
|
return this.b() <= this.maxHealth / 2; // CraftBukkit - this.getMaxHealth() -> this.maxHealth
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public EnumMonsterType getMonsterType() {
|
|
|
|
return EnumMonsterType.UNDEAD;
|
|
|
|
}
|
2013-03-13 23:33:27 +01:00
|
|
|
|
|
|
|
public void mount(Entity entity) {
|
|
|
|
this.vehicle = null;
|
|
|
|
}
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|