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> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId> <artifactId>minecraft-server</artifactId>
<version>1.6.4</version> <version>1.6.5</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

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

View File

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

View File

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

View File

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

View File

@ -53,7 +53,7 @@ public class EntityBoat extends Entity {
this.damage = 0; this.damage = 0;
this.b = 0; this.b = 0;
this.c = 1; this.c = 1;
this.aH = true; this.aI = true;
this.b(1.5F, 0.6F); this.b(1.5F, 0.6F);
this.height = this.width / 2.0F; this.height = this.width / 2.0F;
} }
@ -116,7 +116,7 @@ public class EntityBoat extends Entity {
this.c = -this.c; this.c = -this.c;
this.b = 10; this.b = 10;
this.damage += i * 10; this.damage += i * 10;
this.ac(); this.ae();
if (this.damage > 40) { if (this.damage > 40) {
// CraftBukkit start // CraftBukkit start
@ -148,11 +148,11 @@ public class EntityBoat extends Entity {
} }
} }
public boolean o_() { public boolean n_() {
return !this.dead; return !this.dead;
} }
public void p_() { public void o_() {
// CraftBukkit start // CraftBukkit start
double prevX = this.locX; double prevX = this.locX;
double prevY = this.locY; double prevY = this.locY;
@ -161,7 +161,7 @@ public class EntityBoat extends Entity {
float prevPitch = this.pitch; float prevPitch = this.pitch;
// CraftBukkit end // CraftBukkit end
super.p_(); super.o_();
if (this.b > 0) { if (this.b > 0) {
--this.b; --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 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; 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) { if (this.target != null) {
this.pathEntity = this.world.findPath(this, this.target, f); this.pathEntity = this.world.findPath(this, this.target, f);
} }
} else if (!this.target.Q()) { } else if (!this.target.S()) {
// CraftBukkit start // CraftBukkit start
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.TARGET_DIED); EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, TargetReason.TARGET_DIED);
CraftServer server = ((WorldServer) this.world).getServer(); CraftServer server = ((WorldServer) this.world).getServer();
@ -101,8 +101,8 @@ public class EntityCreature extends EntityLiving {
} }
int l1 = MathHelper.floor(this.boundingBox.b + 0.5D); int l1 = MathHelper.floor(this.boundingBox.b + 0.5D);
boolean flag1 = this.aa(); boolean flag1 = this.ac();
boolean flag2 = this.ab(); boolean flag2 = this.ad();
this.pitch = 0.0F; this.pitch = 0.0F;
if (this.pathEntity != null && this.random.nextInt(100) != 0) { 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) { if (vec3d != null) {
double d1 = vec3d.a - this.locX; double d1 = vec3d.a - this.locX;
double d2 = vec3d.c - this.locZ; 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 f4 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
float f5 = f4 - this.yaw; 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; this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
f5 = (f6 - this.yaw + 90.0F) * 3.1415927F / 180.0F; f5 = (f6 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
this.ay = -MathHelper.sin(f5) * this.az * 1.0F; this.az = -MathHelper.sin(f5) * this.aA * 1.0F;
this.az = MathHelper.cos(f5) * this.az * 1.0F; this.aA = MathHelper.cos(f5) * this.aA * 1.0F;
} }
if (d3 > 0.0D) { 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); this.a(this.target, 30.0F, 30.0F);
} }
if (this.positionChanged && !this.C()) { if (this.positionChanged && !this.B()) {
this.aB = true; this.aC = true;
} }
if (this.random.nextFloat() < 0.8F && (flag1 || flag2)) { if (this.random.nextFloat() < 0.8F && (flag1 || flag2)) {
this.aB = true; this.aC = true;
} }
} else { } else {
super.c_(); super.c_();
@ -198,7 +198,7 @@ public class EntityCreature extends EntityLiving {
return super.d() && this.a(i, j, k) >= 0.0F; return super.d() && this.a(i, j, k) >= 0.0F;
} }
public boolean C() { public boolean B() {
return this.pathEntity != null; return this.pathEntity != null;
} }
@ -206,7 +206,7 @@ public class EntityCreature extends EntityLiving {
this.pathEntity = pathentity; this.pathEntity = pathentity;
} }
public Entity D() { public Entity E() {
return this.target; return this.target;
} }

View File

@ -36,16 +36,18 @@ public class EntityCreeper extends EntityMonster {
} }
protected void b(Entity entity, float f) { protected void b(Entity entity, float f) {
if (this.fuseTicks > 0) { if (!this.world.isStatic) {
this.e(-1); if (this.fuseTicks > 0) {
--this.fuseTicks; this.e(-1);
if (this.fuseTicks < 0) { --this.fuseTicks;
this.fuseTicks = 0; if (this.fuseTicks < 0) {
this.fuseTicks = 0;
}
} }
} }
} }
public void p_() { public void o_() {
this.b = this.fuseTicks; this.b = this.fuseTicks;
if (this.world.isStatic) { if (this.world.isStatic) {
int i = this.x(); int i = this.x();
@ -64,7 +66,7 @@ public class EntityCreeper extends EntityMonster {
} }
} }
super.p_(); super.o_();
if (this.target == null && this.fuseTicks > 0) { if (this.target == null && this.fuseTicks > 0) {
this.e(-1); this.e(-1);
--this.fuseTicks; --this.fuseTicks;
@ -90,39 +92,43 @@ public class EntityCreeper extends EntityMonster {
} }
protected void a(Entity entity, float f) { 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)) { if ((i > 0 || f >= 3.0F) && (i <= 0 || f >= 7.0F)) {
this.e(-1); this.e(-1);
--this.fuseTicks; --this.fuseTicks;
if (this.fuseTicks < 0) { 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 {
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; this.h = 0;
} }
public void p_() { public void o_() {
this.bn = this.locX; this.bo = this.locX;
this.bo = this.locY; this.bp = this.locY;
this.bp = this.locZ; this.bq = this.locZ;
super.p_(); super.o_();
if (this.a > 0) { if (this.a > 0) {
--this.a; --this.a;
} }
@ -129,7 +129,7 @@ public class EntityEgg extends Entity {
for (int j = 0; j < list.size(); ++j) { for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(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; float f = 0.3F;
AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f); AxisAlignedBB axisalignedbb = entity1.boundingBox.b((double) f, (double) f, (double) f);
MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1); MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);
@ -301,7 +301,7 @@ public class EntityEgg extends Entity {
float f2 = 0.99F; float f2 = 0.99F;
float f3 = 0.03F; float f3 = 0.03F;
if (this.aa()) { if (this.ac()) {
for (int i1 = 0; i1 < 4; ++i1) { for (int i1 = 0; i1 < 4; ++i1) {
float f4 = 0.25F; float f4 = 0.25F;

View File

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

View File

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

View File

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

View File

@ -38,8 +38,8 @@ public class EntityItem extends Entity {
protected void b() {} protected void b() {}
public void p_() { public void o_() {
super.p_(); super.o_();
if (this.pickupDelay > 0) { if (this.pickupDelay > 0) {
--this.pickupDelay; --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.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); this.move(this.motX, this.motY, this.motZ);
float f = 0.98F; float f = 0.98F;
@ -91,7 +91,7 @@ public class EntityItem extends Entity {
} }
public boolean damageEntity(Entity entity, int i) { public boolean damageEntity(Entity entity, int i) {
this.ac(); this.ae();
this.f -= i; this.f -= i;
if (this.f <= 0) { if (this.f <= 0) {
this.die(); this.die();

View File

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

View File

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

View File

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

View File

@ -119,7 +119,7 @@ public class EntityPainting extends Entity {
return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F); return i == 32 ? 0.5F : (i == 64 ? 0.5F : 0.0F);
} }
public void p_() { public void o_() {
if (this.f++ == 100 && !this.world.isStatic) { if (this.f++ == 100 && !this.world.isStatic) {
this.f = 0; this.f = 0;
if (!this.h()) { if (!this.h()) {
@ -197,7 +197,7 @@ public class EntityPainting extends Entity {
} }
} }
public boolean o_() { public boolean n_() {
return true; return true;
} }
@ -214,7 +214,7 @@ public class EntityPainting extends Entity {
// CraftBukkit end // CraftBukkit end
this.die(); this.die();
this.ac(); this.ae();
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING))); 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) { public EntityPigZombie(World world) {
super(world); super(world);
this.texture = "/mob/pigzombie.png"; this.texture = "/mob/pigzombie.png";
this.aD = 0.5F; this.aE = 0.5F;
this.damage = 5; this.damage = 5;
this.bC = true; this.bD = true;
} }
public void p_() { public void o_() {
this.aD = this.target != null ? 0.95F : 0.5F; this.aE = this.target != null ? 0.95F : 0.5F;
if (this.soundDelay > 0 && --this.soundDelay == 0) { 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); 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() { public boolean d() {

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@ public class EntityTNTPrimed extends Entity {
public EntityTNTPrimed(World world) { public EntityTNTPrimed(World world) {
super(world); super(world);
this.a = 0; this.a = 0;
this.aH = true; this.aI = true;
this.b(0.98F, 0.98F); this.b(0.98F, 0.98F);
this.height = this.width / 2.0F; this.height = this.width / 2.0F;
} }
@ -38,11 +38,11 @@ public class EntityTNTPrimed extends Entity {
return false; return false;
} }
public boolean o_() { public boolean n_() {
return !this.dead; return !this.dead;
} }
public void p_() { public void o_() {
this.lastX = this.locX; this.lastX = this.locX;
this.lastY = this.locY; this.lastY = this.locY;
this.lastZ = this.locZ; this.lastZ = this.locZ;
@ -63,6 +63,8 @@ public class EntityTNTPrimed extends Entity {
this.explode(); this.explode();
this.die(); this.die();
// CraftBukkit end // CraftBukkit end
} else {
this.die();
} }
} else { } else {
this.world.a("smoke", this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D); 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); this.a((Packet) object);
} }
DataWatcher datawatcher = this.tracker.X(); DataWatcher datawatcher = this.tracker.Z();
if (datawatcher.a()) { if (datawatcher.a()) {
this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher))); this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher)));

View File

@ -76,8 +76,8 @@ public class EntityWeatherStorm extends EntityWeather {
} }
} }
public void p_() { public void o_() {
super.p_(); super.o_();
if (this.b == 2) { 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, "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); 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) { public EntityZombie(World world) {
super(world); super(world);
this.texture = "/mob/zombie.png"; this.texture = "/mob/zombie.png";
this.aD = 0.5F; this.aE = 0.5F;
this.damage = 5; this.damage = 5;
} }

View File

@ -126,7 +126,7 @@ public class InventoryPlayer implements IInventory {
if (itemstack.f()) { if (itemstack.f()) {
i = this.k(); i = this.k();
if (i >= 0) { if (i >= 0) {
this.items[i] = itemstack; this.items[i] = ItemStack.b(itemstack);
this.items[i].b = 5; this.items[i].b = 5;
itemstack.count = 0; itemstack.count = 0;
return true; 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); this.world.a(this.player, 2001, i, j, k, l + this.world.getData(i, j, k) * 256);
boolean flag = this.b(i, j, k); boolean flag = this.b(i, j, k);
ItemStack itemstack = this.player.D(); ItemStack itemstack = this.player.F();
if (itemstack != null) { if (itemstack != null) {
itemstack.a(l, i, j, k, this.player); itemstack.a(l, i, j, k, this.player);
if (itemstack.count == 0) { if (itemstack.count == 0) {
itemstack.a(this.player); 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 static HashMap b = new HashMap();
public NetworkListenThread networkListenThread; public NetworkListenThread networkListenThread;
public PropertyManager propertyManager; public PropertyManager propertyManager;
// public WorldServer[] worldServer; // Craftbukkit - removed! // public WorldServer[] worldServer; // CraftBukkit - removed!
public ServerConfigurationManager serverConfigurationManager; public ServerConfigurationManager serverConfigurationManager;
public ConsoleCommandHandler consoleCommandHandler; // CraftBukkit - made public public ConsoleCommandHandler consoleCommandHandler; // CraftBukkit - made public
private boolean isRunning = true; private boolean isRunning = true;
@ -43,7 +43,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
public int j; public int j;
private List r = new ArrayList(); private List r = new ArrayList();
private List s = Collections.synchronizedList(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 onlineMode;
public boolean spawnAnimals; public boolean spawnAnimals;
public boolean pvpMode; public boolean pvpMode;
@ -86,7 +86,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true)); System.setErr(new PrintStream(new LoggerOutputStream(log, Level.SEVERE), true));
// CraftBukkit end // 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) { if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
log.warning("**** NOT ENOUGH RAM!"); log.warning("**** NOT ENOUGH RAM!");
log.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); 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); this.serverConfigurationManager = new ServerConfigurationManager(this);
// Craftbukkit - removed trackers // CraftBukkit - removed trackers
long j = System.nanoTime(); long j = System.nanoTime();
String s1 = this.propertyManager.getString("level-name", "world"); String s1 = this.propertyManager.getString("level-name", "world");
String s2 = this.propertyManager.getString("level-seed", ""); String s2 = this.propertyManager.getString("level-seed", "");
@ -160,16 +160,16 @@ public class MinecraftServer implements Runnable, ICommandListener {
convertable.convert(s, new ConvertProgressUpdater(this)); convertable.convert(s, new ConvertProgressUpdater(this));
} }
// Craftbukkit start // CraftBukkit start
for (int j = 0; j < (this.propertyManager.getBoolean("allow-nether", true) ? 2 : 1); ++j) { for (int j = 0; j < (this.propertyManager.getBoolean("allow-nether", true) ? 2 : 1); ++j) {
WorldServer world; WorldServer world;
int dimension = j == 0 ? 0 : -1; int dimension = j == 0 ? 0 : -1;
if (j == 0) { 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 { } else {
String name = s + "_" + Environment.getEnvironment(dimension).toString().toLowerCase(); 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); world.tracker = new EntityTracker(this, dimension);
@ -179,38 +179,41 @@ public class MinecraftServer implements Runnable, ICommandListener {
worlds.add(world); worlds.add(world);
this.serverConfigurationManager.setPlayerFileData(worlds.toArray(new WorldServer[0])); this.serverConfigurationManager.setPlayerFileData(worlds.toArray(new WorldServer[0]));
} }
// CraftBukkit end
short short1 = 196; short short1 = 196;
long k = System.currentTimeMillis(); 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); log.info("Preparing start region for level " + l);
WorldServer worldserver = this.worlds.get(l); // Craftbukkit // if (l == 0 || this.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit
ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); WorldServer worldserver = this.worlds.get(l); // CraftBukkit
ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
for (int i1 = -short1; i1 <= short1 && this.isRunning; i1 += 16) { for (int i1 = -short1; i1 <= short1 && this.isRunning; i1 += 16) {
for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) { for (int j1 = -short1; j1 <= short1 && this.isRunning; j1 += 16) {
long k1 = System.currentTimeMillis(); long k1 = System.currentTimeMillis();
if (k1 < k) { if (k1 < k) {
k = k1; k = k1;
} }
if (k1 > k + 1000L) { if (k1 > k + 1000L) {
int l1 = (short1 * 2 + 1) * (short1 * 2 + 1); int l1 = (short1 * 2 + 1) * (short1 * 2 + 1);
int i2 = (i1 + short1) * (short1 * 2 + 1) + j1 + 1; int i2 = (i1 + short1) * (short1 * 2 + 1) + j1 + 1;
this.a("Preparing spawn area", i2 * 100 / l1); this.a("Preparing spawn area", i2 * 100 / l1);
k = k1; 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(); this.e();
@ -232,7 +235,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
void saveChunks() { // CraftBukkit - private -> default void saveChunks() { // CraftBukkit - private -> default
log.info("Saving chunks"); log.info("Saving chunks");
// Craftbukkit start // CraftBukkit start
for (int i = 0; i < this.worlds.size(); ++i) { for (int i = 0; i < this.worlds.size(); ++i) {
WorldServer worldserver = this.worlds.get(i); WorldServer worldserver = this.worlds.get(i);
@ -298,7 +301,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
j += l; j += l;
i = k; i = k;
if (this.worlds.get(0).everyoneDeeplySleeping()) { // Craftbukkit if (this.worlds.get(0).everyoneDeeplySleeping()) { // CraftBukkit
this.h(); this.h();
j = 0L; j = 0L;
} else { } else {
@ -370,37 +373,39 @@ public class MinecraftServer implements Runnable, ICommandListener {
Vec3D.a(); Vec3D.a();
++this.ticks; ++this.ticks;
for (j = 0; j < this.worlds.size(); ++j) { // Craftbukkit for (j = 0; j < this.worlds.size(); ++j) { // CraftBukkit
WorldServer worldserver = this.worlds.get(j); // Craftbukkit // if (j == 0 || this.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit
WorldServer worldserver = this.worlds.get(j); // CraftBukkit
if (this.ticks % 20 == 0) { if (this.ticks % 20 == 0) {
// Craftbukkit start // CraftBukkit start - only send timeupdates to the people in that world
for (int i = 0; i < this.serverConfigurationManager.players.size(); ++i) { for (int i = 0; i < this.serverConfigurationManager.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.serverConfigurationManager.players.get(i); EntityPlayer entityplayer = (EntityPlayer) this.serverConfigurationManager.players.get(i);
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(entityplayer.world.getTime())); entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(entityplayer.world.getTime()));
}
} }
((CraftScheduler) server.getScheduler()).mainThreadHeartbeat(this.ticks);
// CraftBukkit end
worldserver.doTick();
while (worldserver.doLighting()) {
;
}
worldserver.cleanUp();
} }
// } // CraftBukkit
((CraftScheduler) server.getScheduler()).mainThreadHeartbeat(this.ticks);
// Craftbukkit end
worldserver.doTick();
while (worldserver.doLighting()) {
;
}
worldserver.cleanUp();
}
this.networkListenThread.a(); this.networkListenThread.a();
this.serverConfigurationManager.b(); this.serverConfigurationManager.b();
// Craftbukkit start // CraftBukkit start
for (j = 0; j < this.worlds.size(); ++j) { for (j = 0; j < this.worlds.size(); ++j) {
this.worlds.get(j).tracker.a(); this.worlds.get(j).tracker.a();
} }
// Craftbukkit end // CraftBukkit end
for (j = 0; j < this.r.size(); ++j) { for (j = 0; j < this.r.size(); ++j) {
((IUpdatePlayerListBox) this.r.get(j)).a(); ((IUpdatePlayerListBox) this.r.get(j)).a();
@ -461,19 +466,19 @@ public class MinecraftServer implements Runnable, ICommandListener {
} }
public WorldServer a(int i) { public WorldServer a(int i) {
// Craftbukkit start // CraftBukkit start
for (WorldServer world : worlds) { for (WorldServer world : worlds) {
if (world.dimension == i) { if (world.dimension == i) {
return world; return world;
} }
} }
return worlds.get(0); return worlds.get(0);
// Craftbukkit end // CraftBukkit end
} }
public EntityTracker b(int i) { public EntityTracker b(int i) {
return a(i).tracker; // Craftbukkit return a(i).tracker; // CraftBukkit
} }
public static boolean isRunning(MinecraftServer minecraftserver) { 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 // Send the possibly modified leave message
s = event.getReason(); s = event.getReason();
// CraftBukkit end
this.player.A();
this.sendPacket(new Packet255KickDisconnect(s)); this.sendPacket(new Packet255KickDisconnect(s));
this.networkManager.d(); this.networkManager.d();
//CraftBukkit start
leaveMessage = event.getLeaveMessage(); leaveMessage = event.getLeaveMessage();
if (leaveMessage != null) { if (leaveMessage != null) {
this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(leaveMessage)); 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.onGround = packet10flying.g;
this.player.a(true); this.player = this.player.a(true); // CraftBukkit
this.player.move(d5, 0.0D, d4); this.player.move(d5, 0.0D, d4);
this.player.setLocation(d1, d2, d3, f, f1); this.player.setLocation(d1, d2, d3, f, f1);
this.player.motX = d5; this.player.motX = d5;
@ -272,7 +277,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
} }
this.player.a(true); 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); this.player.setLocation(this.x, this.y, this.z, f2, f3);
if (!this.m) { if (!this.m) {
return; return;
@ -402,7 +407,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
WorldServer worldserver = this.minecraftServer.a(this.player.dimension); WorldServer worldserver = this.minecraftServer.a(this.player.dimension);
if (packet14blockdig.e == 4) { if (packet14blockdig.e == 4) {
this.player.C(); this.player.E();
} else { } else {
boolean flag = worldserver.weirdIsOpCache = worldserver.worldProvider.dimension != 0 || this.minecraftServer.serverConfigurationManager.isOp(this.player.name); boolean flag = worldserver.weirdIsOpCache = worldserver.worldProvider.dimension != 0 || this.minecraftServer.serverConfigurationManager.isOp(this.player.name);
boolean flag1 = false; boolean flag1 = false;

View File

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

View File

@ -69,11 +69,6 @@ public abstract class Packet {
int i; int i;
try { try {
// CraftBukkit start - sleep while nothing to do
while(datainputstream.available() <= 0) {
Thread.sleep(10);
}
// CraftBukkit end
i = datainputstream.read(); i = datainputstream.read();
if (i == -1) { if (i == -1) {
return null; return null;
@ -102,10 +97,6 @@ public abstract class Packet {
System.out.println("Connection reset"); System.out.println("Connection reset");
return null; return null;
} }
catch (InterruptedException exception) {
System.out.println("Thread exception");
return null;
}
// CraftBukkit end // CraftBukkit end
PacketCounter packetcounter = (PacketCounter) e.get(Integer.valueOf(i)); 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) { public void a(EntityPlayer entityplayer) {
// Craftbukkit - removed playermanagers // 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); this.a(entityplayer.dimension).addPlayer(entityplayer);
WorldServer worldserver = this.server.a(entityplayer.dimension); WorldServer worldserver = this.server.a(entityplayer.dimension);
@ -192,39 +198,51 @@ public class ServerConfigurationManager {
// CraftBukkit end // CraftBukkit end
} }
// CraftBukkit start
public EntityPlayer a(EntityPlayer entityplayer, int i) { 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).trackPlayer(entityplayer);
this.server.b(entityplayer.dimension).untrackEntity(entityplayer); this.server.b(entityplayer.dimension).untrackEntity(entityplayer);
this.a(entityplayer.dimension).removePlayer(entityplayer); this.a(entityplayer.dimension).removePlayer(entityplayer);
this.players.remove(entityplayer); this.players.remove(entityplayer);
this.server.a(entityplayer.dimension).removeEntity(entityplayer); this.server.a(entityplayer.dimension).removeEntity(entityplayer);
ChunkCoordinates chunkcoordinates = entityplayer.K(); ChunkCoordinates chunkcoordinates = entityplayer.M();
entityplayer.dimension = i; entityplayer.dimension = i;
EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.a(entityplayer.dimension), entityplayer.name, new ItemInWorldManager(this.server.a(entityplayer.dimension))); 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.id = entityplayer.id;
entityplayer1.netServerHandler = entityplayer.netServerHandler; entityplayer1.netServerHandler = entityplayer.netServerHandler;
entityplayer1.netServerHandler.player = entityplayer1;
WorldServer worldserver = this.server.a(entityplayer.dimension); WorldServer worldserver = this.server.a(entityplayer.dimension);
// CraftBukkit start - transfer internal variables entityplayer1.dimension = i;
entityplayer1.displayName = entityplayer.displayName; entityplayer1.displayName = entityplayer.displayName;
entityplayer1.compassTarget = entityplayer.compassTarget; entityplayer1.compassTarget = entityplayer.compassTarget;
entityplayer1.fauxSleeping = entityplayer.fauxSleeping; entityplayer1.fauxSleeping = entityplayer.fauxSleeping;
// CraftBukkit end
if (chunkcoordinates != null) { if (spawn) {
ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(this.server.a(entityplayer.dimension), chunkcoordinates); if(chunkcoordinates != null) {
ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(this.server.a(entityplayer.dimension), chunkcoordinates);
if (chunkcoordinates1 != null) { 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.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); entityplayer1.a(chunkcoordinates);
} else { } else {
entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0)); 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); Player respawnPlayer = cserver.getPlayer(entityplayer);
Location respawnLocation = new Location(respawnPlayer.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); 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.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); entityplayer1.netServerHandler.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
this.a(entityplayer1, worldserver); this.a(entityplayer1, worldserver);
this.a(entityplayer1.dimension).addPlayer(entityplayer1); this.a(entityplayer1.dimension).addPlayer(entityplayer1);
worldserver.addEntity(entityplayer1); worldserver.addEntity(entityplayer1);
this.players.add(entityplayer1); this.players.add(entityplayer1);
entityplayer1.syncInventory(); if (spawn) entityplayer1.syncInventory(); // CraftBukkit
entityplayer1.a(entityplayer1.activeContainer);
entityplayer1.w(); entityplayer1.w();
return entityplayer1; return entityplayer1;
} }
public void f(EntityPlayer entityplayer) { // CraftBukkit - changed signature
public EntityPlayer f(EntityPlayer entityplayer) {
WorldServer worldserver = this.server.a(entityplayer.dimension); WorldServer worldserver = this.server.a(entityplayer.dimension);
boolean flag = false; boolean flag = false;
byte b0; byte b0;
@ -267,47 +289,50 @@ public class ServerConfigurationManager {
b0 = -1; b0 = -1;
} }
entityplayer.dimension = b0; // CraftBukkit start
WorldServer worldserver1 = this.server.a(entityplayer.dimension); // 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); worldserver.removeEntity(entityplayer);
entityplayer.dead = false; entityplayer.dead = false;
double d0 = entityplayer.locX; double d0 = entityplayer.locX;
double d1 = entityplayer.locZ; double d1 = entityplayer.locZ;
double d2 = 8.0D; double d2 = 8.0D;
if (entityplayer.dimension == -1) { if (b0 == -1) { // CraftBukkit
d0 /= d2; d0 /= d2;
d1 /= d2; d1 /= d2;
entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch); entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch);
if (entityplayer.Q()) { if (entityplayer.S()) {
worldserver.entityJoinedWorld(entityplayer, false); worldserver.entityJoinedWorld(entityplayer, false);
} }
} else { } else {
d0 *= d2; d0 *= d2;
d1 *= d2; d1 *= d2;
entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch); entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch);
if (entityplayer.Q()) { if (entityplayer.S()) {
worldserver.entityJoinedWorld(entityplayer, false); worldserver.entityJoinedWorld(entityplayer, false);
} }
} }
if (entityplayer.Q()) { if (entityplayer.S()) {
worldserver1.addEntity(entityplayer); // worldserver1.addEntity(entityplayer); // CraftBukkit
entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch); entityplayer.setPositionRotation(d0, entityplayer.locY, d1, entityplayer.yaw, entityplayer.pitch);
worldserver1.entityJoinedWorld(entityplayer, false); worldserver1.entityJoinedWorld(entityplayer, false);
worldserver1.chunkProviderServer.a = true; worldserver1.chunkProviderServer.a = true;
(new PortalTravelAgent()).a(worldserver1, entityplayer); (new PortalTravelAgent()).a(worldserver1, entityplayer);
worldserver1.chunkProviderServer.a = false; worldserver1.chunkProviderServer.a = false;
} }
/* CraftBukkit start
this.a(entityplayer); this.a(entityplayer);
entityplayer.netServerHandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); entityplayer.netServerHandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
entityplayer.a((World) worldserver1); entityplayer.a((World) worldserver1);
this.a(entityplayer, worldserver1); this.a(entityplayer, worldserver1);
entityplayer.a(entityplayer.defaultContainer); this.g(entityplayer);
*/ // CraftBukkit end
return a(entityplayer, b0, false);
} }
public void b() { public void b() {
@ -617,9 +642,14 @@ public class ServerConfigurationManager {
} }
public void a(EntityPlayer entityplayer, WorldServer worldserver) { public void a(EntityPlayer entityplayer, WorldServer worldserver) {
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(worldserver.getTime()));
if (worldserver.v()) { if (worldserver.v()) {
entityplayer.netServerHandler.sendPacket(new Packet4UpdateTime(worldserver.getTime()));
entityplayer.netServerHandler.sendPacket(new Packet70Bed(1)); 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 // CraftBukkit end
try { try {
// CraftBukkit start - JLine disabling compatibility
while (!this.server.isStopped && MinecraftServer.isRunning(this.server)) { while (!this.server.isStopped && MinecraftServer.isRunning(this.server)) {
// CraftBukkit start - JLine disabling compatibility
if (Main.useJline) { if (Main.useJline) {
s = bufferedreader.readLine(">", null); s = bufferedreader.readLine(">", null);
} else { } 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); this.world.a("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
} }
entityliving.P(); entityliving.R();
this.c(); this.c();
} }
} }

View File

@ -283,7 +283,11 @@ public class World implements IBlockAccess {
if (this.setRawData(i, j, k, l)) { if (this.setRawData(i, j, k, l)) {
int i1 = this.getTypeId(i, j, k); 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(); this.everyoneSleeping();
} }
int i = entity.bF; int i = entity.bG;
int j = entity.bH; int j = entity.bI;
if (entity.bE && this.isChunkLoaded(i, j)) { if (entity.bF && this.isChunkLoaded(i, j)) {
this.getChunkAt(i, j).b(entity); this.getChunkAt(i, j).b(entity);
} }
@ -985,7 +989,7 @@ public class World implements IBlockAccess {
for (i = 0; i < this.e.size(); ++i) { for (i = 0; i < this.e.size(); ++i) {
entity = (Entity) this.e.get(i); entity = (Entity) this.e.get(i);
entity.p_(); entity.o_();
if (entity.dead) { if (entity.dead) {
this.e.remove(i--); this.e.remove(i--);
} }
@ -998,9 +1002,9 @@ public class World implements IBlockAccess {
for (i = 0; i < this.D.size(); ++i) { for (i = 0; i < this.D.size(); ++i) {
entity = (Entity) this.D.get(i); entity = (Entity) this.D.get(i);
j = entity.bF; j = entity.bG;
k = entity.bH; k = entity.bI;
if (entity.bE && this.isChunkLoaded(j, k)) { if (entity.bF && this.isChunkLoaded(j, k)) {
this.getChunkAt(j, k).b(entity); this.getChunkAt(j, k).b(entity);
} }
} }
@ -1027,9 +1031,9 @@ public class World implements IBlockAccess {
} }
if (entity.dead) { if (entity.dead) {
j = entity.bF; j = entity.bG;
k = entity.bH; k = entity.bI;
if (entity.bE && this.isChunkLoaded(j, k)) { if (entity.bF && this.isChunkLoaded(j, k)) {
this.getChunkAt(j, k).b(entity); this.getChunkAt(j, k).b(entity);
} }
@ -1055,29 +1059,29 @@ public class World implements IBlockAccess {
byte b0 = 32; byte b0 = 32;
if (!flag || this.a(i - b0, 0, j - b0, i + b0, 128, j + b0)) { if (!flag || this.a(i - b0, 0, j - b0, i + b0, 128, j + b0)) {
entity.bn = entity.locX; entity.bo = entity.locX;
entity.bo = entity.locY; entity.bp = entity.locY;
entity.bp = entity.locZ; entity.bq = entity.locZ;
entity.lastYaw = entity.yaw; entity.lastYaw = entity.yaw;
entity.lastPitch = entity.pitch; entity.lastPitch = entity.pitch;
if (flag && entity.bE) { if (flag && entity.bF) {
if (entity.vehicle != null) { if (entity.vehicle != null) {
entity.B(); entity.D();
} else { } else {
entity.p_(); entity.o_();
} }
} }
if (Double.isNaN(entity.locX) || Double.isInfinite(entity.locX)) { 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)) { 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)) { 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)) { 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 l = MathHelper.floor(entity.locY / 16.0D);
int i1 = MathHelper.floor(entity.locZ / 16.0D); int i1 = MathHelper.floor(entity.locZ / 16.0D);
if (!entity.bE || entity.bF != k || entity.bG != l || entity.bH != i1) { if (!entity.bF || entity.bG != k || entity.bH != l || entity.bI != i1) {
if (entity.bE && this.isChunkLoaded(entity.bF, entity.bH)) { if (entity.bF && this.isChunkLoaded(entity.bG, entity.bI)) {
this.getChunkAt(entity.bF, entity.bH).a(entity, entity.bG); this.getChunkAt(entity.bG, entity.bI).a(entity, entity.bH);
} }
if (this.isChunkLoaded(k, i1)) { if (this.isChunkLoaded(k, i1)) {
entity.bE = true; entity.bF = true;
this.getChunkAt(k, i1).a(entity); this.getChunkAt(k, i1).a(entity);
} else { } 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) { if (!entity.passenger.dead && entity.passenger.vehicle == entity) {
this.playerJoinedWorld(entity.passenger); this.playerJoinedWorld(entity.passenger);
} else { } else {
@ -1122,7 +1126,7 @@ public class World implements IBlockAccess {
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i); Entity entity = (Entity) list.get(i);
if (!entity.dead && entity.aH) { if (!entity.dead && entity.aI) {
return false; 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) { 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) { if (!this.worldProvider.e || enumskyblock != EnumSkyBlock.SKY) {
++A; ++A;
if (A == 50) {
--A; try {
} else { if (A == 50) {
return;
}
int k1 = (l + i) / 2; int k1 = (l + i) / 2;
int l1 = (j1 + k) / 2; int l1 = (j1 + k) / 2;
if (!this.isLoaded(k1, 64, l1)) { if (!this.isLoaded(k1, 64, l1)) {
--A; return;
} else if (!this.b(k1, l1).g()) { }
if (!this.b(k1, l1).g()) {
int i2 = this.C.size(); int i2 = this.C.size();
int j2; int j2;
@ -1487,7 +1496,6 @@ public class World implements IBlockAccess {
MetadataChunkBlock metadatachunkblock = (MetadataChunkBlock) this.C.get(this.C.size() - k2 - 1); MetadataChunkBlock metadatachunkblock = (MetadataChunkBlock) this.C.get(this.C.size() - k2 - 1);
if (metadatachunkblock.a == enumskyblock && metadatachunkblock.a(i, j, k, l, i1, j1)) { if (metadatachunkblock.a == enumskyblock && metadatachunkblock.a(i, j, k, l, i1, j1)) {
--A;
return; return;
} }
} }
@ -1500,8 +1508,10 @@ public class World implements IBlockAccess {
this.C.clear(); 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 public final MinecraftServer server; // CraftBukkit - private -> public final
private EntityList G = new EntityList(); private EntityList G = new EntityList();
public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, long j) { // CraftBukkit start - change signature
super(idatamanager, s, j, WorldProvider.a(i)); 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; this.server = minecraftserver;
// CraftBukkit start
this.dimension = i; this.dimension = i;
this.cserver = minecraftserver.server; this.cserver = minecraftserver.server;
this.world = new CraftWorld(this); this.world = new CraftWorld(this);

View File

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

View File

@ -19,7 +19,7 @@ public class CraftCreeper extends CraftMonster implements Creeper {
} }
public boolean isPowered() { public boolean isPowered() {
return getHandle().X().a(17) == 1; return getHandle().Z().a(17) == 1;
} }
public void setPowered(boolean powered) { public void setPowered(boolean powered) {
@ -32,14 +32,14 @@ public class CraftCreeper extends CraftMonster implements Creeper {
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
getHandle().X().b(17, (byte)1); getHandle().Z().b(17, (byte)1);
} }
} else { } else {
CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF); CreeperPowerEvent event = new CreeperPowerEvent(entity, CreeperPowerEvent.PowerCause.SET_OFF);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
if (!event.isCancelled()) { 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(); EntityPlayer entity = getHandle();
if (oldWorld != newWorld) { if (oldWorld != newWorld) {
entity.dimension = newWorld.dimension; this.sendMessage("Multiworld teleporting disabled in this build. Nether works");
entity.netServerHandler.sendPacket(new Packet9Respawn((byte) location.getWorld().getEnvironment().getId())); // this.entity = manager.a(entity, newWorld.dimension, false);
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);
return true; return true;
} else { } else {
return entity.netServerHandler.teleport(location); return entity.netServerHandler.teleport(location);
@ -214,7 +197,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void updateInventory() { public void updateInventory() {
getHandle().syncInventory(); getHandle().a(getHandle().activeContainer);
} }
public void setSleepingIgnored(boolean isSleeping) { public void setSleepingIgnored(boolean isSleeping) {

View File

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