mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 12:43:52 -07:00
improve the jackass test
This commit is contained in:
@@ -13,8 +13,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start - Try to catch plugins doing indecent things
|
+ // Paper start - Try to catch plugins doing indecent things
|
||||||
+ if (entity.aa && entity.getChunkX() == this.locX && entity.getChunkY() == k && entity.getChunkZ() == this.locZ) {
|
+ if (entity.aa) {
|
||||||
+ throw new IllegalStateException("Hey Jackass don't do that.");
|
+ boolean thisChunk = entity.getChunkX() == this.locX && entity.getChunkY() == k && entity.getChunkZ() == this.locZ;
|
||||||
|
+ String chunkName = entity.getWorld().getWorld().getName() + ":" + entity.getChunkX() + "," + entity.getChunkY() + "," + entity.getChunkZ();
|
||||||
|
+ if (!thisChunk) {
|
||||||
|
+ throw new IllegalStateException("Entity Already in another chunk: " + chunkName);
|
||||||
|
+ } else if (this.entitySlices[k].contains(entity)) {
|
||||||
|
+ throw new IllegalStateException("Double Chunk Add to: " + chunkName);
|
||||||
|
+ } else {
|
||||||
|
+ for (int i1 = 0; i1 < this.entitySlices.length; i1++) {
|
||||||
|
+ if (this.entitySlices[i1].contains(entity)) {
|
||||||
|
+ throw new IllegalStateException("Entity was found in another slice of this chunk, tried: " + k + ", was in: " + chunkName);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ new Throwable("Improperly detected double chunk add. Was not actually in this chunk.").printStackTrace();
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
|
Reference in New Issue
Block a user