Update for 1.6.5

This commit is contained in:
Erik Broes 2011-05-28 22:50:08 +02:00 committed by EvilSeph
parent 9ec5d8b5df
commit 6dbd710bbf
41 changed files with 747 additions and 669 deletions

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId>
<version>1.6.4</version>
<version>1.6.5</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

View File

@ -196,7 +196,7 @@ public class BlockFire extends Block {
}
}
public boolean n_() {
public boolean m_() {
return false;
}

View File

@ -377,15 +377,15 @@ public class Chunk {
k = this.entitySlices.length - 1;
}
entity.bE = true;
entity.bF = this.x;
entity.bG = k;
entity.bH = this.z;
entity.bF = true;
entity.bG = this.x;
entity.bH = k;
entity.bI = this.z;
this.entitySlices[k].add(entity);
}
public void b(Entity entity) {
this.a(entity, entity.bG);
this.a(entity, entity.bH);
}
public void a(Entity entity, int i) {

View File

@ -1,6 +1,5 @@
package net.minecraft.server;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@ -25,8 +24,8 @@ public abstract class Entity {
private static int entityCount = 0;
public int id;
public double aG;
public boolean aH;
public double aH;
public boolean aI;
public Entity passenger;
public Entity vehicle;
public World world;
@ -46,80 +45,78 @@ public abstract class Entity {
public final AxisAlignedBB boundingBox;
public boolean onGround;
public boolean positionChanged;
public boolean bb;
public boolean bc;
public boolean bd;
public boolean velocityChanged;
public boolean be;
public boolean bf;
public boolean bg;
public boolean dead;
public float height;
public float length;
public float width;
public float bk;
public float bl;
public float bm;
public float fallDistance; // CraftBukkit - private -> public
private int b;
public double bn;
public double bo;
public double bp;
public float bq;
public double bq;
public float br;
public boolean bs;
public float bt;
public float bs;
public boolean bt;
public float bu;
protected Random random;
public int ticksLived;
public int maxFireTicks;
public int fireTicks;
public int maxAirTicks; // CraftBukkit - protected - >public
protected boolean bz;
protected boolean bA;
public int noDamageTicks;
public int airTicks;
private boolean justCreated;
protected boolean bC;
protected boolean bD;
protected DataWatcher datawatcher;
private double d;
private double e;
public boolean bE;
public int bF;
public boolean bF;
public int bG;
public int bH;
public boolean bI;
private ArrayList f;
public int bI;
public boolean bJ;
public Entity(World world) {
this.id = entityCount++;
this.aG = 1.0D;
this.aH = false;
this.aH = 1.0D;
this.aI = false;
this.boundingBox = AxisAlignedBB.a(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
this.onGround = false;
this.bc = false;
this.bd = false;
this.velocityChanged = false;
this.bf = true;
this.bg = true;
this.dead = false;
this.height = 0.0F;
this.length = 0.6F;
this.width = 1.8F;
this.bk = 0.0F;
this.bl = 0.0F;
this.bm = 0.0F;
this.fallDistance = 0.0F;
this.b = 1;
this.bq = 0.0F;
this.br = 0.0F;
this.bs = false;
this.bt = 0.0F;
this.bs = 0.0F;
this.bt = false;
this.bu = 0.0F;
this.random = new Random();
this.ticksLived = 0;
this.maxFireTicks = 1;
this.fireTicks = 0;
this.maxAirTicks = 300;
this.bz = false;
this.bA = false;
this.noDamageTicks = 0;
this.airTicks = 300;
this.justCreated = true;
this.bC = false;
this.bD = false;
this.datawatcher = new DataWatcher();
this.bE = false;
this.f = new ArrayList();
this.bF = false;
this.world = world;
this.setPosition(0.0D, 0.0D, 0.0D);
this.datawatcher.a(0, Byte.valueOf((byte) 0));
@ -128,7 +125,7 @@ public abstract class Entity {
protected abstract void b();
public DataWatcher X() {
public DataWatcher Z() {
return this.datawatcher;
}
@ -188,27 +185,27 @@ 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.bq, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.bq + (double) f1, d2 + (double) f);
this.boundingBox.c(d0 - (double) f, d1 - (double) this.height + (double) this.br, d2 - (double) f, d0 + (double) f, d1 - (double) this.height + (double) this.br + (double) f1, d2 + (double) f);
}
public void p_() {
this.O();
public void o_() {
this.Q();
}
public void O() {
public void Q() {
if (this.vehicle != null && this.vehicle.dead) {
this.vehicle = null;
}
++this.ticksLived;
this.bk = this.bl;
this.bl = this.bm;
this.lastX = this.locX;
this.lastY = this.locY;
this.lastZ = this.locZ;
this.lastPitch = this.pitch;
this.lastYaw = this.yaw;
if (this.f_()) {
if (!this.bz && !this.justCreated) {
if (!this.bA && !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) {
@ -236,16 +233,16 @@ public abstract class Entity {
}
this.fallDistance = 0.0F;
this.bz = true;
this.bA = true;
this.fireTicks = 0;
} else {
this.bz = false;
this.bA = false;
}
if (this.world.isStatic) {
this.fireTicks = 0;
} else if (this.fireTicks > 0) {
if (this.bC) {
if (this.bD) {
this.fireTicks -= 4;
if (this.fireTicks < 0) {
this.fireTicks = 0;
@ -276,12 +273,12 @@ public abstract class Entity {
}
}
if (this.ab()) {
this.Y();
if (this.ad()) {
this.aa();
}
if (this.locY < -64.0D) {
this.V();
this.X();
}
if (!this.world.isStatic) {
@ -292,8 +289,8 @@ public abstract class Entity {
this.justCreated = false;
}
protected void Y() {
if (!this.bC) {
protected void aa() {
if (!this.bD) {
// CraftBukkit start - TODO: this event spams!
if (this instanceof EntityLiving) {
CraftServer server = ((WorldServer) this.world).getServer();
@ -330,7 +327,7 @@ public abstract class Entity {
}
}
protected void V() {
protected void X() {
this.die();
}
@ -342,17 +339,18 @@ public abstract class Entity {
}
public void move(double d0, double d1, double d2) {
if (this.bs) {
if (this.bt) {
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.bq;
this.locY = this.boundingBox.b + (double) this.height - (double) this.br;
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
} else {
this.br *= 0.4F;
double d3 = this.locX;
double d4 = this.locZ;
if (this.be) {
this.be = false;
if (this.bf) {
this.bf = false;
d0 *= 0.25D;
d1 *= 0.05000000074505806D;
d2 *= 0.25D;
@ -398,7 +396,7 @@ public abstract class Entity {
}
this.boundingBox.d(0.0D, d1, 0.0D);
if (!this.bf && d6 != d1) {
if (!this.bg && d6 != d1) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
@ -413,7 +411,7 @@ public abstract class Entity {
}
this.boundingBox.d(d0, 0.0D, 0.0D);
if (!this.bf && d5 != d0) {
if (!this.bg && d5 != d0) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
@ -424,7 +422,7 @@ public abstract class Entity {
}
this.boundingBox.d(0.0D, 0.0D, d2);
if (!this.bf && d7 != d2) {
if (!this.bg && d7 != d2) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
@ -434,13 +432,13 @@ public abstract class Entity {
double d10;
int k;
if (this.br > 0.0F && flag1 && (flag || this.bq < 0.05F) && (d5 != d0 || d7 != d2)) {
if (this.bs > 0.0F && flag1 && (flag || this.br < 0.05F) && (d5 != d0 || d7 != d2)) {
d9 = d0;
d10 = d1;
double d11 = d2;
d0 = d5;
d1 = (double) this.br;
d1 = (double) this.bs;
d2 = d7;
AxisAlignedBB axisalignedbb1 = this.boundingBox.clone();
@ -452,7 +450,7 @@ public abstract class Entity {
}
this.boundingBox.d(0.0D, d1, 0.0D);
if (!this.bf && d6 != d1) {
if (!this.bg && d6 != d1) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
@ -463,7 +461,7 @@ public abstract class Entity {
}
this.boundingBox.d(d0, 0.0D, 0.0D);
if (!this.bf && d5 != d0) {
if (!this.bg && d5 != d0) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
@ -474,18 +472,18 @@ public abstract class Entity {
}
this.boundingBox.d(0.0D, 0.0D, d2);
if (!this.bf && d7 != d2) {
if (!this.bg && d7 != d2) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
}
if (!this.bf && d6 != d1) {
if (!this.bg && d6 != d1) {
d2 = 0.0D;
d1 = 0.0D;
d0 = 0.0D;
} else {
d1 = (double) (-this.br);
d1 = (double) (-this.bs);
for (k = 0; k < list.size(); ++k) {
d1 = ((AxisAlignedBB) list.get(k)).b(this.boundingBox, d1);
@ -503,18 +501,18 @@ public abstract class Entity {
double d12 = this.boundingBox.b - (double) ((int) this.boundingBox.b);
if (d12 > 0.0D) {
this.bq = (float) ((double) this.bq + d12 + 0.01D);
this.br = (float) ((double) this.br + d12 + 0.01D);
}
}
}
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
this.locY = this.boundingBox.b + (double) this.height - (double) this.bq;
this.locY = this.boundingBox.b + (double) this.height - (double) this.br;
this.locZ = (this.boundingBox.c + this.boundingBox.f) / 2.0D;
this.positionChanged = d5 != d0 || d7 != d2;
this.bb = d6 != d1;
this.bc = d6 != d1;
this.onGround = d6 != d1 && d6 < 0.0D;
this.bc = this.positionChanged || this.bb;
this.bd = this.positionChanged || this.bc;
this.a(d1, this.onGround);
if (d5 != d0) {
this.motX = 0.0D;
@ -556,7 +554,7 @@ public abstract class Entity {
// CraftBukkit end
if (this.n() && !flag && this.vehicle == null) {
this.bl = (float) ((double) this.bl + (double) MathHelper.a(d9 * d9 + d10 * d10) * 0.6D);
this.bm = (float) ((double) this.bm + (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);
@ -565,7 +563,7 @@ public abstract class Entity {
k = this.world.getTypeId(l, i1 - 1, j1);
}
if (this.bl > (float) this.b && k > 0) {
if (this.bm > (float) this.b && k > 0) {
++this.b;
StepSound stepsound = Block.byId[k].stepSound;
@ -601,8 +599,7 @@ public abstract class Entity {
}
}
this.bq *= 0.4F;
boolean flag2 = this.Z();
boolean flag2 = this.ab();
if (this.world.d(this.boundingBox.shrink(0.0010D, 0.0010D, 0.0010D))) {
this.a(1);
@ -656,7 +653,7 @@ public abstract class Entity {
}
protected void a(int i) {
if (!this.bC) {
if (!this.bD) {
// CraftBukkit start
if (this instanceof EntityLiving) {
CraftServer server = ((WorldServer) this.world).getServer();
@ -684,12 +681,12 @@ public abstract class Entity {
}
}
public boolean Z() {
return this.bz || this.world.s(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
public boolean ab() {
return this.bA || this.world.s(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
}
public boolean aa() {
return this.bz;
public boolean ac() {
return this.bA;
}
public boolean f_() {
@ -717,7 +714,7 @@ public abstract class Entity {
return 0.0F;
}
public boolean ab() {
public boolean ad() {
return this.world.a(this.boundingBox.b(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA);
}
@ -759,7 +756,7 @@ public abstract class Entity {
this.lastZ = this.locZ = d2;
this.lastYaw = this.yaw = f;
this.lastPitch = this.pitch = f1;
this.bq = 0.0F;
this.br = 0.0F;
double d3 = (double) (this.lastYaw - f);
if (d3 < -180.0D) {
@ -775,9 +772,9 @@ public abstract class Entity {
}
public void setPositionRotation(double d0, double d1, double d2, float f, float f1) {
this.bn = this.lastX = this.locX = d0;
this.bo = this.lastY = this.locY = d1 + (double) this.height;
this.bp = this.lastZ = this.locZ = d2;
this.bo = this.lastX = this.locX = d0;
this.bp = this.lastY = this.locY = d1 + (double) this.height;
this.bq = this.lastZ = this.locZ = d2;
this.yaw = f;
this.pitch = f1;
this.setPosition(this.locX, this.locY, this.locZ);
@ -837,8 +834,8 @@ public abstract class Entity {
d1 *= d3;
d0 *= 0.05000000074505806D;
d1 *= 0.05000000074505806D;
d0 *= (double) (1.0F - this.bt);
d1 *= (double) (1.0F - this.bt);
d0 *= (double) (1.0F - this.bu);
d1 *= (double) (1.0F - this.bu);
this.f(-d0, 0.0D, -d1);
entity.f(d0, 0.0D, d1);
}
@ -851,16 +848,16 @@ public abstract class Entity {
this.motZ += d2;
}
protected void ac() {
protected void ae() {
this.velocityChanged = true;
}
public boolean damageEntity(Entity entity, int i) {
this.ac();
this.ae();
return false;
}
public boolean o_() {
public boolean n_() {
return false;
}
@ -871,7 +868,7 @@ public abstract class Entity {
public void c(Entity entity, int i) {}
public boolean c(NBTTagCompound nbttagcompound) {
String s = this.ad();
String s = this.af();
if (!this.dead && s != null) {
nbttagcompound.setString("id", s);
@ -883,7 +880,7 @@ public abstract class Entity {
}
public void d(NBTTagCompound nbttagcompound) {
nbttagcompound.a("Pos", (NBTBase) this.a(new double[] { this.locX, this.locY + (double) this.height - (double) this.bq, this.locZ}));
nbttagcompound.a("Pos", (NBTBase) this.a(new double[] { this.locX, this.locY + (double) this.br, 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
@ -911,7 +908,6 @@ public abstract class Entity {
NBTTagList nbttaglist1 = nbttagcompound.l("Motion");
NBTTagList nbttaglist2 = nbttagcompound.l("Rotation");
this.setPosition(0.0D, 0.0D, 0.0D);
this.motX = ((NBTTagDouble) nbttaglist1.a(0)).a;
this.motY = ((NBTTagDouble) nbttaglist1.a(1)).a;
this.motZ = ((NBTTagDouble) nbttaglist1.a(2)).a;
@ -927,9 +923,9 @@ public abstract class Entity {
this.motZ = 0.0D;
}
this.lastX = this.bn = this.locX = ((NBTTagDouble) nbttaglist.a(0)).a;
this.lastY = this.bo = this.locY = ((NBTTagDouble) nbttaglist.a(1)).a;
this.lastZ = this.bp = this.locZ = ((NBTTagDouble) nbttaglist.a(2)).a;
this.lastX = this.bo = this.locX = ((NBTTagDouble) nbttaglist.a(0)).a;
this.lastY = this.bp = this.locY = ((NBTTagDouble) nbttaglist.a(1)).a;
this.lastZ = this.bq = 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");
@ -957,7 +953,7 @@ public abstract class Entity {
// CraftBukkit end
}
protected final String ad() {
protected final String af() {
return EntityTypes.b(this);
}
@ -1009,11 +1005,11 @@ public abstract class Entity {
return entityitem;
}
public boolean Q() {
public boolean S() {
return !this.dead;
}
public boolean H() {
public boolean J() {
for (int i = 0; i < 8; ++i) {
float f = ((float) ((i >> 0) % 2) - 0.5F) * this.length * 0.9F;
float f1 = ((float) ((i >> 1) % 2) - 0.5F) * 0.1F;
@ -1038,14 +1034,14 @@ public abstract class Entity {
return null;
}
public void B() {
public void D() {
if (this.vehicle.dead) {
this.vehicle = null;
} else {
this.motX = 0.0D;
this.motY = 0.0D;
this.motZ = 0.0D;
this.p_();
this.o_();
if (this.vehicle != null) {
this.vehicle.f();
this.e += (double) (this.vehicle.yaw - this.vehicle.lastYaw);
@ -1095,10 +1091,10 @@ public abstract class Entity {
}
public void f() {
this.passenger.setPosition(this.locX, this.locY + this.m() + this.passenger.F(), this.locZ);
this.passenger.setPosition(this.locX, this.locY + this.m() + this.passenger.H(), this.locZ);
}
public double F() {
public double H() {
return (double) this.height;
}
@ -1172,11 +1168,11 @@ public abstract class Entity {
}
}
public Vec3D W() {
public Vec3D Y() {
return null;
}
public void M() {}
public void O() {}
public ItemStack[] getEquipment() {
return null;
@ -1226,18 +1222,6 @@ public abstract class Entity {
public void a(EntityLiving entityliving) {}
private boolean a(int i, int j, int k) {
int l = this.world.getTypeId(i, j, k);
if (l == 0) {
return false;
} else {
this.f.clear();
Block.byId[l].a(this.world, i, j, k, this.boundingBox, this.f);
return this.f.size() > 0;
}
}
protected boolean g(double d0, double d1, double d2) {
int i = MathHelper.floor(d0);
int j = MathHelper.floor(d1);
@ -1246,13 +1230,13 @@ public abstract class Entity {
double d4 = d1 - (double) j;
double d5 = d2 - (double) k;
if (this.a(i, j, k)) {
boolean flag = !this.a(i - 1, j, k);
boolean flag1 = !this.a(i + 1, j, k);
boolean flag2 = !this.a(i, j - 1, k);
boolean flag3 = !this.a(i, j + 1, k);
boolean flag4 = !this.a(i, j, k - 1);
boolean flag5 = !this.a(i, j, k + 1);
if (this.world.d(i, j, k)) {
boolean flag = !this.world.d(i - 1, j, k);
boolean flag1 = !this.world.d(i + 1, j, k);
boolean flag2 = !this.world.d(i, j - 1, k);
boolean flag3 = !this.world.d(i, j + 1, k);
boolean flag4 = !this.world.d(i, j, k - 1);
boolean flag5 = !this.world.d(i, j, k + 1);
byte b0 = -1;
double d6 = 9999.0D;

View File

@ -76,8 +76,8 @@ public class EntityArrow extends Entity {
this.j = 0;
}
public void p_() {
super.p_();
public void o_() {
super.o_();
if (this.lastPitch == 0.0F && this.lastYaw == 0.0F) {
float f = MathHelper.a(this.motX * this.motX + this.motZ * this.motZ);
@ -89,7 +89,7 @@ public class EntityArrow extends Entity {
if (i > 0) {
Block.byId[i].a(this.world, this.d, this.e, this.f);
if (Block.byId[i].d(this.world, this.d, this.e, this.f).a(Vec3D.create(this.locX, this.locY, this.locZ))) {
if (Block.byId[i].d(this.world, this.d, this.e, this.f) != null && Block.byId[i].d(this.world, this.d, this.e, this.f).a(Vec3D.create(this.locX, this.locY, this.locZ))) {
this.i = true;
}
}
@ -136,7 +136,7 @@ public class EntityArrow extends Entity {
for (int k = 0; k < list.size(); ++k) {
Entity entity1 = (Entity) list.get(k);
if (entity1.o_() && (entity1 != this.shooter || this.k >= 5)) {
if (entity1.n_() && (entity1 != this.shooter || this.k >= 5)) {
f1 = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f1, (double) f1, (double) f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -244,7 +244,7 @@ public class EntityArrow extends Entity {
float f3 = 0.99F;
f1 = 0.03F;
if (this.aa()) {
if (this.ac()) {
for (int l = 0; l < 4; ++l) {
float f4 = 0.25F;

View File

@ -53,7 +53,7 @@ public class EntityBoat extends Entity {
this.damage = 0;
this.b = 0;
this.c = 1;
this.aH = true;
this.aI = true;
this.b(1.5F, 0.6F);
this.height = this.width / 2.0F;
}
@ -116,7 +116,7 @@ public class EntityBoat extends Entity {
this.c = -this.c;
this.b = 10;
this.damage += i * 10;
this.ac();
this.ae();
if (this.damage > 40) {
// CraftBukkit start
@ -148,11 +148,11 @@ public class EntityBoat extends Entity {
}
}
public boolean o_() {
public boolean n_() {
return !this.dead;
}
public void p_() {
public void o_() {
// CraftBukkit start
double prevX = this.locX;
double prevY = this.locY;
@ -161,7 +161,7 @@ public class EntityBoat extends Entity {
float prevPitch = this.pitch;
// CraftBukkit end
super.p_();
super.o_();
if (this.b > 0) {
--this.b;
}
@ -385,7 +385,7 @@ public class EntityBoat extends Entity {
double d0 = Math.cos((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D;
double d1 = Math.sin((double) this.yaw * 3.141592653589793D / 180.0D) * 0.4D;
this.passenger.setPosition(this.locX + d0, this.locY + this.m() + this.passenger.F(), this.locZ + d1);
this.passenger.setPosition(this.locX + d0, this.locY + this.m() + this.passenger.H(), this.locZ + d1);
}
}

View File

@ -47,7 +47,7 @@ public class EntityCreature extends EntityLiving {
if (this.target != null) {
this.pathEntity = this.world.findPath(this, this.target, f);
}
} else if (!this.target.Q()) {
} else if (!this.target.S()) {
// CraftBukkit start
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.TARGET_DIED);
CraftServer server = ((WorldServer) this.world).getServer();
@ -101,8 +101,8 @@ public class EntityCreature extends EntityLiving {
}
int l1 = MathHelper.floor(this.boundingBox.b + 0.5D);
boolean flag1 = this.aa();
boolean flag2 = this.ab();
boolean flag1 = this.ac();
boolean flag2 = this.ad();
this.pitch = 0.0F;
if (this.pathEntity != null && this.random.nextInt(100) != 0) {
@ -119,7 +119,7 @@ public class EntityCreature extends EntityLiving {
}
}
this.aB = false;
this.aC = false;
if (vec3d != null) {
double d1 = vec3d.a - this.locX;
double d2 = vec3d.c - this.locZ;
@ -128,7 +128,7 @@ public class EntityCreature extends EntityLiving {
float f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
float f5 = f4 - this.yaw;
for (this.az = this.aD; f5 < -180.0F; f5 += 360.0F) {
for (this.aA = this.aE; f5 < -180.0F; f5 += 360.0F) {
;
}
@ -152,12 +152,12 @@ public class EntityCreature extends EntityLiving {
this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
f5 = (f6 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
this.ay = -MathHelper.sin(f5) * this.az * 1.0F;
this.az = MathHelper.cos(f5) * this.az * 1.0F;
this.az = -MathHelper.sin(f5) * this.aA * 1.0F;
this.aA = MathHelper.cos(f5) * this.aA * 1.0F;
}
if (d3 > 0.0D) {
this.aB = true;
this.aC = true;
}
}
@ -165,12 +165,12 @@ public class EntityCreature extends EntityLiving {
this.a(this.target, 30.0F, 30.0F);
}
if (this.positionChanged && !this.C()) {
this.aB = true;
if (this.positionChanged && !this.B()) {
this.aC = true;
}
if (this.random.nextFloat() < 0.8F && (flag1 || flag2)) {
this.aB = true;
this.aC = true;
}
} else {
super.c_();
@ -198,7 +198,7 @@ public class EntityCreature extends EntityLiving {
return super.d() && this.a(i, j, k) >= 0.0F;
}
public boolean C() {
public boolean B() {
return this.pathEntity != null;
}
@ -206,7 +206,7 @@ public class EntityCreature extends EntityLiving {
this.pathEntity = pathentity;
}
public Entity D() {
public Entity E() {
return this.target;
}

View File

@ -36,16 +36,18 @@ public class EntityCreeper extends EntityMonster {
}
protected void b(Entity entity, float f) {
if (this.fuseTicks > 0) {
this.e(-1);
--this.fuseTicks;
if (this.fuseTicks < 0) {
this.fuseTicks = 0;
if (!this.world.isStatic) {
if (this.fuseTicks > 0) {
this.e(-1);
--this.fuseTicks;
if (this.fuseTicks < 0) {
this.fuseTicks = 0;
}
}
}
}
public void p_() {
public void o_() {
this.b = this.fuseTicks;
if (this.world.isStatic) {
int i = this.x();
@ -64,7 +66,7 @@ public class EntityCreeper extends EntityMonster {
}
}
super.p_();
super.o_();
if (this.target == null && this.fuseTicks > 0) {
this.e(-1);
--this.fuseTicks;
@ -90,39 +92,43 @@ public class EntityCreeper extends EntityMonster {
}
protected void a(Entity entity, float f) {
int i = this.x();
if (!this.world.isStatic) {
int i = this.x();
if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) {
this.e(-1);
--this.fuseTicks;
if (this.fuseTicks < 0) {
this.fuseTicks = 0;
}
} else {
if (this.fuseTicks == 0) {
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
}
this.e(1);
++this.fuseTicks;
if (this.fuseTicks >= 30) {
// CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer();
float radius = this.t() ? 6.0F : 3.0F;
ExplosionPrimeEvent event = new ExplosionPrimeEvent(CraftEntity.getEntity(server, this), radius, false);
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
this.die();
} else {
if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) {
this.e(-1);
--this.fuseTicks;
if (this.fuseTicks < 0) {
this.fuseTicks = 0;
}
// CraftBukkit end
}
} else {
if (this.fuseTicks == 0) {
this.world.makeSound(this, "random.fuse", 1.0F, 0.5F);
}
this.e = true;
this.e(1);
++this.fuseTicks;
if (this.fuseTicks >= 30) {
// CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer();
float radius = this.t() ? 6.0F : 3.0F;
ExplosionPrimeEvent event = new ExplosionPrimeEvent(CraftEntity.getEntity(server, this), radius, false);
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
this.die();
} else {
this.fuseTicks = 0;
}
// CraftBukkit end
this.die();
}
this.e = true;
}
}
}

View File

@ -80,11 +80,11 @@ public class EntityEgg extends Entity {
this.h = 0;
}
public void p_() {
this.bn = this.locX;
this.bo = this.locY;
this.bp = this.locZ;
super.p_();
public void o_() {
this.bo = this.locX;
this.bp = this.locY;
this.bq = this.locZ;
super.o_();
if (this.a > 0) {
--this.a;
}
@ -129,7 +129,7 @@ public class EntityEgg extends Entity {
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.o_() && (entity1 != this.thrower || this.i >= 5)) {
if (entity1.n_() && (entity1 != this.thrower || this.i >= 5)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -301,7 +301,7 @@ public class EntityEgg extends Entity {
float f2 = 0.99F;
float f3 = 0.03F;
if (this.aa()) {
if (this.ac()) {
for (int i1 = 0; i1 < 4; ++i1) {
float f4 = 0.25F;

View File

@ -51,8 +51,8 @@ public class EntityFireball extends Entity {
this.e = d2 / d3 * 0.1D;
}
public void p_() {
super.p_();
public void o_() {
super.o_();
this.fireTicks = 10;
if (this.a > 0) {
--this.a;
@ -97,7 +97,7 @@ public class EntityFireball extends Entity {
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.o_() && (entity1 != this.shooter || this.l >= 25)) {
if (entity1.n_() && (entity1 != this.shooter || this.l >= 25)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -191,7 +191,7 @@ public class EntityFireball extends Entity {
this.yaw = this.lastYaw + (this.yaw - this.lastYaw) * 0.2F;
float f2 = 0.95F;
if (this.aa()) {
if (this.ac()) {
for (int k = 0; k < 4; ++k) {
float f3 = 0.25F;
@ -229,14 +229,14 @@ public class EntityFireball extends Entity {
this.j = nbttagcompound.c("inGround") == 1;
}
public boolean o_() {
public boolean n_() {
return true;
}
public boolean damageEntity(Entity entity, int i) {
this.ac();
this.ae();
if (entity != null) {
Vec3D vec3d = entity.W();
Vec3D vec3d = entity.Y();
if (vec3d != null) {
this.motX = vec3d.a;

View File

@ -32,12 +32,12 @@ public class EntityFish extends Entity {
public EntityFish(World world) {
super(world);
this.b(0.25F, 0.25F);
this.bI = true;
this.bJ = true;
}
public EntityFish(World world, EntityHuman entityhuman) {
super(world);
this.bI = true;
this.bJ = true;
this.owner = entityhuman;
this.owner.hookedFish = this;
this.b(0.25F, 0.25F);
@ -79,8 +79,8 @@ public class EntityFish extends Entity {
this.i = 0;
}
public void p_() {
super.p_();
public void o_() {
super.o_();
if (this.l > 0) {
double d0 = this.locX + (this.m - this.locX) / (double) this.l;
double d1 = this.locY + (this.n - this.locY) / (double) this.l;
@ -103,9 +103,9 @@ public class EntityFish extends Entity {
this.c(this.yaw, this.pitch);
} else {
if (!this.world.isStatic) {
ItemStack itemstack = this.owner.D();
ItemStack itemstack = this.owner.F();
if (this.owner.dead || !this.owner.Q() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.g(this.owner) > 1024.0D) {
if (this.owner.dead || !this.owner.S() || itemstack == null || itemstack.getItem() != Item.FISHING_ROD || this.g(this.owner) > 1024.0D) {
this.die();
this.owner.hookedFish = null;
return;
@ -168,7 +168,7 @@ public class EntityFish extends Entity {
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.o_() && (entity1 != this.owner || this.j >= 5)) {
if (entity1.n_() && (entity1 != this.owner || this.j >= 5)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);

View File

@ -39,16 +39,16 @@ public abstract class EntityHuman extends EntityLiving {
public boolean sleeping;
public boolean fauxSleeping;
// CraftBukkit end
private ChunkCoordinates a;
public ChunkCoordinates A;
public int sleepTicks; // CraftBukkit - private -> public
public float A;
public float B;
public float C;
private ChunkCoordinates b;
private ChunkCoordinates c;
private ChunkCoordinates d;
public int C = 20;
protected boolean D = false;
public float E;
private int e = 0;
public int D = 20;
protected boolean E = false;
public float F;
private int d = 0;
public EntityFish hookedFish = null;
public EntityHuman(World world) {
@ -60,8 +60,8 @@ public abstract class EntityHuman extends EntityLiving {
this.setPositionRotation((double) chunkcoordinates.x + 0.5D, (double) (chunkcoordinates.y + 1), (double) chunkcoordinates.z + 0.5D, 0.0F, 0.0F);
this.health = 20;
this.T = "humanoid";
this.S = 180.0F;
this.U = "humanoid";
this.T = 180.0F;
this.maxFireTicks = 20;
this.texture = "/mob/char.png";
}
@ -71,7 +71,7 @@ public abstract class EntityHuman extends EntityLiving {
this.datawatcher.a(16, Byte.valueOf((byte) 0));
}
public void p_() {
public void o_() {
if (this.isSleeping()) {
++this.sleepTicks;
if (this.sleepTicks > 100) {
@ -90,7 +90,7 @@ public abstract class EntityHuman extends EntityLiving {
}
}
super.p_();
super.o_();
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) {
this.x();
this.activeContainer = this.defaultContainer;
@ -133,11 +133,11 @@ public abstract class EntityHuman extends EntityLiving {
this.x += d1 * 0.25D;
this.a(StatisticList.k, 1);
if (this.vehicle == null) {
this.d = null;
this.c = null;
}
}
protected boolean A() {
protected boolean C() {
return this.health <= 0 || this.isSleeping();
}
@ -145,12 +145,12 @@ public abstract class EntityHuman extends EntityLiving {
this.activeContainer = this.defaultContainer;
}
public void B() {
public void D() {
double d0 = this.locX;
double d1 = this.locY;
double d2 = this.locZ;
super.B();
super.D();
this.n = this.o;
this.o = 0.0F;
this.i(this.locX - d0, this.locY - d1, this.locZ - d2);
@ -167,7 +167,7 @@ public abstract class EntityHuman extends EntityLiving {
this.q = 0;
}
this.Z = (float) this.q / 8.0F;
this.aa = (float) this.q / 8.0F;
}
public void u() {
@ -195,7 +195,7 @@ public abstract class EntityHuman extends EntityLiving {
}
this.o += (f - this.o) * 0.4F;
this.ai += (f1 - this.ai) * 0.8F;
this.aj += (f1 - this.aj) * 0.8F;
if (this.health > 0) {
List list = this.world.b((Entity) this, this.boundingBox.b(1.0D, 0.0D, 1.0D));
@ -226,8 +226,8 @@ public abstract class EntityHuman extends EntityLiving {
this.inventory.h();
if (entity != null) {
this.motX = (double) (-MathHelper.cos((this.ae + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
this.motZ = (double) (-MathHelper.sin((this.ae + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
this.motX = (double) (-MathHelper.cos((this.af + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
this.motZ = (double) (-MathHelper.sin((this.af + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
} else {
this.motX = this.motZ = 0.0D;
}
@ -245,7 +245,7 @@ public abstract class EntityHuman extends EntityLiving {
}
}
public void C() {
public void E() {
this.a(this.inventory.a(this.inventory.itemInHandIndex, 1), false);
}
@ -334,12 +334,12 @@ public abstract class EntityHuman extends EntityLiving {
this.sleeping = nbttagcompound.m("Sleeping");
this.sleepTicks = nbttagcompound.d("SleepTimer");
if (this.sleeping) {
this.a = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
this.A = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
this.a(true, true, false);
}
if (nbttagcompound.hasKey("SpawnX") && nbttagcompound.hasKey("SpawnY") && nbttagcompound.hasKey("SpawnZ")) {
this.c = new ChunkCoordinates(nbttagcompound.e("SpawnX"), nbttagcompound.e("SpawnY"), nbttagcompound.e("SpawnZ"));
this.b = new ChunkCoordinates(nbttagcompound.e("SpawnX"), nbttagcompound.e("SpawnY"), nbttagcompound.e("SpawnZ"));
}
}
@ -349,10 +349,10 @@ public abstract class EntityHuman extends EntityLiving {
nbttagcompound.a("Dimension", this.dimension);
nbttagcompound.a("Sleeping", this.sleeping);
nbttagcompound.a("SleepTimer", (short) this.sleepTicks);
if (this.c != null) {
nbttagcompound.a("SpawnX", this.c.x);
nbttagcompound.a("SpawnY", this.c.y);
nbttagcompound.a("SpawnZ", this.c.z);
if (this.b != null) {
nbttagcompound.a("SpawnX", this.b.x);
nbttagcompound.a("SpawnY", this.b.y);
nbttagcompound.a("SpawnZ", this.b.z);
}
}
@ -371,7 +371,7 @@ public abstract class EntityHuman extends EntityLiving {
}
public boolean damageEntity(Entity entity, int i) {
this.ax = 0;
this.ay = 0;
if (this.health <= 0) {
return false;
} else {
@ -437,7 +437,7 @@ public abstract class EntityHuman extends EntityLiving {
if (entityliving instanceof EntityWolf) {
EntityWolf entitywolf = (EntityWolf) entityliving;
if (entitywolf.m_() && this.name.equals(entitywolf.x())) {
if (entitywolf.A() && this.name.equals(entitywolf.x())) {
return;
}
}
@ -450,7 +450,7 @@ public abstract class EntityHuman extends EntityLiving {
Entity entity = (Entity) iterator.next();
EntityWolf entitywolf1 = (EntityWolf) entity;
if (entitywolf1.m_() && entitywolf1.D() == null && this.name.equals(entitywolf1.x()) && (!flag || !entitywolf1.isSitting())) {
if (entitywolf1.A() && entitywolf1.E() == null && this.name.equals(entitywolf1.x()) && (!flag || !entitywolf1.isSitting())) {
entitywolf1.setSitting(false);
entitywolf1.c(entityliving);
}
@ -461,11 +461,11 @@ public abstract class EntityHuman extends EntityLiving {
protected void c(int i) {
int j = 25 - this.inventory.g();
int k = i * j + this.e;
int k = i * j + this.d;
this.inventory.c(i);
i = k / 25;
this.e = k % 25;
this.d = k % 25;
super.c(i);
}
@ -477,27 +477,27 @@ public abstract class EntityHuman extends EntityLiving {
public void c(Entity entity) {
if (!entity.a(this)) {
ItemStack itemstack = this.D();
ItemStack itemstack = this.F();
if (itemstack != null && entity instanceof EntityLiving) {
itemstack.a((EntityLiving) entity);
if (itemstack.count <= 0) {
itemstack.a(this);
this.E();
this.G();
}
}
}
}
public ItemStack D() {
public ItemStack F() {
return this.inventory.getItemInHand();
}
public void E() {
public void G() {
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
}
public double F() {
public double H() {
return (double) (this.height - 0.5F);
}
@ -533,18 +533,18 @@ public abstract class EntityHuman extends EntityLiving {
// CraftBukkit end
entity.damageEntity(this, i);
ItemStack itemstack = this.D();
ItemStack itemstack = this.F();
if (itemstack != null && entity instanceof EntityLiving) {
itemstack.a((EntityLiving) entity, this);
if (itemstack.count <= 0) {
itemstack.a(this);
this.E();
this.G();
}
}
if (entity instanceof EntityLiving) {
if (entity.Q()) {
if (entity.S()) {
this.a((EntityLiving) entity, true);
}
@ -563,12 +563,12 @@ public abstract class EntityHuman extends EntityLiving {
}
}
public boolean H() {
return !this.sleeping && super.H();
public boolean J() {
return !this.sleeping && super.J();
}
public EnumBedError a(int i, int j, int k) {
if (!this.isSleeping() && this.Q()) {
if (!this.isSleeping() && this.S()) {
if (this.world.worldProvider.c) {
return EnumBedError.NOT_POSSIBLE_HERE;
} else if (this.world.d()) {
@ -621,7 +621,7 @@ public abstract class EntityHuman extends EntityLiving {
this.sleeping = true;
this.sleepTicks = 0;
this.a = new ChunkCoordinates(i, j, k);
this.A = new ChunkCoordinates(i, j, k);
this.motX = this.motZ = this.motY = 0.0D;
if (!this.world.isStatic) {
this.world.everyoneSleeping();
@ -637,31 +637,31 @@ public abstract class EntityHuman extends EntityLiving {
}
private void e(int i) {
this.A = 0.0F;
this.B = 0.0F;
this.C = 0.0F;
switch (i) {
case 0:
this.B = -1.8F;
this.C = -1.8F;
break;
case 1:
this.A = 1.8F;
break;
case 2:
this.B = 1.8F;
break;
case 2:
this.C = 1.8F;
break;
case 3:
this.A = -1.8F;
this.B = -1.8F;
}
}
public void a(boolean flag, boolean flag1, boolean flag2) {
this.b(0.6F, 1.8F);
this.j_();
ChunkCoordinates chunkcoordinates = this.a;
ChunkCoordinates chunkcoordinates1 = this.a;
ChunkCoordinates chunkcoordinates = this.A;
ChunkCoordinates chunkcoordinates1 = this.A;
if (chunkcoordinates != null && this.world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) {
BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
@ -702,12 +702,12 @@ public abstract class EntityHuman extends EntityLiving {
}
if (flag2) {
this.a(this.a);
this.a(this.A);
}
}
private boolean o() {
return this.world.getTypeId(this.a.x, this.a.y, this.a.z) == Block.BED.id;
return this.world.getTypeId(this.A.x, this.A.y, this.A.z) == Block.BED.id;
}
public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates) {
@ -736,15 +736,15 @@ public abstract class EntityHuman extends EntityLiving {
public void a(String s) {}
public ChunkCoordinates K() {
return this.c;
public ChunkCoordinates M() {
return this.b;
}
public void a(ChunkCoordinates chunkcoordinates) {
if (chunkcoordinates != null) {
this.c = new ChunkCoordinates(chunkcoordinates);
this.b = new ChunkCoordinates(chunkcoordinates);
} else {
this.c = null;
this.b = null;
}
}
@ -754,8 +754,8 @@ public abstract class EntityHuman extends EntityLiving {
public void a(Statistic statistic, int i) {}
protected void L() {
super.L();
protected void N() {
super.N();
this.a(StatisticList.u, 1);
}
@ -777,7 +777,7 @@ public abstract class EntityHuman extends EntityLiving {
if (i > 0) {
this.a(StatisticList.q, i);
}
} else if (this.aa()) {
} else if (this.ac()) {
i = Math.round(MathHelper.a(d0 * d0 + d2 * d2) * 100.0F);
if (i > 0) {
this.a(StatisticList.m, i);
@ -807,9 +807,9 @@ public abstract class EntityHuman extends EntityLiving {
if (i > 0) {
if (this.vehicle instanceof EntityMinecart) {
this.a(StatisticList.r, i);
if (this.d == null) {
this.d = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
} else if (this.d.a(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) >= 1000.0D) {
if (this.c == null) {
this.c = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
} else if (this.c.a(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) >= 1000.0D) {
this.a(AchievementList.q, 1);
}
} else if (this.vehicle instanceof EntityBoat) {
@ -835,11 +835,11 @@ public abstract class EntityHuman extends EntityLiving {
}
}
public void M() {
if (this.C > 0) {
this.C = 10;
public void O() {
if (this.D > 0) {
this.D = 10;
} else {
this.D = true;
this.E = true;
}
}
}

View File

@ -38,8 +38,8 @@ public class EntityItem extends Entity {
protected void b() {}
public void p_() {
super.p_();
public void o_() {
super.o_();
if (this.pickupDelay > 0) {
--this.pickupDelay;
}
@ -55,7 +55,7 @@ public class EntityItem extends Entity {
this.world.makeSound(this, "random.fizz", 0.4F, 2.0F + this.random.nextFloat() * 0.4F);
}
this.g(this.locX, this.locY, this.locZ);
this.g(this.locX, (this.boundingBox.b + this.boundingBox.e) / 2.0D, this.locZ);
this.move(this.motX, this.motY, this.motZ);
float f = 0.98F;
@ -91,7 +91,7 @@ public class EntityItem extends Entity {
}
public boolean damageEntity(Entity entity, int i) {
this.ac();
this.ae();
this.f -= i;
if (this.f <= 0) {
this.die();

View File

@ -18,67 +18,67 @@ import org.bukkit.event.entity.EntityDeathEvent;
public abstract class EntityLiving extends Entity {
public int maxNoDamageTicks = 20;
public float H;
public float I;
public float J = 0.0F;
public float J;
public float K = 0.0F;
protected float L;
public float L = 0.0F;
protected float M;
protected float N;
protected float O;
protected boolean P = true;
protected float P;
protected boolean Q = true;
protected String texture = "/mob/char.png";
protected boolean R = true;
protected float S = 0.0F;
protected String T = null;
protected float U = 1.0F;
protected int V = 0;
protected float W = 0.0F;
public boolean X = false;
public float Y;
protected boolean S = true;
protected float T = 0.0F;
protected String U = null;
protected float V = 1.0F;
protected int W = 0;
protected float X = 0.0F;
public boolean Y = false;
public float Z;
public float aa;
public int health = 10;
public int ab;
public int ac;
private int a;
public int hurtTicks;
public int ad;
public float ae = 0.0F;
public int ae;
public float af = 0.0F;
public int deathTicks = 0;
public int attackTicks = 0;
public float ah;
public float ai;
protected boolean aj = false;
public int ak = -1;
public float al = (float) (Math.random() * 0.8999999761581421D + 0.10000000149011612D);
public float am;
public float aj;
protected boolean ak = false;
public int al = -1;
public float am = (float) (Math.random() * 0.8999999761581421D + 0.10000000149011612D);
public float an;
public float ao;
protected int ap;
protected double aq;
public float ap;
protected int aq;
protected double ar;
protected double as;
protected double at;
protected double au;
float av = 0.0F;
protected double av;
float aw = 0.0F;
public int lastDamage = 0; // CraftBukkit - protected -> public
protected int ax = 0;
protected float ay;
protected int ay = 0;
protected float az;
protected float aA;
protected boolean aB = false;
protected float aC = 0.0F;
protected float aD = 0.7F;
protected float aB;
protected boolean aC = false;
protected float aD = 0.0F;
protected float aE = 0.7F;
private Entity b;
protected int aE = 0;
protected int aF = 0;
public EntityLiving(World world) {
super(world);
this.aH = true;
this.I = (float) (Math.random() + 1.0D) * 0.01F;
this.aI = true;
this.J = (float) (Math.random() + 1.0D) * 0.01F;
this.setPosition(this.locX, this.locY, this.locZ);
this.H = (float) Math.random() * 12398.0F;
this.I = (float) Math.random() * 12398.0F;
this.yaw = (float) (Math.random() * 3.1415927410125732D * 2.0D);
this.br = 0.5F;
this.bs = 0.5F;
}
protected void b() {}
@ -87,7 +87,7 @@ public abstract class EntityLiving extends Entity {
return this.world.a(Vec3D.create(this.locX, this.locY + (double) this.s(), this.locZ), Vec3D.create(entity.locX, entity.locY + (double) entity.s(), entity.locZ)) == null;
}
public boolean o_() {
public boolean n_() {
return !this.dead;
}
@ -103,7 +103,7 @@ public abstract class EntityLiving extends Entity {
return 80;
}
public void N() {
public void P() {
String s = this.g();
if (s != null) {
@ -111,15 +111,15 @@ public abstract class EntityLiving extends Entity {
}
}
public void O() {
this.Y = this.Z;
super.O();
public void Q() {
this.Z = this.aa;
super.Q();
if (this.random.nextInt(1000) < this.a++) {
this.a = -this.e();
this.N();
this.P();
}
if (this.Q() && this.H()) {
if (this.S() && this.J()) {
// CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer();
org.bukkit.entity.Entity victim = this.getBukkitEntity();
@ -135,13 +135,13 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit end
}
if (this.bC || this.world.isStatic) {
if (this.bD || this.world.isStatic) {
this.fireTicks = 0;
}
int i;
if (this.Q() && this.a(Material.WATER) && !this.b_()) {
if (this.S() && this.a(Material.WATER) && !this.b_()) {
--this.airTicks;
if (this.airTicks == -20) {
this.airTicks = 0;
@ -174,7 +174,7 @@ public abstract class EntityLiving extends Entity {
this.airTicks = this.maxAirTicks;
}
this.ah = this.ai;
this.ai = this.aj;
if (this.attackTicks > 0) {
--this.attackTicks;
}
@ -190,7 +190,7 @@ public abstract class EntityLiving extends Entity {
if (this.health <= 0) {
++this.deathTicks;
if (this.deathTicks > 20) {
this.U();
this.W();
this.die();
for (i = 0; i < 20; ++i) {
@ -203,13 +203,13 @@ public abstract class EntityLiving extends Entity {
}
}
this.O = this.N;
this.K = this.J;
this.P = this.O;
this.L = this.K;
this.lastYaw = this.yaw;
this.lastPitch = this.pitch;
}
public void P() {
public void R() {
for (int i = 0; i < 20; ++i) {
double d0 = this.random.nextGaussian() * 0.02D;
double d1 = this.random.nextGaussian() * 0.02D;
@ -220,22 +220,22 @@ public abstract class EntityLiving extends Entity {
}
}
public void B() {
super.B();
this.L = this.M;
this.M = 0.0F;
public void D() {
super.D();
this.M = this.N;
this.N = 0.0F;
}
public void p_() {
super.p_();
public void o_() {
super.o_();
this.u();
double d0 = this.locX - this.lastX;
double d1 = this.locZ - this.lastZ;
float f = MathHelper.a(d0 * d0 + d1 * d1);
float f1 = this.J;
float f1 = this.K;
float f2 = 0.0F;
this.L = this.M;
this.M = this.N;
float f3 = 0.0F;
if (f > 0.05F) {
@ -245,7 +245,7 @@ public abstract class EntityLiving extends Entity {
f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F;
}
if (this.Z > 0.0F) {
if (this.aa > 0.0F) {
f1 = this.yaw;
}
@ -253,11 +253,11 @@ public abstract class EntityLiving extends Entity {
f3 = 0.0F;
}
this.M += (f3 - this.M) * 0.3F;
this.N += (f3 - this.N) * 0.3F;
float f4;
for (f4 = f1 - this.J; f4 < -180.0F; f4 += 360.0F) {
for (f4 = f1 - this.K; f4 < -180.0F; f4 += 360.0F) {
;
}
@ -265,11 +265,11 @@ public abstract class EntityLiving extends Entity {
f4 -= 360.0F;
}
this.J += f4 * 0.3F;
this.K += f4 * 0.3F;
float f5;
for (f5 = this.yaw - this.J; f5 < -180.0F; f5 += 360.0F) {
for (f5 = this.yaw - this.K; f5 < -180.0F; f5 += 360.0F) {
;
}
@ -287,9 +287,9 @@ public abstract class EntityLiving extends Entity {
f5 = 75.0F;
}
this.J = this.yaw - f5;
this.K = this.yaw - f5;
if (f5 * f5 > 2500.0F) {
this.J += f5 * 0.2F;
this.K += f5 * 0.2F;
}
if (flag) {
@ -304,12 +304,12 @@ public abstract class EntityLiving extends Entity {
this.lastYaw += 360.0F;
}
while (this.J - this.K < -180.0F) {
this.K -= 360.0F;
while (this.K - this.L < -180.0F) {
this.L -= 360.0F;
}
while (this.J - this.K >= 180.0F) {
this.K += 360.0F;
while (this.K - this.L >= 180.0F) {
this.L += 360.0F;
}
while (this.pitch - this.lastPitch < -180.0F) {
@ -320,7 +320,7 @@ public abstract class EntityLiving extends Entity {
this.lastPitch += 360.0F;
}
this.N += f2;
this.O += f2;
}
protected void b(float f, float f1) {
@ -342,11 +342,11 @@ public abstract class EntityLiving extends Entity {
if (this.world.isStatic) {
return false;
} else {
this.ax = 0;
this.ay = 0;
if (this.health <= 0) {
return false;
} else {
this.an = 1.5F;
this.ao = 1.5F;
boolean flag = true;
if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) {
@ -359,16 +359,16 @@ public abstract class EntityLiving extends Entity {
flag = false;
} else {
this.lastDamage = i;
this.ab = this.health;
this.ac = this.health;
this.noDamageTicks = this.maxNoDamageTicks;
this.c(i);
this.hurtTicks = this.ad = 10;
this.hurtTicks = this.ae = 10;
}
this.ae = 0.0F;
this.af = 0.0F;
if (flag) {
this.world.a(this, (byte) 2);
this.ac();
this.ae();
if (entity != null) {
double d0 = entity.locX - this.locX;
@ -378,10 +378,10 @@ public abstract class EntityLiving extends Entity {
d0 = (Math.random() - Math.random()) * 0.01D;
}
this.ae = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - this.yaw;
this.af = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - this.yaw;
this.a(entity, i, d0, d1);
} else {
this.ae = (float) ((int) (Math.random() * 2.0D) * 180);
this.af = (float) ((int) (Math.random() * 2.0D) * 180);
}
}
@ -436,15 +436,15 @@ public abstract class EntityLiving extends Entity {
}
public void a(Entity entity) {
if (this.V >= 0 && entity != null) {
entity.c(this, this.V);
if (this.W >= 0 && entity != null) {
entity.c(this, this.W);
}
if (entity != null) {
entity.a(this);
}
this.aj = true;
this.ak = true;
if (!this.world.isStatic) {
this.r();
}
@ -510,7 +510,7 @@ public abstract class EntityLiving extends Entity {
public void a(float f, float f1) {
double d0;
if (this.aa()) {
if (this.ac()) {
d0 = this.locY;
this.a(f, f1, 0.02F);
this.move(this.motX, this.motY, this.motZ);
@ -521,7 +521,7 @@ public abstract class EntityLiving extends Entity {
if (this.positionChanged && this.b(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) {
this.motY = 0.30000001192092896D;
}
} else if (this.ab()) {
} else if (this.ad()) {
d0 = this.locY;
this.a(f, f1, 0.02F);
this.move(this.motX, this.motY, this.motZ);
@ -597,7 +597,7 @@ public abstract class EntityLiving extends Entity {
this.motZ *= (double) f2;
}
this.am = this.an;
this.an = this.ao;
d0 = this.locX - this.lastX;
double d1 = this.locZ - this.lastZ;
float f5 = MathHelper.a(d0 * d0 + d1 * d1) * 4.0F;
@ -606,8 +606,8 @@ public abstract class EntityLiving extends Entity {
f5 = 1.0F;
}
this.an += (f5 - this.an) * 0.4F;
this.ao += this.an;
this.ao += (f5 - this.ao) * 0.4F;
this.ap += this.ao;
}
public boolean p() {
@ -636,7 +636,7 @@ public abstract class EntityLiving extends Entity {
this.attackTicks = nbttagcompound.d("AttackTime");
}
public boolean Q() {
public boolean S() {
return !this.dead && this.health > 0;
}
@ -645,14 +645,14 @@ public abstract class EntityLiving extends Entity {
}
public void u() {
if (this.ap > 0) {
double d0 = this.locX + (this.aq - this.locX) / (double) this.ap;
double d1 = this.locY + (this.ar - this.locY) / (double) this.ap;
double d2 = this.locZ + (this.as - this.locZ) / (double) this.ap;
if (this.aq > 0) {
double d0 = this.locX + (this.ar - this.locX) / (double) this.aq;
double d1 = this.locY + (this.as - this.locY) / (double) this.aq;
double d2 = this.locZ + (this.at - this.locZ) / (double) this.aq;
double d3;
for (d3 = this.at - (double) this.yaw; d3 < -180.0D; d3 += 360.0D) {
for (d3 = this.au - (double) this.yaw; d3 < -180.0D; d3 += 360.0D) {
;
}
@ -660,44 +660,60 @@ public abstract class EntityLiving extends Entity {
d3 -= 360.0D;
}
this.yaw = (float) ((double) this.yaw + d3 / (double) this.ap);
this.pitch = (float) ((double) this.pitch + (this.au - (double) this.pitch) / (double) this.ap);
--this.ap;
this.yaw = (float) ((double) this.yaw + d3 / (double) this.aq);
this.pitch = (float) ((double) this.pitch + (this.av - (double) this.pitch) / (double) this.aq);
--this.aq;
this.setPosition(d0, d1, d2);
this.c(this.yaw, this.pitch);
List list = this.world.getEntities(this, this.boundingBox.shrink(0.03125D, 0.0D, 0.03125D));
if (list.size() > 0) {
double d4 = 0.0D;
for (int i = 0; i < list.size(); ++i) {
AxisAlignedBB axisalignedbb = (AxisAlignedBB) list.get(i);
if (axisalignedbb.e > d4) {
d4 = axisalignedbb.e;
}
}
d1 += d4 - this.boundingBox.b;
this.setPosition(d0, d1, d2);
}
}
if (this.A()) {
this.aB = false;
this.ay = 0.0F;
if (this.C()) {
this.aC = false;
this.az = 0.0F;
this.aA = 0.0F;
} else if (!this.X) {
this.aB = 0.0F;
} else if (!this.Y) {
this.c_();
}
boolean flag = this.aa();
boolean flag1 = this.ab();
boolean flag = this.ac();
boolean flag1 = this.ad();
if (this.aB) {
if (this.aC) {
if (flag) {
this.motY += 0.03999999910593033D;
} else if (flag1) {
this.motY += 0.03999999910593033D;
} else if (this.onGround) {
this.L();
this.N();
}
}
this.ay *= 0.98F;
this.az *= 0.98F;
this.aA *= 0.9F;
this.a(this.ay, this.az);
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
this.aA *= 0.98F;
this.aB *= 0.9F;
this.a(this.az, this.aA);
List list1 = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
if (list1 != null && list1.size() > 0) {
for (int j = 0; j < list1.size(); ++j) {
Entity entity = (Entity) list1.get(j);
if (entity.d_()) {
entity.collide(this);
@ -706,11 +722,11 @@ public abstract class EntityLiving extends Entity {
}
}
protected boolean A() {
protected boolean C() {
return this.health <= 0;
}
protected void L() {
protected void N() {
this.motY = 0.41999998688697815D;
}
@ -718,7 +734,7 @@ public abstract class EntityLiving extends Entity {
return true;
}
protected void R() {
protected void T() {
EntityHuman entityhuman = this.world.a(this, -1.0D);
if (this.l_() && entityhuman != null) {
@ -731,9 +747,9 @@ public abstract class EntityLiving extends Entity {
this.die();
}
if (this.ax > 600 && this.random.nextInt(800) == 0) {
if (this.ay > 600 && this.random.nextInt(800) == 0) {
if (d3 < 1024.0D) {
this.ax = 0;
this.ay = 0;
} else {
this.die();
}
@ -742,43 +758,43 @@ public abstract class EntityLiving extends Entity {
}
protected void c_() {
++this.ax;
++this.ay;
EntityHuman entityhuman = this.world.a(this, -1.0D);
this.R();
this.ay = 0.0F;
this.T();
this.az = 0.0F;
this.aA = 0.0F;
float f = 8.0F;
if (this.random.nextFloat() < 0.02F) {
entityhuman = this.world.a(this, (double) f);
if (entityhuman != null) {
this.b = entityhuman;
this.aE = 10 + this.random.nextInt(20);
this.aF = 10 + this.random.nextInt(20);
} else {
this.aA = (this.random.nextFloat() - 0.5F) * 20.0F;
this.aB = (this.random.nextFloat() - 0.5F) * 20.0F;
}
}
if (this.b != null) {
this.a(this.b, 10.0F, (float) this.v());
if (this.aE-- <= 0 || this.b.dead || this.b.g(this) > (double) (f * f)) {
if (this.aF-- <= 0 || this.b.dead || this.b.g(this) > (double) (f * f)) {
this.b = null;
}
} else {
if (this.random.nextFloat() < 0.05F) {
this.aA = (this.random.nextFloat() - 0.5F) * 20.0F;
this.aB = (this.random.nextFloat() - 0.5F) * 20.0F;
}
this.yaw += this.aA;
this.pitch = this.aC;
this.yaw += this.aB;
this.pitch = this.aD;
}
boolean flag = this.aa();
boolean flag1 = this.ab();
boolean flag = this.ac();
boolean flag1 = this.ad();
if (flag || flag1) {
this.aB = this.random.nextFloat() < 0.8F;
this.aC = this.random.nextFloat() < 0.8F;
}
}
@ -807,11 +823,11 @@ public abstract class EntityLiving extends Entity {
this.yaw = this.b(this.yaw, f2, f);
}
public boolean S() {
public boolean U() {
return this.b != null;
}
public Entity T() {
public Entity V() {
return this.b;
}
@ -837,13 +853,13 @@ public abstract class EntityLiving extends Entity {
return f + f3;
}
public void U() {}
public void W() {}
public boolean d() {
return this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
}
protected void V() {
protected void X() {
// CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer();
DamageCause damageType = EntityDamageEvent.DamageCause.VOID;
@ -862,7 +878,7 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit end
}
public Vec3D W() {
public Vec3D Y() {
return this.b(1.0F);
}

View File

@ -51,7 +51,7 @@ public class EntityMinecart extends Entity implements IInventory {
this.b = 0;
this.c = 1;
this.i = false;
this.aH = true;
this.aI = true;
this.b(0.98F, 0.7F);
this.height = this.width / 2.0F;
}
@ -117,7 +117,7 @@ public class EntityMinecart extends Entity implements IInventory {
this.c = -this.c;
this.b = 10;
this.ac();
this.ae();
this.damage += i * 10;
if (this.damage > 40) {
if (this.passenger != null) {
@ -178,7 +178,7 @@ public class EntityMinecart extends Entity implements IInventory {
}
}
public boolean o_() {
public boolean n_() {
return !this.dead;
}
@ -213,7 +213,7 @@ public class EntityMinecart extends Entity implements IInventory {
super.die();
}
public void p_() {
public void o_() {
// CraftBukkit start
double prevX = this.locX;
double prevY = this.locY;
@ -741,7 +741,7 @@ public class EntityMinecart extends Entity implements IInventory {
double d2 = d0 * d0 + d1 * d1;
// CraftBukkit - Collision
if (d2 >= 9.9999997473787516E-005D && !collisionEvent.isCollisionCancelled()) {
if (d2 >= 9.999999747378752E-5D && !collisionEvent.isCollisionCancelled()) {
d2 = (double) MathHelper.a(d2);
d0 /= d2;
d1 /= d2;
@ -755,8 +755,8 @@ public class EntityMinecart extends Entity implements IInventory {
d1 *= d3;
d0 *= 0.10000000149011612D;
d1 *= 0.10000000149011612D;
d0 *= (double) (1.0F - this.bt);
d1 *= (double) (1.0F - this.bt);
d0 *= (double) (1.0F - this.bu);
d1 *= (double) (1.0F - this.bu);
d0 *= 0.5D;
d1 *= 0.5D;
if (entity instanceof EntityMinecart) {

View File

@ -24,14 +24,14 @@ public class EntityMonster extends EntityCreature implements IMonster {
float f = this.c(1.0F);
if (f > 0.5F) {
this.ax += 2;
this.ay += 2;
}
super.u();
}
public void p_() {
super.p_();
public void o_() {
super.o_();
if (!this.world.isStatic && this.world.spawnMonsters == 0) {
this.die();
}

View File

@ -119,7 +119,7 @@ public class EntityPainting extends Entity {
return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F);
}
public void p_() {
public void o_() {
if (this.f++ == 100 && !this.world.isStatic) {
this.f = 0;
if (!this.h()) {
@ -197,7 +197,7 @@ public class EntityPainting extends Entity {
}
}
public boolean o_() {
public boolean n_() {
return true;
}
@ -214,7 +214,7 @@ public class EntityPainting extends Entity {
// CraftBukkit end
this.die();
this.ac();
this.ae();
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
}

View File

@ -18,18 +18,18 @@ public class EntityPigZombie extends EntityZombie {
public EntityPigZombie(World world) {
super(world);
this.texture = "/mob/pigzombie.png";
this.aD = 0.5F;
this.aE = 0.5F;
this.damage = 5;
this.bC = true;
this.bD = true;
}
public void p_() {
this.aD = this.target != null ? 0.95F : 0.5F;
public void o_() {
this.aE = this.target != null ? 0.95F : 0.5F;
if (this.soundDelay > 0 && --this.soundDelay == 0) {
this.world.makeSound(this, "mob.zombiepig.zpigangry", this.k() * 2.0F, ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 1.8F);
}
super.p_();
super.o_();
}
public boolean d() {

View File

@ -25,10 +25,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public double e;
public List f = new LinkedList();
public Set g = new HashSet();
private int bJ = -99999999;
private int bK = 60;
private ItemStack[] bL = new ItemStack[] { null, null, null, null, null};
private int bM = 0;
private int bK = -99999999;
private int bL = 60;
private ItemStack[] bM = new ItemStack[] { null, null, null, null, null};
private int bN = 0;
public boolean h;
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, ItemInWorldManager iteminworldmanager) {
@ -48,7 +48,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.setPositionRotation((double) i + 0.5D, (double) k, (double) j + 0.5D, 0.0F, 0.0F);
this.b = minecraftserver;
this.br = 0.0F;
this.bs = 0.0F;
this.name = s;
this.height = 0.0F;
@ -71,7 +71,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public ItemStack[] getEquipment() {
return this.bL;
return this.bM;
}
protected void j_() {
@ -82,17 +82,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return 1.62F;
}
public void p_() {
public void o_() {
this.itemInWorldManager.a();
--this.bK;
--this.bL;
this.activeContainer.a();
for (int i = 0; i < 5; ++i) {
ItemStack itemstack = this.b_(i);
if (itemstack != this.bL[i]) {
if (itemstack != this.bM[i]) {
this.b.b(this.dimension).a(this, new Packet5EntityEquipment(this.id, i, itemstack));
this.bL[i] = itemstack;
this.bM[i] = itemstack;
}
}
}
@ -142,7 +142,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public boolean damageEntity(Entity entity, int i) {
if (this.bK > 0) {
if (this.bL > 0) {
return false;
} else {
if (!this.b.pvpMode) {
@ -171,8 +171,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
super.b(i);
}
public void a(boolean flag) {
super.p_();
// CraftBukkit return EntityPlayer
public EntityPlayer a(boolean flag) {
super.o_();
for (int i = 0; i < this.inventory.getSize(); ++i) {
ItemStack itemstack = this.inventory.getItem(i);
@ -210,39 +211,43 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
}
if (this.D) {
EntityPlayer player = this; // CraftBukkit
if (this.E) {
if (this.b.propertyManager.getBoolean("allow-nether", true)) {
if (this.vehicle != null) {
this.mount(this.vehicle);
} else {
this.E += 0.0125F;
if (this.E >= 1.0F) {
this.E = 1.0F;
this.C = 10;
this.b.serverConfigurationManager.f(this);
this.F += 0.0125F;
if (this.F >= 1.0F) {
this.F = 1.0F;
this.D = 10;
player = this.b.serverConfigurationManager.f(this); // CraftBukkit
}
}
this.D = false;
player.E = false; // CraftBukkit
}
} else {
if (this.E > 0.0F) {
this.E -= 0.05F;
if (this.F > 0.0F) {
this.F -= 0.05F;
}
if (this.E < 0.0F) {
this.E = 0.0F;
if (this.F < 0.0F) {
this.F = 0.0F;
}
}
if (this.C > 0) {
--this.C;
// CraftBukkit start
if (player.D > 0) {
--player.D;
}
if (this.health != this.bJ) {
this.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health));
this.bJ = this.health;
if (player.health != player.bK) {
player.netServerHandler.sendPacket(new Packet8UpdateHealth(this.health));
player.bK = player.health;
}
return player;
// CraftBukkit end
}
private void a(TileEntity tileentity) {
@ -294,7 +299,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (enumbederror == EnumBedError.OK) {
EntityTracker entitytracker = this.b.b(this.dimension);
entitytracker.a(this, new Packet17(this, 0, i, j, k));
// CraftBukkit - this is not the original method called
entitytracker.b(this, new Packet17(this, 0, i, j, k));
}
return enumbederror;
@ -308,7 +314,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
super.a(flag, flag1, flag2);
this.netServerHandler.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
if (this.netServerHandler != null) {
this.netServerHandler.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
}
}
public void mount(Entity entity) {
@ -333,39 +341,39 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
super.a(d0, flag);
}
private void af() {
this.bM = this.bM % 100 + 1;
private void ah() {
this.bN = this.bN % 100 + 1;
}
public void b(int i, int j, int k) {
this.af();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 1, "Crafting", 9));
this.ah();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 1, "Crafting", 9));
this.activeContainer = new ContainerWorkbench(this.inventory, this.world, i, j, k);
this.activeContainer.f = this.bM;
this.activeContainer.f = this.bN;
this.activeContainer.a((ICrafting) this);
}
public void a(IInventory iinventory) {
this.af();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 0, iinventory.getName(), iinventory.getSize()));
this.ah();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 0, iinventory.getName(), iinventory.getSize()));
this.activeContainer = new ContainerChest(this.inventory, iinventory);
this.activeContainer.f = this.bM;
this.activeContainer.f = this.bN;
this.activeContainer.a((ICrafting) this);
}
public void a(TileEntityFurnace tileentityfurnace) {
this.af();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 2, tileentityfurnace.getName(), tileentityfurnace.getSize()));
this.ah();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 2, tileentityfurnace.getName(), tileentityfurnace.getSize()));
this.activeContainer = new ContainerFurnace(this.inventory, tileentityfurnace);
this.activeContainer.f = this.bM;
this.activeContainer.f = this.bN;
this.activeContainer.a((ICrafting) this);
}
public void a(TileEntityDispenser tileentitydispenser) {
this.af();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bM, 3, tileentitydispenser.getName(), tileentitydispenser.getSize()));
this.ah();
this.netServerHandler.sendPacket(new Packet100OpenWindow(this.bN, 3, tileentitydispenser.getName(), tileentitydispenser.getSize()));
this.activeContainer = new ContainerDispenser(this.inventory, tileentitydispenser);
this.activeContainer.f = this.bM;
this.activeContainer.f = this.bN;
this.activeContainer.a((ICrafting) this);
}
@ -409,9 +417,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public void a(float f, float f1, boolean flag, boolean flag1, float f2, float f3) {
this.ay = f;
this.az = f1;
this.aB = flag;
this.az = f;
this.aA = f1;
this.aC = flag;
this.setSneak(flag1);
this.pitch = f2;
this.yaw = f3;
@ -430,6 +438,31 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
}
public void A() {
if (this.vehicle != null) {
this.mount(this.vehicle);
}
if (this.passenger != null) {
this.passenger.mount(this);
}
if (this.sleeping) {
this.a(true, false, false);
}
}
public void B() {
this.bK = -99999999;
}
public void a(String s) {
StatisticStorage statisticstorage = StatisticStorage.a();
String s1 = statisticstorage.a(s);
this.netServerHandler.sendPacket(new Packet3Chat(s1));
}
// CraftBukkit start
@Override
public String toString() {

View File

@ -76,11 +76,11 @@ public class EntitySnowball extends Entity {
this.h = 0;
}
public void p_() {
this.bn = this.locX;
this.bo = this.locY;
this.bp = this.locZ;
super.p_();
public void o_() {
this.bo = this.locX;
this.bp = this.locY;
this.bq = this.locZ;
super.o_();
if (this.a > 0) {
--this.a;
}
@ -125,7 +125,7 @@ public class EntitySnowball extends Entity {
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
if (entity1.o_() && (entity1 != this.shooter || this.i >= 5)) {
if (entity1.n_() && (entity1 != this.shooter || this.i >= 5)) {
float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -213,7 +213,7 @@ public class EntitySnowball extends Entity {
float f2 = 0.99F;
float f3 = 0.03F;
if (this.aa()) {
if (this.ac()) {
for (int l = 0; l < 4; ++l) {
float f4 = 0.25F;

View File

@ -13,7 +13,7 @@ public class EntitySpider extends EntityMonster {
super(world);
this.texture = "/mob/spider.png";
this.b(1.4F, 0.9F);
this.aD = 0.8F;
this.aE = 0.8F;
}
public double m() {

View File

@ -13,7 +13,7 @@ public class EntityTNTPrimed extends Entity {
public EntityTNTPrimed(World world) {
super(world);
this.a = 0;
this.aH = true;
this.aI = true;
this.b(0.98F, 0.98F);
this.height = this.width / 2.0F;
}
@ -38,11 +38,11 @@ public class EntityTNTPrimed extends Entity {
return false;
}
public boolean o_() {
public boolean n_() {
return !this.dead;
}
public void p_() {
public void o_() {
this.lastX = this.locX;
this.lastY = this.locY;
this.lastZ = this.locZ;
@ -63,6 +63,8 @@ public class EntityTNTPrimed extends Entity {
this.explode();
this.die();
// CraftBukkit end
} else {
this.die();
}
} else {
this.world.a("smoke", this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);

View File

@ -108,7 +108,7 @@ public class EntityTrackerEntry {
this.a((Packet) object);
}
DataWatcher datawatcher = this.tracker.X();
DataWatcher datawatcher = this.tracker.Z();
if (datawatcher.a()) {
this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher)));

View File

@ -76,8 +76,8 @@ public class EntityWeatherStorm extends EntityWeather {
}
}
public void p_() {
super.p_();
public void o_() {
super.o_();
if (this.b == 2) {
this.world.makeSound(this.locX, this.locY, this.locZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.random.nextFloat() * 0.2F);
this.world.makeSound(this.locX, this.locY, this.locZ, "random.explode", 2.0F, 0.5F + this.random.nextFloat() * 0.2F);

View File

@ -10,7 +10,7 @@ public class EntityZombie extends EntityMonster {
public EntityZombie(World world) {
super(world);
this.texture = "/mob/zombie.png";
this.aD = 0.5F;
this.aE = 0.5F;
this.damage = 5;
}

View File

@ -126,7 +126,7 @@ public class InventoryPlayer implements IInventory {
if (itemstack.f()) {
i = this.k();
if (i >= 0) {
this.items[i] = itemstack;
this.items[i] = ItemStack.b(itemstack);
this.items[i].b = 5;
itemstack.count = 0;
return true;

View File

@ -166,13 +166,13 @@ public class ItemInWorldManager {
this.world.a(this.player, 2001, i, j, k, l + this.world.getData(i, j, k) * 256);
boolean flag = this.b(i, j, k);
ItemStack itemstack = this.player.D();
ItemStack itemstack = this.player.F();
if (itemstack != null) {
itemstack.a(l, i, j, k, this.player);
if (itemstack.count == 0) {
itemstack.a(this.player);
this.player.E();
this.player.G();
}
}

View File

@ -33,7 +33,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
public static HashMap b = new HashMap();
public NetworkListenThread networkListenThread;
public PropertyManager propertyManager;
// public WorldServer[] worldServer; // Craftbukkit - removed!
// public WorldServer[] worldServer; // CraftBukkit - removed!
public ServerConfigurationManager serverConfigurationManager;
public ConsoleCommandHandler consoleCommandHandler; // CraftBukkit - made public
private boolean isRunning = true;
@ -43,7 +43,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
public int j;
private List r = new ArrayList();
private List s = Collections.synchronizedList(new ArrayList());
// public EntityTracker[] tracker = new EntityTracker[2]; // Craftbukkit - removed!
// public EntityTracker[] tracker = new EntityTracker[2]; // CraftBukkit - removed!
public boolean onlineMode;
public boolean spawnAnimals;
public boolean pvpMode;
@ -86,7 +86,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true));
// CraftBukkit end
log.info("Starting minecraft server version Beta 1.6.4");
log.info("Starting minecraft server version Beta 1.6.5");
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
log.warning("**** NOT ENOUGH RAM!");
log.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
@ -128,7 +128,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
}
this.serverConfigurationManager = new ServerConfigurationManager(this);
// Craftbukkit - removed trackers
// CraftBukkit - removed trackers
long j = System.nanoTime();
String s1 = this.propertyManager.getString("level-name", "world");
String s2 = this.propertyManager.getString("level-seed", "");
@ -160,16 +160,16 @@ public class MinecraftServer implements Runnable, ICommandListener {
convertable.convert(s, new ConvertProgressUpdater(this));
}
// Craftbukkit start
// CraftBukkit start
for (int j = 0; j < (this.propertyManager.getBoolean("allow-nether", true) ? 2 : 1); ++j) {
WorldServer world;
int dimension = j == 0 ? 0 : -1;
if (j == 0) {
world = new WorldServer(this, new ServerNBTManager(new File("."), s, true), s, dimension, i);
world = new WorldServer(this, new ServerNBTManager(new File("."), s, true), s, dimension, i, org.bukkit.World.Environment.getEnvironment(dimension)); // CraftBukkit
} else {
String name = s + "_" + Environment.getEnvironment(dimension).toString().toLowerCase();
world = new SecondaryWorldServer(this, new ServerNBTManager(new File("."), name, true), name, dimension, i, worlds.get(0));
world = new SecondaryWorldServer(this, new ServerNBTManager(new File("."), name, true), name, dimension, i, worlds.get(0), org.bukkit.World.Environment.getEnvironment(dimension)); // CraftBukkit
}
world.tracker = new EntityTracker(this, dimension);
@ -179,38 +179,41 @@ public class MinecraftServer implements Runnable, ICommandListener {
worlds.add(world);
this.serverConfigurationManager.setPlayerFileData(worlds.toArray(new WorldServer[0]));
}
// CraftBukkit end
short short1 = 196;
long k = System.currentTimeMillis();
for (int l = 0; l < this.worlds.size(); ++l) { // Craftbukkit
for (int l = 0; l < this.worlds.size(); ++l) { // CraftBukkit
log.info("Preparing start region for level " + l);
WorldServer worldserver = this.worlds.get(l); // Craftbukkit
ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
// if (l == 0 || this.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit
WorldServer worldserver = this.worlds.get(l); // CraftBukkit
ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
for (int i1 = -short1; i1 <= short1 && this.isRunning; i1 += 16) {
for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) {
long k1 = System.currentTimeMillis();
for (int i1 = -short1; i1 <= short1 && this.isRunning; i1 += 16) {
for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) {
long k1 = System.currentTimeMillis();
if (k1 < k) {
k = k1;
}
if (k1 < k) {
k = k1;
}
if (k1 > k + 1000L) {
int l1 = (short1 * 2 + 1) * (short1 * 2 + 1);
int i2 = (i1 + short1) * (short1 * 2 + 1) + j1 + 1;
if (k1 > k + 1000L) {
int l1 = (short1 * 2 + 1) * (short1 * 2 + 1);
int i2 = (i1 + short1) * (short1 * 2 + 1) + j1 + 1;
this.a("Preparing spawn area", i2 * 100 / l1);
k = k1;
}
this.a("Preparing spawn area", i2 * 100 / l1);
k = k1;
}
worldserver.chunkProviderServer.getChunkAt(chunkcoordinates.x + i1 >> 4, chunkcoordinates.z + j1 >> 4);
worldserver.chunkProviderServer.getChunkAt(chunkcoordinates.x + i1 >> 4, chunkcoordinates.z + j1 >> 4);
while (worldserver.doLighting() && this.isRunning) {
;
while (worldserver.doLighting() && this.isRunning) {
;
}
}
}
}
// } // CraftBukkit
}
this.e();
@ -232,7 +235,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
void saveChunks() { // CraftBukkit - private -> default
log.info("Saving chunks");
// Craftbukkit start
// CraftBukkit start
for (int i = 0; i < this.worlds.size(); ++i) {
WorldServer worldserver = this.worlds.get(i);
@ -298,7 +301,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
j += l;
i = k;
if (this.worlds.get(0).everyoneDeeplySleeping()) { // Craftbukkit
if (this.worlds.get(0).everyoneDeeplySleeping()) { // CraftBukkit
this.h();
j = 0L;
} else {
@ -370,37 +373,39 @@ public class MinecraftServer implements Runnable, ICommandListener {
Vec3D.a();
++this.ticks;
for (j = 0; j < this.worlds.size(); ++j) { // Craftbukkit
WorldServer worldserver = this.worlds.get(j); // Craftbukkit
for (j = 0; j < this.worlds.size(); ++j) { // CraftBukkit
// if (j == 0 || this.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit
WorldServer worldserver = this.worlds.get(j); // CraftBukkit
if (this.ticks % 20 == 0) {
// Craftbukkit start
for (int i = 0; i < this.serverConfigurationManager.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.serverConfigurationManager.players.get(i);
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(entityplayer.world.getTime()));
if (this.ticks % 20 == 0) {
// CraftBukkit start - only send timeupdates to the people in that world
for (int i = 0; i < this.serverConfigurationManager.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.serverConfigurationManager.players.get(i);
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(entityplayer.world.getTime()));
}
}
((CraftScheduler) server.getScheduler()).mainThreadHeartbeat(this.ticks);
// CraftBukkit end
worldserver.doTick();
while (worldserver.doLighting()) {
;
}
worldserver.cleanUp();
}
((CraftScheduler) server.getScheduler()).mainThreadHeartbeat(this.ticks);
// Craftbukkit end
worldserver.doTick();
while (worldserver.doLighting()) {
;
}
worldserver.cleanUp();
}
// } // CraftBukkit
this.networkListenThread.a();
this.serverConfigurationManager.b();
// Craftbukkit start
// CraftBukkit start
for (j = 0; j < this.worlds.size(); ++j) {
this.worlds.get(j).tracker.a();
}
// Craftbukkit end
// CraftBukkit end
for (j = 0; j < this.r.size(); ++j) {
((IUpdatePlayerListBox) this.r.get(j)).a();
@ -461,19 +466,19 @@ public class MinecraftServer implements Runnable, ICommandListener {
}
public WorldServer a(int i) {
// Craftbukkit start
// CraftBukkit start
for (WorldServer world : worlds) {
if (world.dimension == i) {
return world;
}
}
return worlds.get(0);
// Craftbukkit end
// CraftBukkit end
}
public EntityTracker b(int i) {
return a(i).tracker; // Craftbukkit
return a(i).tracker; // CraftBukkit
}
public static boolean isRunning(MinecraftServer minecraftserver) {

View File

@ -89,8 +89,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
}
// Send the possibly modified leave message
s = event.getReason();
// CraftBukkit end
this.player.A();
this.sendPacket(new Packet255KickDisconnect(s));
this.networkManager.d();
//CraftBukkit start
leaveMessage = event.getLeaveMessage();
if (leaveMessage != null) {
this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(leaveMessage));
@ -214,7 +219,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
}
this.player.onGround = packet10flying.g;
this.player.a(true);
this.player = this.player.a(true); // CraftBukkit
this.player.move(d5, 0.0D, d4);
this.player.setLocation(d1, d2, d3, f, f1);
this.player.motX = d5;
@ -272,7 +277,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
}
this.player.a(true);
this.player.bq = 0.0F;
this.player.br = 0.0F;
this.player.setLocation(this.x, this.y, this.z, f2, f3);
if (!this.m) {
return;
@ -402,7 +407,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
WorldServer worldserver = this.minecraftServer.a(this.player.dimension);
if (packet14blockdig.e == 4) {
this.player.C();
this.player.E();
} else {
boolean flag = worldserver.weirdIsOpCache = worldserver.worldProvider.dimension != 0 || this.minecraftServer.serverConfigurationManager.isOp(this.player.name);
boolean flag1 = false;

View File

@ -1,6 +1,5 @@
package net.minecraft.server;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@ -34,11 +33,10 @@ public class NetworkManager {
private Object[] v;
private int w = 0;
private int x = 0;
private transient boolean y = false;
public static int[] d = new int[256];
public static int[] e = new int[256];
public int f = 0;
private int z = 50;
private int y = 50;
public NetworkManager(Socket socket, String s, NetHandler nethandler) {
this.socket = socket;
@ -51,7 +49,7 @@ public class NetworkManager {
// CraftBukkit start - cant compile these outside the try
this.input = new DataInputStream(socket.getInputStream());
this.output = new DataOutputStream(socket.getOutputStream());
this.output = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), 5120));
// CraftBukkit end
} catch (IOException socketexception) {
System.err.println(socketexception.getMessage());
@ -101,12 +99,11 @@ public class NetworkManager {
Packet.a(packet, this.output);
aint = e;
i = packet.b();
aint[i] += packet.a();
aint[i] += packet.a() + 1;
flag = true;
}
// CraftBukkit - add 'flag'
if ((!flag || this.z-- <= 0) && !this.o.isEmpty() && (this.f == 0 || System.currentTimeMillis() - ((Packet) this.o.get(0)).timestamp >= (long) this.f)) {
if (this.y-- <= 0 && !this.o.isEmpty() && (this.f == 0 || System.currentTimeMillis() - ((Packet) this.o.get(0)).timestamp >= (long) this.f)) {
object = this.g;
synchronized (this.g) {
packet = (Packet) this.o.remove(0);
@ -116,21 +113,24 @@ public class NetworkManager {
Packet.a(packet, this.output);
aint = e;
i = packet.b();
aint[i] += packet.a();
this.z = 50;
aint[i] += packet.a() + 1;
this.y = 0;
flag = true;
}
return flag;
} catch (Exception exception) {
if (!this.t) {
this.a(exception);
}
}
return flag;
return false;
}
}
public void a() {
this.y = true;
this.s.interrupt();
this.r.interrupt();
}
private boolean g() {
@ -143,19 +143,21 @@ public class NetworkManager {
int[] aint = d;
int i = packet.b();
aint[i] += packet.a();
aint[i] += packet.a() + 1;
this.m.add(packet);
flag = true;
} else {
this.a("disconnect.endOfStream", new Object[0]);
}
return flag;
} catch (Exception exception) {
if (!this.t) {
this.a(exception);
}
}
return flag;
return false;
}
}
private void a(Exception exception) {
@ -215,6 +217,7 @@ public class NetworkManager {
packet.a(this.p);
}
this.a();
if (this.t && this.m.isEmpty()) {
this.p.a(this.u, this.v);
}
@ -251,18 +254,18 @@ public class NetworkManager {
return networkmanager.f();
}
static boolean e(NetworkManager networkmanager) {
return networkmanager.y;
}
static boolean a(NetworkManager networkmanager, boolean flag) {
return networkmanager.y = flag;
}
static DataOutputStream f(NetworkManager networkmanager) {
static DataOutputStream e(NetworkManager networkmanager) {
return networkmanager.output;
}
static boolean f(NetworkManager networkmanager) {
return networkmanager.t;
}
static void a(NetworkManager networkmanager, Exception exception) {
networkmanager.a(exception);
}
static Thread g(NetworkManager networkmanager) {
return networkmanager.s;
}

View File

@ -69,11 +69,6 @@ public abstract class Packet {
int i;
try {
// CraftBukkit start - sleep while nothing to do
while(datainputstream.available() <= 0) {
Thread.sleep(10);
}
// CraftBukkit end
i = datainputstream.read();
if (i == -1) {
return null;
@ -102,10 +97,6 @@ public abstract class Packet {
System.out.println("Connection reset");
return null;
}
catch (InterruptedException exception) {
System.out.println("Thread exception");
return null;
}
// CraftBukkit end
PacketCounter packetcounter = (PacketCounter) e.get(Integer.valueOf(i));

View File

@ -0,0 +1,10 @@
package net.minecraft.server;
public class SecondaryWorldServer extends WorldServer {
// CraftBukkit start
public SecondaryWorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, long j, WorldServer worldserver, org.bukkit.World.Environment env) {
super(minecraftserver, idatamanager, s, i, j, env);
// CraftBukkit end
this.z = worldserver.z;
}
}

View File

@ -78,6 +78,12 @@ public class ServerConfigurationManager {
public void a(EntityPlayer entityplayer) {
// Craftbukkit - removed playermanagers
for(WorldServer world : this.server.worlds) {
if(world.manager.a.contains(entityplayer)) {
world.manager.removePlayer(entityplayer);
break;
}
}
this.a(entityplayer.dimension).addPlayer(entityplayer);
WorldServer worldserver = this.server.a(entityplayer.dimension);
@ -192,39 +198,51 @@ public class ServerConfigurationManager {
// CraftBukkit end
}
// CraftBukkit start
public EntityPlayer a(EntityPlayer entityplayer, int i) {
return a(entityplayer, i, true);
}
public EntityPlayer a(EntityPlayer entityplayer, int i, boolean spawn) {
this.server.b(entityplayer.dimension).trackPlayer(entityplayer);
this.server.b(entityplayer.dimension).untrackEntity(entityplayer);
this.a(entityplayer.dimension).removePlayer(entityplayer);
this.players.remove(entityplayer);
this.server.a(entityplayer.dimension).removeEntity(entityplayer);
ChunkCoordinates chunkcoordinates = entityplayer.K();
ChunkCoordinates chunkcoordinates = entityplayer.M();
entityplayer.dimension = i;
EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.a(entityplayer.dimension), entityplayer.name, new ItemInWorldManager(this.server.a(entityplayer.dimension)));
entityplayer1.id = entityplayer.id;
entityplayer1.netServerHandler = entityplayer.netServerHandler;
entityplayer1.netServerHandler.player = entityplayer1;
WorldServer worldserver = this.server.a(entityplayer.dimension);
// CraftBukkit start - transfer internal variables
entityplayer1.dimension = i;
entityplayer1.displayName = entityplayer.displayName;
entityplayer1.compassTarget = entityplayer.compassTarget;
entityplayer1.fauxSleeping = entityplayer.fauxSleeping;
// CraftBukkit end
if (chunkcoordinates != null) {
ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(this.server.a(entityplayer.dimension), chunkcoordinates);
if (spawn) {
if(chunkcoordinates != null) {
ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(this.server.a(entityplayer.dimension), chunkcoordinates);
if (chunkcoordinates1 != null) {
entityplayer1.setPositionRotation((double) ((float) chunkcoordinates1.x + 0.5F), (double) ((float) chunkcoordinates1.y + 0.1F), (double) ((float) chunkcoordinates1.z + 0.5F), 0.0F, 0.0F);
entityplayer1.a(chunkcoordinates);
} else {
entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0));
if (chunkcoordinates1 != null) {
entityplayer1.setPositionRotation((double) ((float) chunkcoordinates1.x + 0.5F), (double) ((float) chunkcoordinates1.y + 0.1F), (double) ((float) chunkcoordinates1.z + 0.5F), 0.0F, 0.0F);
entityplayer1.a(chunkcoordinates);
} else {
entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0));
}
}
}
else {
entityplayer1.setPositionRotation(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
entityplayer1.inventory = entityplayer.inventory;
entityplayer1.activeContainer = entityplayer.activeContainer;
entityplayer1.defaultContainer = entityplayer.defaultContainer;
}
// CraftBukkit start
Player respawnPlayer = cserver.getPlayer(entityplayer);
Location respawnLocation = new Location(respawnPlayer.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
@ -245,18 +263,22 @@ public class ServerConfigurationManager {
entityplayer1.setPosition(entityplayer1.locX, entityplayer1.locY + 1.0D, entityplayer1.locZ);
}
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn((byte) ((WorldServer)entityplayer1.world).getWorld().getEnvironment().getId()));
byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0))); // CraftBukkit
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension)); // CraftBukkit
entityplayer1.netServerHandler.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
this.a(entityplayer1, worldserver);
this.a(entityplayer1.dimension).addPlayer(entityplayer1);
worldserver.addEntity(entityplayer1);
this.players.add(entityplayer1);
entityplayer1.syncInventory();
if (spawn) entityplayer1.syncInventory(); // CraftBukkit
entityplayer1.a(entityplayer1.activeContainer);
entityplayer1.w();
return entityplayer1;
}
public void f(EntityPlayer entityplayer) {
// CraftBukkit - changed signature
public EntityPlayer f(EntityPlayer entityplayer) {
WorldServer worldserver = this.server.a(entityplayer.dimension);
boolean flag = false;
byte b0;
@ -267,47 +289,50 @@ public class ServerConfigurationManager {
b0 = -1;
}
entityplayer.dimension = b0;
WorldServer worldserver1 = this.server.a(entityplayer.dimension);
// CraftBukkit start
// entityplayer.dimension = b0;
WorldServer worldserver1 = this.server.a(b0);
// Craftbukkit
entityplayer.netServerHandler.sendPacket(new Packet9Respawn((byte) ((WorldServer)entityplayer.world).getWorld().getEnvironment().getId()));
// entityplayer.netServerHandler.sendPacket(new Packet9Respawn((byte) ((WorldServer)entityplayer.world).getWorld().getEnvironment().getId()));
// Craftbukkit end
worldserver.removeEntity(entityplayer);
entityplayer.dead = false;
double d0 = entityplayer.locX;
double d1 = entityplayer.locZ;
double d2 = 8.0D;
if (entityplayer.dimension == -1) {
if (b0 == -1) { // CraftBukkit
d0 /= d2;
d1 /= d2;
entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch);
if (entityplayer.Q()) {
if (entityplayer.S()) {
worldserver.entityJoinedWorld(entityplayer, false);
}
} else {
d0 *= d2;
d1 *= d2;
entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch);
if (entityplayer.Q()) {
if (entityplayer.S()) {
worldserver.entityJoinedWorld(entityplayer, false);
}
}
if (entityplayer.Q()) {
worldserver1.addEntity(entityplayer);
if (entityplayer.S()) {
// worldserver1.addEntity(entityplayer); // CraftBukkit
entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch);
worldserver1.entityJoinedWorld(entityplayer, false);
worldserver1.chunkProviderServer.a = true;
(new PortalTravelAgent()).a(worldserver1, entityplayer);
worldserver1.chunkProviderServer.a = false;
}
/* CraftBukkit start
this.a(entityplayer);
entityplayer.netServerHandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
entityplayer.a((World) worldserver1);
this.a(entityplayer, worldserver1);
entityplayer.a(entityplayer.defaultContainer);
this.g(entityplayer);
*/ // CraftBukkit end
return a(entityplayer, b0, false);
}
public void b() {
@ -617,9 +642,14 @@ public class ServerConfigurationManager {
}
public void a(EntityPlayer entityplayer, WorldServer worldserver) {
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(worldserver.getTime()));
if (worldserver.v()) {
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(worldserver.getTime()));
entityplayer.netServerHandler.sendPacket(new Packet70Bed(1));
}
}
public void g(EntityPlayer entityplayer) {
entityplayer.a(entityplayer.defaultContainer);
entityplayer.B();
}
}

View File

@ -26,8 +26,8 @@ public class ThreadCommandReader extends Thread {
// CraftBukkit end
try {
// CraftBukkit start - JLine disabling compatibility
while (!this.server.isStopped && MinecraftServer.isRunning(this.server)) {
// CraftBukkit start - JLine disabling compatibility
if (Main.useJline) {
s = bufferedreader.readLine(">", null);
} else {

View File

@ -80,7 +80,7 @@ public class TileEntityMobSpawner extends TileEntity {
this.world.a("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
entityliving.P();
entityliving.R();
this.c();
}
}

View File

@ -283,7 +283,11 @@ public class World implements IBlockAccess {
if (this.setRawData(i, j, k, l)) {
int i1 = this.getTypeId(i, j, k);
this.update(i, j, k, i1);
if (Block.t[i1 & 255]) {
this.update(i, j, k, i1);
} else {
this.applyPhysics(i, j, k, i1);
}
}
}
@ -838,10 +842,10 @@ public class World implements IBlockAccess {
this.everyoneSleeping();
}
int i = entity.bF;
int j = entity.bH;
int i = entity.bG;
int j = entity.bI;
if (entity.bE && this.isChunkLoaded(i, j)) {
if (entity.bF && this.isChunkLoaded(i, j)) {
this.getChunkAt(i, j).b(entity);
}
@ -985,7 +989,7 @@ public class World implements IBlockAccess {
for (i = 0; i < this.e.size(); ++i) {
entity = (Entity) this.e.get(i);
entity.p_();
entity.o_();
if (entity.dead) {
this.e.remove(i--);
}
@ -998,9 +1002,9 @@ public class World implements IBlockAccess {
for (i = 0; i < this.D.size(); ++i) {
entity = (Entity) this.D.get(i);
j = entity.bF;
k = entity.bH;
if (entity.bE && this.isChunkLoaded(j, k)) {
j = entity.bG;
k = entity.bI;
if (entity.bF && this.isChunkLoaded(j, k)) {
this.getChunkAt(j, k).b(entity);
}
}
@ -1027,9 +1031,9 @@ public class World implements IBlockAccess {
}
if (entity.dead) {
j = entity.bF;
k = entity.bH;
if (entity.bE && this.isChunkLoaded(j, k)) {
j = entity.bG;
k = entity.bI;
if (entity.bF && this.isChunkLoaded(j, k)) {
this.getChunkAt(j, k).b(entity);
}
@ -1055,29 +1059,29 @@ public class World implements IBlockAccess {
byte b0 = 32;
if (!flag || this.a(i - b0, 0, j - b0, i + b0, 128, j + b0)) {
entity.bn = entity.locX;
entity.bo = entity.locY;
entity.bp = entity.locZ;
entity.bo = entity.locX;
entity.bp = entity.locY;
entity.bq = entity.locZ;
entity.lastYaw = entity.yaw;
entity.lastPitch = entity.pitch;
if (flag && entity.bE) {
if (flag && entity.bF) {
if (entity.vehicle != null) {
entity.B();
entity.D();
} else {
entity.p_();
entity.o_();
}
}
if (Double.isNaN(entity.locX) || Double.isInfinite(entity.locX)) {
entity.locX = entity.bn;
entity.locX = entity.bo;
}
if (Double.isNaN(entity.locY) || Double.isInfinite(entity.locY)) {
entity.locY = entity.bo;
entity.locY = entity.bp;
}
if (Double.isNaN(entity.locZ) || Double.isInfinite(entity.locZ)) {
entity.locZ = entity.bp;
entity.locZ = entity.bq;
}
if (Double.isNaN((double) entity.pitch) || Double.isInfinite((double) entity.pitch)) {
@ -1092,20 +1096,20 @@ public class World implements IBlockAccess {
int l = MathHelper.floor(entity.locY / 16.0D);
int i1 = MathHelper.floor(entity.locZ / 16.0D);
if (!entity.bE || entity.bF != k || entity.bG != l || entity.bH != i1) {
if (entity.bE && this.isChunkLoaded(entity.bF, entity.bH)) {
this.getChunkAt(entity.bF, entity.bH).a(entity, entity.bG);
if (!entity.bF || entity.bG != k || entity.bH != l || entity.bI != i1) {
if (entity.bF && this.isChunkLoaded(entity.bG, entity.bI)) {
this.getChunkAt(entity.bG, entity.bI).a(entity, entity.bH);
}
if (this.isChunkLoaded(k, i1)) {
entity.bE = true;
entity.bF = true;
this.getChunkAt(k, i1).a(entity);
} else {
entity.bE = false;
entity.bF = false;
}
}
if (flag && entity.bE && entity.passenger != null) {
if (flag && entity.bF && entity.passenger != null) {
if (!entity.passenger.dead && entity.passenger.vehicle == entity) {
this.playerJoinedWorld(entity.passenger);
} else {
@ -1122,7 +1126,7 @@ public class World implements IBlockAccess {
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
if (!entity.dead && entity.aH) {
if (!entity.dead && entity.aI) {
return false;
}
}
@ -1465,15 +1469,20 @@ public class World implements IBlockAccess {
public void a(EnumSkyBlock enumskyblock, int i, int j, int k, int l, int i1, int j1, boolean flag) {
if (!this.worldProvider.e || enumskyblock != EnumSkyBlock.SKY) {
++A;
if (A == 50) {
--A;
} else {
try {
if (A == 50) {
return;
}
int k1 = (l + i) / 2;
int l1 = (j1 + k) / 2;
if (!this.isLoaded(k1, 64, l1)) {
--A;
} else if (!this.b(k1, l1).g()) {
return;
}
if (!this.b(k1, l1).g()) {
int i2 = this.C.size();
int j2;
@ -1487,7 +1496,6 @@ public class World implements IBlockAccess {
MetadataChunkBlock metadatachunkblock = (MetadataChunkBlock) this.C.get(this.C.size() - k2 - 1);
if (metadatachunkblock.a == enumskyblock && metadatachunkblock.a(i, j, k, l, i1, j1)) {
--A;
return;
}
}
@ -1500,8 +1508,10 @@ public class World implements IBlockAccess {
this.C.clear();
}
--A;
return;
}
} finally {
--A;
}
}
}

View File

@ -18,11 +18,11 @@ public class WorldServer extends World implements BlockChangeDelegate {
public final MinecraftServer server; // CraftBukkit - private -> public final
private EntityList G = new EntityList();
public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, long j) {
super(idatamanager, s, j, WorldProvider.a(i));
// CraftBukkit start - change signature
public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, long j, org.bukkit.World.Environment env) {
super(idatamanager, s, j, WorldProvider.a(env.getId()));
this.server = minecraftserver;
// CraftBukkit start
this.dimension = i;
this.cserver = minecraftserver.server;
this.world = new CraftWorld(this);

View File

@ -59,7 +59,7 @@ import org.bukkit.util.config.Configuration;
public final class CraftServer implements Server {
private final String serverName = "Craftbukkit";
private final String serverVersion;
private final String protocolVersion = "1.6.4";
private final String protocolVersion = "1.6.5";
private final PluginManager pluginManager = new SimplePluginManager(this);
private final ServicesManager servicesManager = new SimpleServicesManager();
private final BukkitScheduler scheduler = new CraftScheduler(this);
@ -366,8 +366,8 @@ public final class CraftServer implements Server {
converter.convert(name, new ConvertProgressUpdater(console));
}
int dimension = environment.getId() + 200 + console.worlds.size();
WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, dimension, seed);
int dimension = 200 + console.worlds.size();
WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, dimension, seed, environment);
internal.z = console.worlds.get(0).z;
internal.tracker = new EntityTracker(console, dimension);

View File

@ -19,7 +19,7 @@ public class CraftCreeper extends CraftMonster implements Creeper {
}
public boolean isPowered() {
return getHandle().X().a(17) == 1;
return getHandle().Z().a(17) == 1;
}
public void setPowered(boolean powered) {
@ -32,14 +32,14 @@ public class CraftCreeper extends CraftMonster implements Creeper {
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
getHandle().X().b(17, (byte)1);
getHandle().Z().b(17, (byte)1);
}
} else {
CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
getHandle().X().b(17, (byte)0);
getHandle().Z().b(17, (byte)0);
}
}

View File

@ -172,25 +172,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
EntityPlayer entity = getHandle();
if (oldWorld != newWorld) {
entity.dimension = newWorld.dimension;
entity.netServerHandler.sendPacket(new Packet9Respawn((byte) location.getWorld().getEnvironment().getId()));
oldWorld.removeEntity(entity);
entity.dead = false;
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
if (entity.Q()) {
oldWorld.entityJoinedWorld(entity, false);
newWorld.addEntity(entity);
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
newWorld.entityJoinedWorld(entity, false);
}
manager.a(entity);
entity.netServerHandler.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
entity.a((World)newWorld);
manager.a(entity, newWorld);
entity.a(entity.defaultContainer);
this.sendMessage("Multiworld teleporting disabled in this build. Nether works");
// this.entity = manager.a(entity, newWorld.dimension, false);
return true;
} else {
return entity.netServerHandler.teleport(location);
@ -214,7 +197,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void updateInventory() {
getHandle().syncInventory();
getHandle().a(getHandle().activeContainer);
}
public void setSleepingIgnored(boolean isSleeping) {

View File

@ -35,7 +35,7 @@ public class CraftWolf extends CraftAnimals implements Wolf {
}
public boolean isTamed() {
return getHandle().m_();
return getHandle().A();
}
public void setTamed(boolean tame) {