summaryrefslogtreecommitdiffstats
path: root/nms-patches/World.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/World.patch')
-rw-r--r--nms-patches/World.patch74
1 files changed, 37 insertions, 37 deletions
diff --git a/nms-patches/World.patch b/nms-patches/World.patch
index 96a84cb6..66a3bd5a 100644
--- a/nms-patches/World.patch
+++ b/nms-patches/World.patch
@@ -238,7 +238,7 @@
iblockdata.doPhysics(this, blockposition, block);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
-@@ -526,6 +690,17 @@
+@@ -530,6 +694,17 @@
}
public IBlockData getType(BlockPosition blockposition) {
@@ -256,7 +256,7 @@
if (this.E(blockposition)) {
return Blocks.AIR.getBlockData();
} else {
-@@ -724,6 +899,13 @@
+@@ -728,6 +903,13 @@
}
public boolean addEntity(Entity entity) {
@@ -270,7 +270,7 @@
int i = MathHelper.floor(entity.locX / 16.0D);
int j = MathHelper.floor(entity.locZ / 16.0D);
boolean flag = entity.attachedToPlayer;
-@@ -732,6 +914,34 @@
+@@ -736,6 +918,34 @@
flag = true;
}
@@ -305,7 +305,7 @@
if (!flag && !this.isChunkLoaded(i, j, false)) {
return false;
} else {
-@@ -754,6 +964,7 @@
+@@ -758,6 +968,7 @@
((IWorldAccess) this.u.get(i)).a(entity);
}
@@ -313,7 +313,7 @@
}
protected void c(Entity entity) {
-@@ -761,6 +972,7 @@
+@@ -765,6 +976,7 @@
((IWorldAccess) this.u.get(i)).b(entity);
}
@@ -321,7 +321,7 @@
}
public void kill(Entity entity) {
-@@ -796,7 +1008,15 @@
+@@ -800,7 +1012,15 @@
this.getChunkAt(i, j).b(entity);
}
@@ -338,7 +338,7 @@
this.c(entity);
}
-@@ -1044,6 +1264,11 @@
+@@ -1048,6 +1268,11 @@
for (i = 0; i < this.j.size(); ++i) {
entity = (Entity) this.j.get(i);
@@ -350,7 +350,7 @@
try {
++entity.ticksLived;
-@@ -1092,8 +1317,10 @@
+@@ -1096,8 +1321,10 @@
CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1;
@@ -360,10 +360,10 @@
+ for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) {
+ entity = (Entity) this.entityList.get(this.tickPosition);
+ // CraftBukkit end
- Entity entity1 = entity.bz();
+ Entity entity1 = entity.bB();
if (entity1 != null) {
-@@ -1126,7 +1353,7 @@
+@@ -1130,7 +1357,7 @@
this.getChunkAt(j, l).b(entity);
}
@@ -372,7 +372,7 @@
this.c(entity);
}
-@@ -1135,6 +1362,13 @@
+@@ -1139,6 +1366,13 @@
this.methodProfiler.c("blockEntities");
this.M = true;
@@ -386,16 +386,16 @@
Iterator iterator = this.tileEntityListTick.iterator();
while (iterator.hasNext()) {
-@@ -1145,7 +1379,7 @@
+@@ -1149,7 +1383,7 @@
if (this.isLoaded(blockposition) && this.N.a(blockposition)) {
try {
- this.methodProfiler.a(tileentity.getClass().getSimpleName());
+ this.methodProfiler.a(""/*tileentity.getClass().getSimpleName()*/); // CraftBukkit: SPIGOT-1900
- ((ITickable) tileentity).c();
+ ((ITickable) tileentity).E_();
this.methodProfiler.b();
} catch (Throwable throwable2) {
-@@ -1167,11 +1401,13 @@
+@@ -1171,11 +1405,13 @@
}
this.M = false;
@@ -409,7 +409,7 @@
this.methodProfiler.c("pendingBlockEntities");
if (!this.b.isEmpty()) {
-@@ -1179,9 +1415,11 @@
+@@ -1183,9 +1419,11 @@
TileEntity tileentity1 = (TileEntity) this.b.get(i1);
if (!tileentity1.x()) {
@@ -421,7 +421,7 @@
if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
-@@ -1189,6 +1427,12 @@
+@@ -1193,6 +1431,12 @@
chunk.a(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@@ -434,11 +434,11 @@
}
}
}
-@@ -1236,7 +1480,10 @@
+@@ -1240,7 +1484,10 @@
int j = MathHelper.floor(entity.locZ);
- byte b0 = 32;
+ boolean flag1 = true;
-- if (!flag || this.isAreaLoaded(i - b0, 0, j - b0, i + b0, 0, j + b0, true)) {
+- if (!flag || this.isAreaLoaded(i - 32, 0, j - 32, i + 32, 0, j + 32, true)) {
+ // CraftBukkit start - Use neighbor cache instead of looking up
+ Chunk startingChunk = this.getChunkIfLoaded(i >> 4, j >> 4);
+ if (!flag || (startingChunk != null && startingChunk.areNeighborsLoaded(2)) /* this.isAreaLoaded(i - b0, 0, j - b0, i + b0, 0, j + b0) */) {
@@ -446,7 +446,7 @@
entity.M = entity.locX;
entity.N = entity.locY;
entity.O = entity.locZ;
-@@ -1575,11 +1822,18 @@
+@@ -1579,11 +1826,18 @@
}
}
@@ -465,22 +465,22 @@
TileEntity tileentity = null;
if (this.M) {
-@@ -1614,6 +1868,14 @@
+@@ -1618,6 +1872,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!this.E(blockposition)) {
if (tileentity != null && !tileentity.x()) {
+ // CraftBukkit start
+ if (captureBlockStates) {
+ tileentity.a(this);
-+ tileentity.a(blockposition);
++ tileentity.setPosition(blockposition);
+ capturedTileEntities.put(blockposition, tileentity);
+ return;
+ }
+ // CraftBukkit end
if (this.M) {
- tileentity.a(blockposition);
+ tileentity.setPosition(blockposition);
Iterator iterator = this.b.iterator();
-@@ -1769,6 +2031,14 @@
+@@ -1773,6 +2035,14 @@
}
this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@@ -495,7 +495,7 @@
}
}
}
-@@ -1900,7 +2170,10 @@
+@@ -1904,7 +2174,10 @@
}
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@@ -507,7 +507,7 @@
return false;
} else {
int i = 0;
-@@ -2067,7 +2340,7 @@
+@@ -2071,7 +2344,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -516,7 +516,7 @@
arraylist.add(entity);
}
}
-@@ -2082,7 +2355,7 @@
+@@ -2086,7 +2359,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -525,7 +525,7 @@
arraylist.add(entity);
}
}
-@@ -2131,7 +2404,7 @@
+@@ -2135,7 +2408,7 @@
}
}
@@ -534,7 +534,7 @@
}
@Nullable
-@@ -2152,8 +2425,17 @@
+@@ -2156,8 +2429,17 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -554,7 +554,7 @@
++i;
}
}
-@@ -2162,12 +2444,18 @@
+@@ -2166,12 +2448,18 @@
}
public void a(Collection<Entity> collection) {
@@ -574,7 +574,7 @@
this.b(entity);
}
-@@ -2181,7 +2469,13 @@
+@@ -2185,7 +2473,13 @@
IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().d(this, blockposition);
@@ -589,7 +589,7 @@
}
public int K() {
-@@ -2284,6 +2578,11 @@
+@@ -2288,6 +2582,11 @@
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@@ -601,7 +601,7 @@
if ((IEntitySelector.d.apply(entityhuman1) || !flag) && (IEntitySelector.e.apply(entityhuman1) || flag)) {
double d5 = entityhuman1.e(d0, d1, d2);
-@@ -2452,6 +2751,16 @@
+@@ -2456,6 +2755,16 @@
public void everyoneSleeping() {}
@@ -618,12 +618,12 @@
public float h(float f) {
return (this.p + (this.q - this.p) * f) * this.j(f);
}
-@@ -2669,7 +2978,7 @@
+@@ -2673,7 +2982,7 @@
int l = j * 16 + 8 - blockposition.getZ();
- short short0 = 128;
+ boolean flag = true;
-- return k >= -short0 && k <= short0 && l >= -short0 && l <= short0;
-+ return k >= -short0 && k <= short0 && l >= -short0 && l <= short0 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory'
+- return k >= -128 && k <= 128 && l >= -128 && l <= 128;
++ return k >= -128 && k <= 128 && l >= -128 && l <= 128 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory'
}
public void a(Packet<?> packet) {