SPIGOT-2033: Re-add missed diff for entity.valid

This commit is contained in:
Aikar 2016-03-28 20:19:29 -04:00 committed by md_5
parent fc9ee90fc5
commit 44216f12ed

View File

@ -318,7 +318,15 @@
} }
protected void c(Entity entity) { protected void c(Entity entity) {
@@ -787,7 +998,15 @@ @@ -752,6 +963,7 @@
((IWorldAccess) this.u.get(i)).b(entity);
}
+ entity.valid = false; // CraftBukkit
}
public void kill(Entity entity) {
@@ -787,7 +999,15 @@
this.getChunkAt(i, j).b(entity); this.getChunkAt(i, j).b(entity);
} }
@ -335,7 +343,7 @@
this.c(entity); this.c(entity);
} }
@@ -1039,6 +1258,11 @@ @@ -1039,6 +1259,11 @@
for (i = 0; i < this.j.size(); ++i) { for (i = 0; i < this.j.size(); ++i) {
entity = (Entity) this.j.get(i); entity = (Entity) this.j.get(i);
@ -347,7 +355,7 @@
try { try {
++entity.ticksLived; ++entity.ticksLived;
@@ -1087,8 +1311,10 @@ @@ -1087,8 +1312,10 @@
CrashReportSystemDetails crashreportsystemdetails1; CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1; CrashReport crashreport1;
@ -360,7 +368,7 @@
Entity entity1 = entity.by(); Entity entity1 = entity.by();
if (entity1 != null) { if (entity1 != null) {
@@ -1121,7 +1347,7 @@ @@ -1121,7 +1348,7 @@
this.getChunkAt(j, l).b(entity); this.getChunkAt(j, l).b(entity);
} }
@ -369,7 +377,7 @@
this.c(entity); this.c(entity);
} }
@@ -1130,6 +1356,13 @@ @@ -1130,6 +1357,13 @@
this.methodProfiler.c("blockEntities"); this.methodProfiler.c("blockEntities");
this.M = true; this.M = true;
@ -383,7 +391,7 @@
Iterator iterator = this.tileEntityListTick.iterator(); Iterator iterator = this.tileEntityListTick.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1140,7 +1373,7 @@ @@ -1140,7 +1374,7 @@
if (this.isLoaded(blockposition) && this.N.a(blockposition)) { if (this.isLoaded(blockposition) && this.N.a(blockposition)) {
try { try {
@ -392,7 +400,7 @@
((ITickable) tileentity).c(); ((ITickable) tileentity).c();
this.methodProfiler.b(); this.methodProfiler.b();
} catch (Throwable throwable2) { } catch (Throwable throwable2) {
@@ -1162,11 +1395,13 @@ @@ -1162,11 +1396,13 @@
} }
this.M = false; this.M = false;
@ -406,7 +414,7 @@
this.methodProfiler.c("pendingBlockEntities"); this.methodProfiler.c("pendingBlockEntities");
if (!this.b.isEmpty()) { if (!this.b.isEmpty()) {
@@ -1174,9 +1409,11 @@ @@ -1174,9 +1410,11 @@
TileEntity tileentity1 = (TileEntity) this.b.get(i1); TileEntity tileentity1 = (TileEntity) this.b.get(i1);
if (!tileentity1.x()) { if (!tileentity1.x()) {
@ -418,7 +426,7 @@
if (this.isLoaded(tileentity1.getPosition())) { if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
@@ -1184,6 +1421,12 @@ @@ -1184,6 +1422,12 @@
chunk.a(tileentity1.getPosition(), tileentity1); chunk.a(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@ -431,7 +439,7 @@
} }
} }
} }
@@ -1231,7 +1474,10 @@ @@ -1231,7 +1475,10 @@
int j = MathHelper.floor(entity.locZ); int j = MathHelper.floor(entity.locZ);
byte b0 = 32; byte b0 = 32;
@ -443,7 +451,7 @@
entity.M = entity.locX; entity.M = entity.locX;
entity.N = entity.locY; entity.N = entity.locY;
entity.O = entity.locZ; entity.O = entity.locZ;
@@ -1570,10 +1816,18 @@ @@ -1570,10 +1817,18 @@
} }
} }
@ -462,7 +470,7 @@
TileEntity tileentity = null; TileEntity tileentity = null;
int i; int i;
TileEntity tileentity1; TileEntity tileentity1;
@@ -1608,6 +1862,14 @@ @@ -1608,6 +1863,14 @@
public void setTileEntity(BlockPosition blockposition, TileEntity tileentity) { public void setTileEntity(BlockPosition blockposition, TileEntity tileentity) {
if (tileentity != null && !tileentity.x()) { if (tileentity != null && !tileentity.x()) {
@ -477,7 +485,7 @@
if (this.M) { if (this.M) {
tileentity.a(blockposition); tileentity.a(blockposition);
Iterator iterator = this.b.iterator(); Iterator iterator = this.b.iterator();
@@ -1762,6 +2024,14 @@ @@ -1762,6 +2025,14 @@
} }
this.o = MathHelper.a(this.o, 0.0F, 1.0F); this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@ -492,7 +500,7 @@
} }
} }
} }
@@ -1893,7 +2163,10 @@ @@ -1893,7 +2164,10 @@
} }
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@ -504,7 +512,7 @@
return false; return false;
} else { } else {
int i = 0; int i = 0;
@@ -2058,7 +2331,7 @@ @@ -2058,7 +2332,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -513,7 +521,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2073,7 +2346,7 @@ @@ -2073,7 +2347,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -522,7 +530,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2121,7 +2394,7 @@ @@ -2121,7 +2395,7 @@
} }
} }
@ -531,7 +539,7 @@
} }
public Entity getEntity(int i) { public Entity getEntity(int i) {
@@ -2141,8 +2414,17 @@ @@ -2141,8 +2415,17 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -551,7 +559,7 @@
++i; ++i;
} }
} }
@@ -2151,12 +2433,18 @@ @@ -2151,12 +2434,18 @@
} }
public void a(Collection<Entity> collection) { public void a(Collection<Entity> collection) {
@ -571,7 +579,7 @@
this.b(entity); this.b(entity);
} }
@@ -2170,7 +2458,13 @@ @@ -2170,7 +2459,13 @@
IBlockData iblockdata = this.getType(blockposition); IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition); AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition);
@ -586,7 +594,7 @@
} }
public int K() { public int K() {
@@ -2270,6 +2564,11 @@ @@ -2270,6 +2565,11 @@
for (int i = 0; i < this.players.size(); ++i) { for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@ -598,7 +606,7 @@
if ((IEntitySelector.d.apply(entityhuman1) || !flag) && (IEntitySelector.e.apply(entityhuman1) || flag)) { if ((IEntitySelector.d.apply(entityhuman1) || !flag) && (IEntitySelector.e.apply(entityhuman1) || flag)) {
double d5 = entityhuman1.e(d0, d1, d2); double d5 = entityhuman1.e(d0, d1, d2);
@@ -2433,6 +2732,16 @@ @@ -2433,6 +2733,16 @@
public void everyoneSleeping() {} public void everyoneSleeping() {}
@ -615,7 +623,7 @@
public float h(float f) { public float h(float f) {
return (this.p + (this.q - this.p) * f) * this.j(f); return (this.p + (this.q - this.p) * f) * this.j(f);
} }
@@ -2648,7 +2957,7 @@ @@ -2648,7 +2958,7 @@
int l = j * 16 + 8 - blockposition.getZ(); int l = j * 16 + 8 - blockposition.getZ();
short short0 = 128; short short0 = 128;