@@ -1,5 +1,5 @@
|
||||
--- ../work/decompile-8eb82bde/net/minecraft/server/Entity.java 2015-01-09 16:56:08.177542854 +1100
|
||||
+++ src/main/java/net/minecraft/server/Entity.java 2015-01-09 16:56:08.181542844 +1100
|
||||
--- /home/matt/mc-dev-private//net/minecraft/server/Entity.java 2015-02-26 22:40:22.595608139 +0000
|
||||
+++ src/main/java/net/minecraft/server/Entity.java 2015-02-26 22:40:22.599608139 +0000
|
||||
@@ -6,8 +6,40 @@
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -41,26 +41,34 @@
|
||||
private static final AxisAlignedBB a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
private static int entityCount;
|
||||
private int id;
|
||||
@@ -77,6 +109,8 @@
|
||||
@@ -55,7 +87,7 @@
|
||||
protected Random random;
|
||||
public int ticksLived;
|
||||
public int maxFireTicks;
|
||||
- private int fireTicks;
|
||||
+ public int fireTicks; // CraftBukkit - public
|
||||
protected boolean inWater;
|
||||
public int noDamageTicks;
|
||||
protected boolean justCreated;
|
||||
@@ -79,6 +111,8 @@
|
||||
private boolean invulnerable;
|
||||
public UUID uniqueID;
|
||||
private final CommandObjectiveExecutor as;
|
||||
protected UUID uniqueID;
|
||||
private final CommandObjectiveExecutor au;
|
||||
+ public boolean valid; // CraftBukkit
|
||||
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
@@ -135,7 +169,8 @@
|
||||
@@ -137,7 +171,7 @@
|
||||
this.dead = true;
|
||||
}
|
||||
|
||||
- protected void a(float f, float f1) {
|
||||
+ // PAIL: Access + rename please
|
||||
+ public void a(float f, float f1) { // CraftBukkit - protected to public
|
||||
- protected void setSize(float f, float f1) {
|
||||
+ public void setSize(float f, float f1) { // CraftBukkit - public
|
||||
if (f != this.width || f1 != this.length) {
|
||||
float f2 = this.width;
|
||||
|
||||
@@ -150,6 +185,33 @@
|
||||
@@ -152,6 +186,33 @@
|
||||
}
|
||||
|
||||
protected void setYawPitch(float f, float f1) {
|
||||
@@ -94,7 +102,7 @@
|
||||
this.yaw = f % 360.0F;
|
||||
this.pitch = f1 % 360.0F;
|
||||
}
|
||||
@@ -186,7 +248,7 @@
|
||||
@@ -188,7 +249,7 @@
|
||||
int i = this.L();
|
||||
|
||||
if (this.ak) {
|
||||
@@ -102,8 +110,8 @@
|
||||
+ if (true || minecraftserver.getAllowNether()) { // CraftBukkit
|
||||
if (this.vehicle == null && this.al++ >= i) {
|
||||
this.al = i;
|
||||
this.portalCooldown = this.ar();
|
||||
@@ -263,6 +325,27 @@
|
||||
this.portalCooldown = this.aq();
|
||||
@@ -265,6 +326,27 @@
|
||||
protected void burnFromLava() {
|
||||
if (!this.fireProof) {
|
||||
this.damageEntity(DamageSource.LAVA, 4.0F);
|
||||
@@ -131,7 +139,7 @@
|
||||
this.setOnFire(15);
|
||||
}
|
||||
}
|
||||
@@ -300,6 +383,22 @@
|
||||
@@ -302,6 +384,22 @@
|
||||
this.a(this.getBoundingBox().c(d0, d1, d2));
|
||||
this.recalcPosition();
|
||||
} else {
|
||||
@@ -154,7 +162,7 @@
|
||||
this.world.methodProfiler.a("move");
|
||||
double d3 = this.locX;
|
||||
double d4 = this.locY;
|
||||
@@ -520,6 +619,26 @@
|
||||
@@ -522,6 +620,26 @@
|
||||
block.a(this.world, this);
|
||||
}
|
||||
|
||||
@@ -178,23 +186,23 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (this.r_() && !flag && this.vehicle == null) {
|
||||
if (this.s_() && !flag && this.vehicle == null) {
|
||||
double d21 = this.locX - d3;
|
||||
double d22 = this.locY - d4;
|
||||
@@ -530,7 +649,7 @@
|
||||
@@ -532,7 +650,7 @@
|
||||
}
|
||||
|
||||
if (block != null && this.onGround) {
|
||||
- block.a(this.world, blockposition, this);
|
||||
+ // block.a(this.world, blockposition, this); // CraftBukkit removed down
|
||||
+ // block.a(this.world, blockposition, this); // CraftBukkit moved down
|
||||
}
|
||||
|
||||
this.M = (float) ((double) this.M + (double) MathHelper.sqrt(d21 * d21 + d23 * d23) * 0.6D);
|
||||
@@ -548,9 +667,12 @@
|
||||
@@ -550,9 +668,12 @@
|
||||
}
|
||||
|
||||
this.a(blockposition, block);
|
||||
+ block.a(this.world, blockposition, this); // CraftBukkit - moved from above
|
||||
+ block.a(this.world, blockposition, this); // CraftBukkit moved from above
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +211,7 @@
|
||||
try {
|
||||
this.checkBlockCollisions();
|
||||
} catch (Throwable throwable) {
|
||||
@@ -560,6 +682,8 @@
|
||||
@@ -562,6 +683,8 @@
|
||||
this.appendEntityCrashDetails(crashreportsystemdetails);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -212,7 +220,7 @@
|
||||
|
||||
boolean flag2 = this.U();
|
||||
|
||||
@@ -567,7 +691,16 @@
|
||||
@@ -569,7 +692,16 @@
|
||||
this.burn(1);
|
||||
if (!flag2) {
|
||||
++this.fireTicks;
|
||||
@@ -230,7 +238,7 @@
|
||||
this.setOnFire(8);
|
||||
}
|
||||
}
|
||||
@@ -673,7 +806,7 @@
|
||||
@@ -675,7 +807,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -239,7 +247,7 @@
|
||||
if (!this.fireProof) {
|
||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||
}
|
||||
@@ -823,6 +956,13 @@
|
||||
@@ -818,6 +950,13 @@
|
||||
}
|
||||
|
||||
public void spawnIn(World world) {
|
||||
@@ -253,7 +261,7 @@
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@@ -1015,6 +1155,18 @@
|
||||
@@ -1010,6 +1149,18 @@
|
||||
try {
|
||||
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ}));
|
||||
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
|
||||
@@ -272,7 +280,7 @@
|
||||
nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
|
||||
nbttagcompound.setFloat("FallDistance", this.fallDistance);
|
||||
nbttagcompound.setShort("Fire", (short) this.fireTicks);
|
||||
@@ -1025,6 +1177,11 @@
|
||||
@@ -1020,6 +1171,11 @@
|
||||
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
|
||||
nbttagcompound.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits());
|
||||
nbttagcompound.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits());
|
||||
@@ -284,15 +292,16 @@
|
||||
if (this.getCustomName() != null && this.getCustomName().length() > 0) {
|
||||
nbttagcompound.setString("CustomName", this.getCustomName());
|
||||
nbttagcompound.setBoolean("CustomNameVisible", this.getCustomNameVisible());
|
||||
@@ -1062,6 +1219,7 @@
|
||||
@@ -1057,6 +1213,8 @@
|
||||
this.motX = nbttaglist1.d(0);
|
||||
this.motY = nbttaglist1.d(1);
|
||||
this.motZ = nbttaglist1.d(2);
|
||||
+
|
||||
+ /* CraftBukkit start - Moved section down
|
||||
if (Math.abs(this.motX) > 10.0D) {
|
||||
this.motX = 0.0D;
|
||||
}
|
||||
@@ -1073,6 +1231,7 @@
|
||||
@@ -1068,6 +1226,7 @@
|
||||
if (Math.abs(this.motZ) > 10.0D) {
|
||||
this.motZ = 0.0D;
|
||||
}
|
||||
@@ -300,10 +309,10 @@
|
||||
|
||||
this.lastX = this.P = this.locX = nbttaglist.d(0);
|
||||
this.lastY = this.Q = this.locY = nbttaglist.d(1);
|
||||
@@ -1105,7 +1264,57 @@
|
||||
if (this.af()) {
|
||||
@@ -1103,6 +1262,58 @@
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ if (this instanceof EntityLiving) {
|
||||
+ EntityLiving entity = (EntityLiving) this;
|
||||
@@ -315,7 +324,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
+
|
||||
+ // CraftBukkit start - Exempt Vehicles from notch's sanity check
|
||||
+ if (!(getBukkitEntity() instanceof Vehicle)) {
|
||||
+ if (Math.abs(this.motX) > 10.0D) {
|
||||
@@ -355,10 +364,11 @@
|
||||
+ spawnIn(bworld == null? null : ((CraftWorld) bworld).getHandle());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
||||
@@ -1167,6 +1376,12 @@
|
||||
@@ -1164,6 +1375,12 @@
|
||||
|
||||
public EntityItem a(ItemStack itemstack, float f) {
|
||||
if (itemstack.count != 0 && itemstack.getItem() != null) {
|
||||
@@ -371,7 +381,7 @@
|
||||
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
|
||||
|
||||
entityitem.p();
|
||||
@@ -1275,17 +1490,70 @@
|
||||
@@ -1277,17 +1494,70 @@
|
||||
return (double) this.length * 0.75D;
|
||||
}
|
||||
|
||||
@@ -391,8 +401,8 @@
|
||||
+ PluginManager pluginManager = Bukkit.getPluginManager();
|
||||
+ getBukkitEntity(); // make sure bukkitEntity is initialised
|
||||
+ // CraftBukkit end
|
||||
this.ap = 0.0D;
|
||||
this.aq = 0.0D;
|
||||
this.ar = 0.0D;
|
||||
this.as = 0.0D;
|
||||
if (entity == null) {
|
||||
if (this.vehicle != null) {
|
||||
+ // CraftBukkit start
|
||||
@@ -442,7 +452,7 @@
|
||||
if (this.vehicle != null) {
|
||||
this.vehicle.passenger = null;
|
||||
}
|
||||
@@ -1406,10 +1674,50 @@
|
||||
@@ -1406,10 +1676,49 @@
|
||||
}
|
||||
|
||||
public void onLightningStrike(EntityLightning entitylightning) {
|
||||
@@ -483,7 +493,7 @@
|
||||
+ // CraftBukkit end
|
||||
++this.fireTicks;
|
||||
if (this.fireTicks == 0) {
|
||||
this.setOnFire(8);
|
||||
- this.setOnFire(8);
|
||||
+ // CraftBukkit start - Call a combust event when lightning strikes
|
||||
+ EntityCombustByEntityEvent entityCombustEvent = new EntityCombustByEntityEvent(stormBukkitEntity, thisBukkitEntity, 8);
|
||||
+ pluginManager.callEvent(entityCombustEvent);
|
||||
@@ -494,8 +504,8 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1546,32 +1854,82 @@
|
||||
if (!this.world.isStatic && !this.dead) {
|
||||
@@ -1550,32 +1859,83 @@
|
||||
if (!this.world.isClientSide && !this.dead) {
|
||||
this.world.methodProfiler.a("changeDimension");
|
||||
MinecraftServer minecraftserver = MinecraftServer.getServer();
|
||||
- int j = this.dimension;
|
||||
@@ -568,8 +578,8 @@
|
||||
|
||||
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
|
||||
}
|
||||
-
|
||||
+ // CraftBukkit end */
|
||||
|
||||
worldserver1.addEntity(entity);
|
||||
+ // CraftBukkit start - Forward the CraftEntity to the new entity
|
||||
+ this.getBukkitEntity().setHandle(entity);
|
||||
@@ -582,13 +592,11 @@
|
||||
}
|
||||
|
||||
this.dead = true;
|
||||
@@ -1680,8 +2038,27 @@
|
||||
return this.boundingBox;
|
||||
@@ -1721,7 +2081,26 @@
|
||||
}
|
||||
|
||||
- public void a(AxisAlignedBB axisalignedbb) {
|
||||
public void a(AxisAlignedBB axisalignedbb) {
|
||||
- this.boundingBox = axisalignedbb;
|
||||
+ public void a(AxisAlignedBB axisalignedbb) {
|
||||
+ // CraftBukkit start - block invalid bounding boxes
|
||||
+ double a = axisalignedbb.a,
|
||||
+ b = axisalignedbb.b,
|
||||
|
||||
Reference in New Issue
Block a user