Paper/nms-patches/CommandSpreadPlayers.patch

34 lines
1.3 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java
2018-07-15 02:00:00 +02:00
@@ -269,7 +269,7 @@
2015-02-26 23:41:06 +01:00
}
blockposition = blockposition.down();
2018-07-15 02:00:00 +02:00
- } while (iblockaccess.getType(blockposition).isAir());
+ } while (getType(iblockaccess, blockposition).isAir()); // CraftBukkit
2015-02-26 23:41:06 +01:00
return blockposition.getY() + 1;
}
2018-07-15 02:00:00 +02:00
@@ -285,7 +285,7 @@
2015-02-26 23:41:06 +01:00
}
blockposition = blockposition.down();
2018-07-15 02:00:00 +02:00
- iblockdata = iblockaccess.getType(blockposition);
+ iblockdata = getType(iblockaccess, blockposition); // CraftBukkit
} while (iblockdata.isAir());
2015-02-26 23:41:06 +01:00
2018-07-15 02:00:00 +02:00
Material material = iblockdata.getMaterial();
@@ -297,5 +297,12 @@
2015-02-26 23:41:06 +01:00
this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3);
}
+
+ // CraftBukkit start - add a version of getType which force loads chunks
2018-07-15 02:00:00 +02:00
+ private static IBlockData getType(IBlockAccess iblockaccess, BlockPosition position) {
2018-08-26 04:00:00 +02:00
+ ((ChunkProviderServer) ((World) iblockaccess).chunkProvider).getChunkAt(position.getX() >> 4, position.getZ() >> 4, true, true);
2018-07-15 02:00:00 +02:00
+ return iblockaccess.getType(position);
2015-02-26 23:41:06 +01:00
+ }
+ // CraftBukkit end
}
}