mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 12:43:52 -07:00
Update for 1.0.0
This commit is contained in:
@@ -22,8 +22,8 @@ public abstract class Entity {
|
||||
|
||||
private static int entityCount = 0;
|
||||
public int id;
|
||||
public double aX;
|
||||
public boolean aY;
|
||||
public double bb;
|
||||
public boolean bc;
|
||||
public Entity passenger;
|
||||
public Entity vehicle;
|
||||
public World world;
|
||||
@@ -43,83 +43,82 @@ public abstract class Entity {
|
||||
public final AxisAlignedBB boundingBox;
|
||||
public boolean onGround;
|
||||
public boolean positionChanged;
|
||||
public boolean bs;
|
||||
public boolean bt;
|
||||
public boolean velocityChanged;
|
||||
protected boolean bv;
|
||||
public boolean bw;
|
||||
public boolean bx;
|
||||
public boolean velocityChanged;
|
||||
protected boolean bz;
|
||||
public boolean bA;
|
||||
public boolean dead;
|
||||
public float height;
|
||||
public float length;
|
||||
public float width;
|
||||
public float bB;
|
||||
public float bC;
|
||||
public float bF;
|
||||
public float bG;
|
||||
public float fallDistance; // CraftBukkit - private -> public
|
||||
private int b;
|
||||
public double bE;
|
||||
public double bF;
|
||||
public double bG;
|
||||
public float bH;
|
||||
public float bI;
|
||||
public boolean bJ;
|
||||
public float bK;
|
||||
public double bI;
|
||||
public double bJ;
|
||||
public double bK;
|
||||
public float bL;
|
||||
public float bM;
|
||||
public boolean bN;
|
||||
public float bO;
|
||||
protected Random random;
|
||||
public int ticksLived;
|
||||
public int maxFireTicks;
|
||||
public int fireTicks;
|
||||
public int maxAirTicks; // CraftBukkit - protected - >public
|
||||
protected boolean bQ;
|
||||
public int fireTicks; // CraftBukkit - private -> public
|
||||
public int maxAirTicks; // CraftBukkit - protected -> public
|
||||
protected boolean bS;
|
||||
public int noDamageTicks;
|
||||
public int airTicks;
|
||||
private boolean justCreated;
|
||||
protected boolean fireProof;
|
||||
protected DataWatcher datawatcher;
|
||||
private double d;
|
||||
private double e;
|
||||
public boolean bV;
|
||||
public int bW;
|
||||
private double f;
|
||||
public boolean bW;
|
||||
public int bX;
|
||||
public int bY;
|
||||
public boolean bZ;
|
||||
public int bZ;
|
||||
public boolean ca;
|
||||
public boolean cb;
|
||||
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit
|
||||
|
||||
public Entity(World world) {
|
||||
this.id = entityCount++;
|
||||
this.aX = 1.0D;
|
||||
this.aY = false;
|
||||
this.bb = 1.0D;
|
||||
this.bc = false;
|
||||
this.boundingBox = AxisAlignedBB.a(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
this.onGround = false;
|
||||
this.bt = false;
|
||||
this.bx = false;
|
||||
this.velocityChanged = false;
|
||||
this.bw = true;
|
||||
this.bA = true;
|
||||
this.dead = false;
|
||||
this.height = 0.0F;
|
||||
this.length = 0.6F;
|
||||
this.width = 1.8F;
|
||||
this.bB = 0.0F;
|
||||
this.bC = 0.0F;
|
||||
this.bF = 0.0F;
|
||||
this.bG = 0.0F;
|
||||
this.fallDistance = 0.0F;
|
||||
this.b = 1;
|
||||
this.bH = 0.0F;
|
||||
this.bI = 0.0F;
|
||||
this.bJ = false;
|
||||
this.bK = 0.0F;
|
||||
this.bL = 0.0F;
|
||||
this.bM = 0.0F;
|
||||
this.bN = false;
|
||||
this.bO = 0.0F;
|
||||
this.random = new Random();
|
||||
this.ticksLived = 0;
|
||||
this.maxFireTicks = 1;
|
||||
this.fireTicks = 0;
|
||||
this.maxAirTicks = 300;
|
||||
this.bQ = false;
|
||||
this.bS = false;
|
||||
this.noDamageTicks = 0;
|
||||
this.airTicks = 300;
|
||||
this.justCreated = true;
|
||||
this.fireProof = false;
|
||||
this.datawatcher = new DataWatcher();
|
||||
this.bV = false;
|
||||
this.bW = false;
|
||||
this.world = world;
|
||||
this.setPosition(0.0D, 0.0D, 0.0D);
|
||||
this.datawatcher.a(0, Byte.valueOf((byte) 0));
|
||||
this.datawatcher.a(1, Short.valueOf((short) 300));
|
||||
this.b();
|
||||
}
|
||||
|
||||
@@ -185,20 +184,21 @@ public abstract class Entity {
|
||||
float f = this.length / 2.0F;
|
||||
float f1 = this.width;
|
||||
|
||||
this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.bH, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.bH + (double) f1, d2 + (double) f);
|
||||
this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.bL, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.bL + (double) f1, d2 + (double) f);
|
||||
}
|
||||
|
||||
public void s_() {
|
||||
this.aa();
|
||||
public void w_() {
|
||||
this.af();
|
||||
}
|
||||
|
||||
public void aa() {
|
||||
public void af() {
|
||||
MethodProfiler.a("entityBaseTick");
|
||||
if (this.vehicle != null && this.vehicle.dead) {
|
||||
this.vehicle = null;
|
||||
}
|
||||
|
||||
++this.ticksLived;
|
||||
this.bB = this.bC;
|
||||
this.bF = this.bG;
|
||||
this.lastX = this.locX;
|
||||
this.lastY = this.locY;
|
||||
this.lastZ = this.locZ;
|
||||
@@ -218,8 +218,8 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.f_()) {
|
||||
if (!this.bQ && !this.justCreated) {
|
||||
if (this.i_()) {
|
||||
if (!this.bS && !this.justCreated) {
|
||||
float f = MathHelper.a(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F;
|
||||
|
||||
if (f > 1.0F) {
|
||||
@@ -246,10 +246,10 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.fallDistance = 0.0F;
|
||||
this.bQ = true;
|
||||
this.bS = true;
|
||||
this.fireTicks = 0;
|
||||
} else {
|
||||
this.bQ = false;
|
||||
this.bS = false;
|
||||
}
|
||||
|
||||
if (this.world.isStatic) {
|
||||
@@ -280,12 +280,13 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.ap()) {
|
||||
this.am();
|
||||
if (this.aA()) {
|
||||
this.av();
|
||||
this.fallDistance *= 0.5F;
|
||||
}
|
||||
|
||||
if (this.locY < -64.0D) {
|
||||
this.ah();
|
||||
this.ao();
|
||||
}
|
||||
|
||||
if (!this.world.isStatic) {
|
||||
@@ -294,9 +295,10 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.justCreated = false;
|
||||
MethodProfiler.a();
|
||||
}
|
||||
|
||||
protected void am() {
|
||||
protected void av() {
|
||||
if (!this.fireProof) {
|
||||
// CraftBukkit start - TODO: this event spams!
|
||||
if (this instanceof EntityLiving) {
|
||||
@@ -319,22 +321,33 @@ public abstract class Entity {
|
||||
server.getPluginManager().callEvent(combustEvent);
|
||||
|
||||
if (!combustEvent.isCancelled()) {
|
||||
this.fireTicks = 600;
|
||||
this.j(15);
|
||||
}
|
||||
} else {
|
||||
// reset fire level back to max
|
||||
this.fireTicks = 600;
|
||||
this.j(15);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
this.damageEntity(DamageSource.LAVA, 4);
|
||||
this.fireTicks = 600;
|
||||
this.j(15);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ah() {
|
||||
public void j(int i) {
|
||||
int j = i * 20;
|
||||
|
||||
if (this.fireTicks < j) {
|
||||
this.fireTicks = j;
|
||||
}
|
||||
}
|
||||
|
||||
public void aw() {
|
||||
this.fireTicks = 0;
|
||||
}
|
||||
|
||||
protected void ao() {
|
||||
this.die();
|
||||
}
|
||||
|
||||
@@ -346,18 +359,19 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void move(double d0, double d1, double d2) {
|
||||
if (this.bJ) {
|
||||
if (this.bN) {
|
||||
this.boundingBox.d(d0, d1, d2);
|
||||
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.bH;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.bL;
|
||||
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
|
||||
} else {
|
||||
this.bH *= 0.4F;
|
||||
MethodProfiler.a("move");
|
||||
this.bL *= 0.4F;
|
||||
double d3 = this.locX;
|
||||
double d4 = this.locZ;
|
||||
|
||||
if (this.bv) {
|
||||
this.bv = false;
|
||||
if (this.bz) {
|
||||
this.bz = false;
|
||||
d0 *= 0.25D;
|
||||
d1 *= 0.05000000074505806D;
|
||||
d2 *= 0.25D;
|
||||
@@ -403,7 +417,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
if (!this.bw && d6 != d1) {
|
||||
if (!this.bA && d6 != d1) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@@ -418,7 +432,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(d0, 0.0D, 0.0D);
|
||||
if (!this.bw && d5 != d0) {
|
||||
if (!this.bA && d5 != d0) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@@ -429,7 +443,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, 0.0D, d2);
|
||||
if (!this.bw && d7 != d2) {
|
||||
if (!this.bA && d7 != d2) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@@ -439,13 +453,13 @@ public abstract class Entity {
|
||||
double d10;
|
||||
int k;
|
||||
|
||||
if (this.bI > 0.0F && flag1 && (flag || this.bH < 0.05F) && (d5 != d0 || d7 != d2)) {
|
||||
if (this.bM > 0.0F && flag1 && (flag || this.bL < 0.05F) && (d5 != d0 || d7 != d2)) {
|
||||
d9 = d0;
|
||||
d10 = d1;
|
||||
double d11 = d2;
|
||||
|
||||
d0 = d5;
|
||||
d1 = (double) this.bI;
|
||||
d1 = (double) this.bM;
|
||||
d2 = d7;
|
||||
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
|
||||
|
||||
@@ -457,7 +471,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, d1, 0.0D);
|
||||
if (!this.bw && d6 != d1) {
|
||||
if (!this.bA && d6 != d1) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@@ -468,7 +482,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(d0, 0.0D, 0.0D);
|
||||
if (!this.bw && d5 != d0) {
|
||||
if (!this.bA && d5 != d0) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
@@ -479,18 +493,18 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
this.boundingBox.d(0.0D, 0.0D, d2);
|
||||
if (!this.bw && d7 != d2) {
|
||||
if (!this.bA && d7 != d2) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
}
|
||||
|
||||
if (!this.bw && d6 != d1) {
|
||||
if (!this.bA && d6 != d1) {
|
||||
d2 = 0.0D;
|
||||
d1 = 0.0D;
|
||||
d0 = 0.0D;
|
||||
} else {
|
||||
d1 = (double) (-this.bI);
|
||||
d1 = (double) (-this.bM);
|
||||
|
||||
for (k = 0; k < list.size(); ++k) {
|
||||
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
|
||||
@@ -508,18 +522,20 @@ public abstract class Entity {
|
||||
double d12 = this.boundingBox.b - (double) ((int) this.boundingBox.b);
|
||||
|
||||
if (d12 > 0.0D) {
|
||||
this.bH = (float) ((double) this.bH + d12 + 0.01D);
|
||||
this.bL = (float) ((double) this.bL + d12 + 0.01D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MethodProfiler.a();
|
||||
MethodProfiler.a("rest");
|
||||
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.bH;
|
||||
this.locY = this.boundingBox.b + (double) this.height - (double) this.bL;
|
||||
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
|
||||
this.positionChanged = d5 != d0 || d7 != d2;
|
||||
this.bs = d6 != d1;
|
||||
this.bw = d6 != d1;
|
||||
this.onGround = d6 != d1 && d6 < 0.0D;
|
||||
this.bt = this.positionChanged || this.bs;
|
||||
this.bx = this.positionChanged || this.bw;
|
||||
this.a(d1, this.onGround);
|
||||
if (d5 != d0) {
|
||||
this.motX = 0.0D;
|
||||
@@ -559,27 +575,19 @@ public abstract class Entity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.e_() && !flag && this.vehicle == null) {
|
||||
this.bC = (float) ((double) this.bC + (double) MathHelper.a(d9 * d9 + d10 * d10) * 0.6D);
|
||||
if (this.g_() && !flag && this.vehicle == null) {
|
||||
this.bG = (float) ((double) this.bG + (double) MathHelper.a(d9 * d9 + d10 * d10) * 0.6D);
|
||||
l = MathHelper.floor(this.locX);
|
||||
i1 = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
|
||||
j1 = MathHelper.floor(this.locZ);
|
||||
k = this.world.getTypeId(l, i1, j1);
|
||||
if (this.world.getTypeId(l, i1 - 1, j1) == Block.FENCE.id) {
|
||||
if (k == 0 && this.world.getTypeId(l, i1 - 1, j1) == Block.FENCE.id) {
|
||||
k = this.world.getTypeId(l, i1 - 1, j1);
|
||||
}
|
||||
|
||||
if (this.bC > (float) this.b && k > 0) {
|
||||
this.b = (int) this.bC + 1;
|
||||
StepSound stepsound = Block.byId[k].stepSound;
|
||||
|
||||
if (this.world.getTypeId(l, i1 + 1, j1) == Block.SNOW.id) {
|
||||
stepsound = Block.SNOW.stepSound;
|
||||
this.world.makeSound(this, stepsound.getName(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
} else if (!Block.byId[k].material.isLiquid()) {
|
||||
this.world.makeSound(this, stepsound.getName(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
}
|
||||
|
||||
if (this.bG > (float) this.b && k > 0) {
|
||||
this.b = (int) this.bG + 1;
|
||||
this.a(l, i1, j1, k);
|
||||
Block.byId[k].b(this.world, l, i1, j1, this);
|
||||
}
|
||||
}
|
||||
@@ -605,7 +613,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
boolean flag2 = this.an();
|
||||
boolean flag2 = this.ay();
|
||||
|
||||
if (this.world.d(this.boundingBox.shrink(0.0010D, 0.0010D, 0.0010D))) {
|
||||
this.burn(1);
|
||||
@@ -617,11 +625,11 @@ public abstract class Entity {
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
this.fireTicks = 300;
|
||||
this.j(8);
|
||||
}
|
||||
} else {
|
||||
// CraftBukkit end - reset fire level back to max
|
||||
this.fireTicks = 300;
|
||||
// CraftBukkit end
|
||||
this.j(8);
|
||||
}
|
||||
}
|
||||
} else if (this.fireTicks <= 0) {
|
||||
@@ -632,17 +640,30 @@ public abstract class Entity {
|
||||
this.world.makeSound(this, "random.fizz", 0.7F, 1.6F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
|
||||
this.fireTicks = -this.maxFireTicks;
|
||||
}
|
||||
|
||||
MethodProfiler.a();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean e_() {
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
StepSound stepsound = Block.byId[l].stepSound;
|
||||
|
||||
if (this.world.getTypeId(i, j + 1, k) == Block.SNOW.id) {
|
||||
stepsound = Block.SNOW.stepSound;
|
||||
this.world.makeSound(this, stepsound.getName(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
} else if (!Block.byId[l].material.isLiquid()) {
|
||||
this.world.makeSound(this, stepsound.getName(), stepsound.getVolume1() * 0.15F, stepsound.getVolume2());
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean g_() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (flag) {
|
||||
if (this.fallDistance > 0.0F) {
|
||||
this.a(this.fallDistance);
|
||||
this.b(this.fallDistance);
|
||||
this.fallDistance = 0.0F;
|
||||
}
|
||||
} else if (d0 < 0.0D) {
|
||||
@@ -650,7 +671,7 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public AxisAlignedBB f() {
|
||||
public AxisAlignedBB h_() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -672,33 +693,37 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(float f) {
|
||||
public final boolean ax() {
|
||||
return this.fireProof;
|
||||
}
|
||||
|
||||
protected void b(float f) {
|
||||
if (this.passenger != null) {
|
||||
this.passenger.a(f);
|
||||
this.passenger.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean an() {
|
||||
return this.bQ || this.world.s(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
public boolean ay() {
|
||||
return this.bS || this.world.v(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
public boolean ao() {
|
||||
return this.bQ;
|
||||
public boolean az() {
|
||||
return this.bS;
|
||||
}
|
||||
|
||||
public boolean f_() {
|
||||
public boolean i_() {
|
||||
return this.world.a(this.boundingBox.b(0.0D, -0.4000000059604645D, 0.0D).shrink(0.0010D, 0.0010D, 0.0010D), Material.WATER, this);
|
||||
}
|
||||
|
||||
public boolean a(Material material) {
|
||||
double d0 = this.locY + (double) this.t();
|
||||
double d0 = this.locY + (double) this.x();
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.d((float) MathHelper.floor(d0));
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
int l = this.world.getTypeId(i, j, k);
|
||||
|
||||
if (l != 0 && Block.byId[l].material == material) {
|
||||
float f = BlockFluids.c(this.world.getData(i, j, k)) - 0.11111111F;
|
||||
float f = BlockFluids.d(this.world.getData(i, j, k)) - 0.11111111F;
|
||||
float f1 = (float) (j + 1) - f;
|
||||
|
||||
return d0 < (double) f1;
|
||||
@@ -707,11 +732,11 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public float t() {
|
||||
public float x() {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public boolean ap() {
|
||||
public boolean aA() {
|
||||
return this.world.a(this.boundingBox.b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
|
||||
}
|
||||
|
||||
@@ -734,12 +759,11 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public float a_(float f) {
|
||||
public float a(float f) {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locZ);
|
||||
World world = this.world;
|
||||
|
||||
if (world.isLoaded(i, 128 / 2, j)) {
|
||||
if (this.world.isLoaded(i, this.world.height / 2, j)) {
|
||||
double d0 = (this.boundingBox.e - this.boundingBox.b) * 0.66D;
|
||||
int k = MathHelper.floor(this.locY - (double) this.height + d0);
|
||||
|
||||
@@ -766,7 +790,7 @@ public abstract class Entity {
|
||||
this.lastZ = this.locZ = d2;
|
||||
this.lastYaw = this.yaw = f;
|
||||
this.lastPitch = this.pitch = f1;
|
||||
this.bH = 0.0F;
|
||||
this.bL = 0.0F;
|
||||
double d3 = (double) (this.lastYaw - f);
|
||||
|
||||
if (d3 < -180.0D) {
|
||||
@@ -782,15 +806,15 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void setPositionRotation(double d0, double d1, double d2, float f, float f1) {
|
||||
this.bE = this.lastX = this.locX = d0;
|
||||
this.bF = this.lastY = this.locY = d1 + (double) this.height;
|
||||
this.bG = this.lastZ = this.locZ = d2;
|
||||
this.bI = this.lastX = this.locX = d0;
|
||||
this.bJ = this.lastY = this.locY = d1 + (double) this.height;
|
||||
this.bK = this.lastZ = this.locZ = d2;
|
||||
this.yaw = f;
|
||||
this.pitch = f1;
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
}
|
||||
|
||||
public float g(Entity entity) {
|
||||
public float h(Entity entity) {
|
||||
float f = (float) (this.locX - entity.locX);
|
||||
float f1 = (float) (this.locY - entity.locY);
|
||||
float f2 = (float) (this.locZ - entity.locZ);
|
||||
@@ -814,7 +838,7 @@ public abstract class Entity {
|
||||
return (double) MathHelper.a(d3 * d3 + d4 * d4 + d5 * d5);
|
||||
}
|
||||
|
||||
public double h(Entity entity) {
|
||||
public double i(Entity entity) {
|
||||
double d0 = this.locX - entity.locX;
|
||||
double d1 = this.locY - entity.locY;
|
||||
double d2 = this.locZ - entity.locZ;
|
||||
@@ -844,42 +868,42 @@ public abstract class Entity {
|
||||
d1 *= d3;
|
||||
d0 *= 0.05000000074505806D;
|
||||
d1 *= 0.05000000074505806D;
|
||||
d0 *= (double) (1.0F - this.bK);
|
||||
d1 *= (double) (1.0F - this.bK);
|
||||
this.b(-d0, 0.0D, -d1);
|
||||
entity.b(d0, 0.0D, d1);
|
||||
d0 *= (double) (1.0F - this.bO);
|
||||
d1 *= (double) (1.0F - this.bO);
|
||||
this.b_(-d0, 0.0D, -d1);
|
||||
entity.b_(d0, 0.0D, d1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void b(double d0, double d1, double d2) {
|
||||
public void b_(double d0, double d1, double d2) {
|
||||
this.motX += d0;
|
||||
this.motY += d1;
|
||||
this.motZ += d2;
|
||||
this.ca = true;
|
||||
this.cb = true;
|
||||
}
|
||||
|
||||
protected void aq() {
|
||||
protected void aB() {
|
||||
this.velocityChanged = true;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
this.aq();
|
||||
this.aB();
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean r_() {
|
||||
public boolean e_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean g() {
|
||||
public boolean f_() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void b(Entity entity, int i) {}
|
||||
|
||||
public boolean c(NBTTagCompound nbttagcompound) {
|
||||
String s = this.ar();
|
||||
String s = this.aC();
|
||||
|
||||
if (!this.dead && s != null) {
|
||||
nbttagcompound.setString("id", s);
|
||||
@@ -891,7 +915,7 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void d(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.a("Pos", (NBTBase) this.a(new double[] { this.locX, this.locY + (double) this.bH, this.locZ}));
|
||||
nbttagcompound.a("Pos", (NBTBase) this.a(new double[] { this.locX, this.locY + (double) this.bL, this.locZ}));
|
||||
nbttagcompound.a("Motion", (NBTBase) this.a(new double[] { this.motX, this.motY, this.motZ}));
|
||||
|
||||
// CraftBukkit start - checking for NaN pitch/yaw and resetting to zero
|
||||
@@ -908,7 +932,7 @@ public abstract class Entity {
|
||||
nbttagcompound.a("Rotation", (NBTBase) this.a(new float[] { this.yaw, this.pitch}));
|
||||
nbttagcompound.a("FallDistance", this.fallDistance);
|
||||
nbttagcompound.a("Fire", (short) this.fireTicks);
|
||||
nbttagcompound.a("Air", (short) this.airTicks);
|
||||
nbttagcompound.a("Air", (short) this.getAirTicks());
|
||||
nbttagcompound.a("OnGround", this.onGround);
|
||||
// CraftBukkit start
|
||||
nbttagcompound.setLong("WorldUUIDLeast", this.world.getUUID().getLeastSignificantBits());
|
||||
@@ -920,9 +944,9 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public void e(NBTTagCompound nbttagcompound) {
|
||||
NBTTagList nbttaglist = nbttagcompound.l("Pos");
|
||||
NBTTagList nbttaglist1 = nbttagcompound.l("Motion");
|
||||
NBTTagList nbttaglist2 = nbttagcompound.l("Rotation");
|
||||
NBTTagList nbttaglist = nbttagcompound.m("Pos");
|
||||
NBTTagList nbttaglist1 = nbttagcompound.m("Motion");
|
||||
NBTTagList nbttaglist2 = nbttagcompound.m("Rotation");
|
||||
|
||||
this.motX = ((NBTTagDouble) nbttaglist1.a(0)).a;
|
||||
this.motY = ((NBTTagDouble) nbttaglist1.a(1)).a;
|
||||
@@ -941,15 +965,15 @@ public abstract class Entity {
|
||||
}
|
||||
// CraftBukkit end */
|
||||
|
||||
this.lastX = this.bE = this.locX = ((NBTTagDouble) nbttaglist.a(0)).a;
|
||||
this.lastY = this.bF = this.locY = ((NBTTagDouble) nbttaglist.a(1)).a;
|
||||
this.lastZ = this.bG = this.locZ = ((NBTTagDouble) nbttaglist.a(2)).a;
|
||||
this.lastX = this.bI = this.locX = ((NBTTagDouble) nbttaglist.a(0)).a;
|
||||
this.lastY = this.bJ = this.locY = ((NBTTagDouble) nbttaglist.a(1)).a;
|
||||
this.lastZ = this.bK = this.locZ = ((NBTTagDouble) nbttaglist.a(2)).a;
|
||||
this.lastYaw = this.yaw = ((NBTTagFloat) nbttaglist2.a(0)).a;
|
||||
this.lastPitch = this.pitch = ((NBTTagFloat) nbttaglist2.a(1)).a;
|
||||
this.fallDistance = nbttagcompound.g("FallDistance");
|
||||
this.fireTicks = nbttagcompound.d("Fire");
|
||||
this.airTicks = nbttagcompound.d("Air");
|
||||
this.onGround = nbttagcompound.m("OnGround");
|
||||
this.fallDistance = nbttagcompound.h("FallDistance");
|
||||
this.fireTicks = nbttagcompound.e("Fire");
|
||||
this.setAirTicks(nbttagcompound.e("Air"));
|
||||
this.onGround = nbttagcompound.n("OnGround");
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1004,7 +1028,7 @@ public abstract class Entity {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected final String ar() {
|
||||
protected final String aC() {
|
||||
return EntityTypes.b(this);
|
||||
}
|
||||
|
||||
@@ -1020,7 +1044,7 @@ public abstract class Entity {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
double d0 = adouble1[j];
|
||||
|
||||
nbttaglist.a((NBTBase) (new NBTTagDouble(d0)));
|
||||
nbttaglist.a((NBTBase) (new NBTTagDouble((String) null, d0)));
|
||||
}
|
||||
|
||||
return nbttaglist;
|
||||
@@ -1034,7 +1058,7 @@ public abstract class Entity {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
float f = afloat1[j];
|
||||
|
||||
nbttaglist.a((NBTBase) (new NBTTagFloat(f)));
|
||||
nbttaglist.a((NBTBase) (new NBTTagFloat((String) null, f)));
|
||||
}
|
||||
|
||||
return nbttaglist;
|
||||
@@ -1056,17 +1080,17 @@ public abstract class Entity {
|
||||
return entityitem;
|
||||
}
|
||||
|
||||
public boolean ac() {
|
||||
public boolean aj() {
|
||||
return !this.dead;
|
||||
}
|
||||
|
||||
public boolean O() {
|
||||
public boolean T() {
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
float f = ((float) ((i >> 0) % 2) - 0.5F) * this.length * 0.9F;
|
||||
float f = ((float) ((i >> 0) % 2) - 0.5F) * this.length * 0.8F;
|
||||
float f1 = ((float) ((i >> 1) % 2) - 0.5F) * 0.1F;
|
||||
float f2 = ((float) ((i >> 2) % 2) - 0.5F) * this.length * 0.9F;
|
||||
float f2 = ((float) ((i >> 2) % 2) - 0.5F) * this.length * 0.8F;
|
||||
int j = MathHelper.floor(this.locX + (double) f);
|
||||
int k = MathHelper.floor(this.locY + (double) this.t() + (double) f1);
|
||||
int k = MathHelper.floor(this.locY + (double) this.x() + (double) f1);
|
||||
int l = MathHelper.floor(this.locZ + (double) f2);
|
||||
|
||||
if (this.world.e(j, k, l)) {
|
||||
@@ -1081,40 +1105,40 @@ public abstract class Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
public AxisAlignedBB b(Entity entity) {
|
||||
public AxisAlignedBB a_(Entity entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void I() {
|
||||
public void M() {
|
||||
if (this.vehicle.dead) {
|
||||
this.vehicle = null;
|
||||
} else {
|
||||
this.motX = 0.0D;
|
||||
this.motY = 0.0D;
|
||||
this.motZ = 0.0D;
|
||||
this.s_();
|
||||
this.w_();
|
||||
if (this.vehicle != null) {
|
||||
this.vehicle.g_();
|
||||
this.e += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
|
||||
this.vehicle.i();
|
||||
this.f += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
|
||||
|
||||
for (this.d += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.e >= 180.0D; this.e -= 360.0D) {
|
||||
for (this.e += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.f >= 180.0D; this.f -= 360.0D) {
|
||||
;
|
||||
}
|
||||
|
||||
while (this.f < -180.0D) {
|
||||
this.f += 360.0D;
|
||||
}
|
||||
|
||||
while (this.e >= 180.0D) {
|
||||
this.e -= 360.0D;
|
||||
}
|
||||
|
||||
while (this.e < -180.0D) {
|
||||
this.e += 360.0D;
|
||||
}
|
||||
|
||||
while (this.d >= 180.0D) {
|
||||
this.d -= 360.0D;
|
||||
}
|
||||
|
||||
while (this.d < -180.0D) {
|
||||
this.d += 360.0D;
|
||||
}
|
||||
|
||||
double d0 = this.e * 0.5D;
|
||||
double d1 = this.d * 0.5D;
|
||||
double d0 = this.f * 0.5D;
|
||||
double d1 = this.e * 0.5D;
|
||||
float f = 10.0F;
|
||||
|
||||
if (d0 > (double) f) {
|
||||
@@ -1133,23 +1157,23 @@ public abstract class Entity {
|
||||
d1 = (double) (-f);
|
||||
}
|
||||
|
||||
this.e -= d0;
|
||||
this.d -= d1;
|
||||
this.f -= d0;
|
||||
this.e -= d1;
|
||||
this.yaw = (float) ((double) this.yaw + d0);
|
||||
this.pitch = (float) ((double) this.pitch + d1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void g_() {
|
||||
this.passenger.setPosition(this.locX, this.locY + this.n() + this.passenger.M(), this.locZ);
|
||||
public void i() {
|
||||
this.passenger.setPosition(this.locX, this.locY + this.q() + this.passenger.R(), this.locZ);
|
||||
}
|
||||
|
||||
public double M() {
|
||||
public double R() {
|
||||
return (double) this.height;
|
||||
}
|
||||
|
||||
public double n() {
|
||||
public double q() {
|
||||
return (double) this.width * 0.75D;
|
||||
}
|
||||
|
||||
@@ -1172,8 +1196,8 @@ public abstract class Entity {
|
||||
// so this method is needed
|
||||
|
||||
// CraftBukkit end
|
||||
this.d = 0.0D;
|
||||
this.e = 0.0D;
|
||||
this.f = 0.0D;
|
||||
if (entity == null) {
|
||||
if (this.vehicle != null) {
|
||||
// CraftBukkit start
|
||||
@@ -1213,18 +1237,26 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public Vec3D ai() {
|
||||
public float j_() {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
public Vec3D ap() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void T() {}
|
||||
public void Y() {}
|
||||
|
||||
public ItemStack[] getEquipment() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean z() {
|
||||
return this.fireTicks > 0 || this.k(0);
|
||||
}
|
||||
|
||||
public boolean isSneaking() {
|
||||
return this.e(1);
|
||||
return this.k(1);
|
||||
}
|
||||
|
||||
public void setSneak(boolean flag) {
|
||||
@@ -1232,18 +1264,18 @@ public abstract class Entity {
|
||||
}
|
||||
|
||||
public boolean isSprinting() {
|
||||
return this.e(3);
|
||||
return this.k(3);
|
||||
}
|
||||
|
||||
public void setSprinting(boolean flag) {
|
||||
this.a(3, flag);
|
||||
}
|
||||
|
||||
public void h(boolean flag) {
|
||||
public void g(boolean flag) {
|
||||
this.a(4, flag);
|
||||
}
|
||||
|
||||
protected boolean e(int i) {
|
||||
protected boolean k(int i) {
|
||||
return (this.datawatcher.getByte(0) & 1 << i) != 0;
|
||||
}
|
||||
|
||||
@@ -1257,6 +1289,14 @@ public abstract class Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public int getAirTicks() {
|
||||
return this.datawatcher.b(1);
|
||||
}
|
||||
|
||||
public void setAirTicks(int i) {
|
||||
this.datawatcher.watch(1, Short.valueOf((short) i));
|
||||
}
|
||||
|
||||
public void a(EntityWeatherStorm entityweatherstorm) {
|
||||
// CraftBukkit start
|
||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(entityweatherstorm.getBukkitEntity(), this.getBukkitEntity(), EntityDamageEvent.DamageCause.LIGHTNING, 5);
|
||||
@@ -1271,7 +1311,7 @@ public abstract class Entity {
|
||||
|
||||
++this.fireTicks;
|
||||
if (this.fireTicks == 0) {
|
||||
this.fireTicks = 300;
|
||||
this.j(8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1350,16 +1390,18 @@ public abstract class Entity {
|
||||
if (b0 == 5) {
|
||||
this.motZ = (double) f;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void q() {
|
||||
this.bv = true;
|
||||
public void s() {
|
||||
this.bz = true;
|
||||
}
|
||||
|
||||
public String Y() {
|
||||
public String ad() {
|
||||
String s = EntityTypes.b(this);
|
||||
|
||||
if (s == null) {
|
||||
@@ -1368,4 +1410,12 @@ public abstract class Entity {
|
||||
|
||||
return StatisticCollector.a("entity." + s + ".name");
|
||||
}
|
||||
|
||||
public Entity[] aG() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean a(Entity entity) {
|
||||
return this == entity;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user