SPIGOT-2966: Entirely remove problematic check

This commit is contained in:
md_5 2016-12-28 09:50:40 +11:00
parent f9e044059f
commit 70bc70b4ee

View File

@ -341,19 +341,7 @@
this.c(entity); this.c(entity);
} }
@@ -872,6 +1095,11 @@ @@ -974,7 +1197,7 @@
int l = MathHelper.f(axisalignedbb.e) + 1;
int i1 = MathHelper.floor(axisalignedbb.c) - 1;
int j1 = MathHelper.f(axisalignedbb.f) + 1;
+ // CraftBukkit start - filter out large ranges
+ if (entity instanceof EntityPlayer) {
+ com.google.common.base.Preconditions.checkArgument((j - i) * (l - k) * (j1 - i1) <= 32 * 32 * 32, "Filtered out large getCubes call %s,%s %s,%s %s,%s", i, j, k, l, i1, j1);
+ }
+ // CraftBukkit end
WorldBorder worldborder = this.getWorldBorder();
boolean flag1 = entity != null && entity.br();
boolean flag2 = entity != null && this.g(entity);
@@ -974,7 +1202,7 @@
} }
public boolean a(AxisAlignedBB axisalignedbb) { public boolean a(AxisAlignedBB axisalignedbb) {
@ -362,7 +350,7 @@
} }
public int a(float f) { public int a(float f) {
@@ -1044,6 +1272,11 @@ @@ -1044,6 +1267,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);
@ -374,7 +362,7 @@
try { try {
++entity.ticksLived; ++entity.ticksLived;
@@ -1092,8 +1325,10 @@ @@ -1092,8 +1320,10 @@
CrashReportSystemDetails crashreportsystemdetails1; CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1; CrashReport crashreport1;
@ -387,7 +375,7 @@
Entity entity1 = entity.bB(); Entity entity1 = entity.bB();
if (entity1 != null) { if (entity1 != null) {
@@ -1126,7 +1361,7 @@ @@ -1126,7 +1356,7 @@
this.getChunkAt(j, l).b(entity); this.getChunkAt(j, l).b(entity);
} }
@ -396,7 +384,7 @@
this.c(entity); this.c(entity);
} }
@@ -1135,6 +1370,13 @@ @@ -1135,6 +1365,13 @@
this.methodProfiler.c("blockEntities"); this.methodProfiler.c("blockEntities");
this.M = true; this.M = true;
@ -410,7 +398,7 @@
Iterator iterator = this.tileEntityListTick.iterator(); Iterator iterator = this.tileEntityListTick.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1145,7 +1387,7 @@ @@ -1145,7 +1382,7 @@
if (this.isLoaded(blockposition) && this.N.a(blockposition)) { if (this.isLoaded(blockposition) && this.N.a(blockposition)) {
try { try {
@ -419,7 +407,7 @@
((ITickable) tileentity).F_(); ((ITickable) tileentity).F_();
this.methodProfiler.b(); this.methodProfiler.b();
} catch (Throwable throwable2) { } catch (Throwable throwable2) {
@@ -1167,11 +1409,13 @@ @@ -1167,11 +1404,13 @@
} }
this.M = false; this.M = false;
@ -433,7 +421,7 @@
this.methodProfiler.c("pendingBlockEntities"); this.methodProfiler.c("pendingBlockEntities");
if (!this.b.isEmpty()) { if (!this.b.isEmpty()) {
@@ -1179,9 +1423,11 @@ @@ -1179,9 +1418,11 @@
TileEntity tileentity1 = (TileEntity) this.b.get(i1); TileEntity tileentity1 = (TileEntity) this.b.get(i1);
if (!tileentity1.y()) { if (!tileentity1.y()) {
@ -445,7 +433,7 @@
if (this.isLoaded(tileentity1.getPosition())) { if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
@@ -1189,6 +1435,12 @@ @@ -1189,6 +1430,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);
@ -458,7 +446,7 @@
} }
} }
} }
@@ -1243,7 +1495,10 @@ @@ -1243,7 +1490,10 @@
int j = MathHelper.floor(entity.locZ); int j = MathHelper.floor(entity.locZ);
boolean flag1 = true; boolean flag1 = true;
@ -470,7 +458,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;
@@ -1547,11 +1802,18 @@ @@ -1547,11 +1797,18 @@
} }
} }
@ -489,7 +477,7 @@
TileEntity tileentity = null; TileEntity tileentity = null;
if (this.M) { if (this.M) {
@@ -1586,6 +1848,14 @@ @@ -1586,6 +1843,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!this.E(blockposition)) { if (!this.E(blockposition)) {
if (tileentity != null && !tileentity.y()) { if (tileentity != null && !tileentity.y()) {
@ -504,7 +492,7 @@
if (this.M) { if (this.M) {
tileentity.setPosition(blockposition); tileentity.setPosition(blockposition);
Iterator iterator = this.b.iterator(); Iterator iterator = this.b.iterator();
@@ -1745,6 +2015,14 @@ @@ -1745,6 +2010,14 @@
} }
this.o = MathHelper.a(this.o, 0.0F, 1.0F); this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@ -519,7 +507,7 @@
} }
} }
} }
@@ -1876,7 +2154,10 @@ @@ -1876,7 +2149,10 @@
} }
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) { public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@ -531,7 +519,7 @@
return false; return false;
} else { } else {
int i = 0; int i = 0;
@@ -2043,7 +2324,7 @@ @@ -2043,7 +2319,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -540,7 +528,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2058,7 +2339,7 @@ @@ -2058,7 +2334,7 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -549,7 +537,7 @@
arraylist.add(entity); arraylist.add(entity);
} }
} }
@@ -2107,7 +2388,7 @@ @@ -2107,7 +2383,7 @@
} }
} }
@ -558,7 +546,7 @@
} }
@Nullable @Nullable
@@ -2128,8 +2409,17 @@ @@ -2128,8 +2404,17 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -578,7 +566,7 @@
++i; ++i;
} }
} }
@@ -2138,12 +2428,18 @@ @@ -2138,12 +2423,18 @@
} }
public void a(Collection<Entity> collection) { public void a(Collection<Entity> collection) {
@ -598,7 +586,7 @@
this.b(entity); this.b(entity);
} }
@@ -2157,7 +2453,13 @@ @@ -2157,7 +2448,13 @@
IBlockData iblockdata = this.getType(blockposition); IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().c(this, blockposition); AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().c(this, blockposition);
@ -613,7 +601,7 @@
} }
public int K() { public int K() {
@@ -2267,6 +2569,11 @@ @@ -2267,6 +2564,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);
@ -625,7 +613,7 @@
if (predicate.apply(entityhuman1)) { if (predicate.apply(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2); double d5 = entityhuman1.d(d0, d1, d2);
@@ -2435,6 +2742,16 @@ @@ -2435,6 +2737,16 @@
public void everyoneSleeping() {} public void everyoneSleeping() {}
@ -642,7 +630,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);
} }
@@ -2652,7 +2969,7 @@ @@ -2652,7 +2964,7 @@
int l = j * 16 + 8 - blockposition.getZ(); int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true; boolean flag = true;