mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
25f3b50f6b
By: md_5 <git@md-5.net>
42 lines
2.1 KiB
Diff
42 lines
2.1 KiB
Diff
--- a/net/minecraft/server/commands/CommandSpreadPlayers.java
|
|
+++ b/net/minecraft/server/commands/CommandSpreadPlayers.java
|
|
@@ -90,7 +90,7 @@
|
|
if (entity instanceof EntityHuman) {
|
|
set.add(entity.getTeam());
|
|
} else {
|
|
- set.add((Object) null);
|
|
+ set.add((ScoreboardTeamBase) null); // CraftBukkit - decompile error
|
|
}
|
|
}
|
|
|
|
@@ -299,7 +299,7 @@
|
|
|
|
for (boolean flag2 = iblockaccess.getBlockState(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > iblockaccess.getMinBuildHeight(); flag2 = flag1) {
|
|
blockposition_mutableblockposition.move(EnumDirection.DOWN);
|
|
- flag1 = iblockaccess.getBlockState(blockposition_mutableblockposition).isAir();
|
|
+ flag1 = getBlockState(iblockaccess, blockposition_mutableblockposition).isAir(); // CraftBukkit
|
|
if (!flag1 && flag2 && flag) {
|
|
return blockposition_mutableblockposition.getY() + 1;
|
|
}
|
|
@@ -312,7 +312,7 @@
|
|
|
|
public boolean isSafe(IBlockAccess iblockaccess, int i) {
|
|
BlockPosition blockposition = new BlockPosition(this.x, (double) (this.getSpawnY(iblockaccess, i) - 1), this.z);
|
|
- IBlockData iblockdata = iblockaccess.getBlockState(blockposition);
|
|
+ IBlockData iblockdata = getBlockState(iblockaccess, blockposition); // CraftBukkit
|
|
Material material = iblockdata.getMaterial();
|
|
|
|
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
|
|
@@ -322,5 +322,12 @@
|
|
this.x = MathHelper.nextDouble(randomsource, d0, d2);
|
|
this.z = MathHelper.nextDouble(randomsource, d1, d3);
|
|
}
|
|
+
|
|
+ // CraftBukkit start - add a version of getBlockState which force loads chunks
|
|
+ private static IBlockData getBlockState(IBlockAccess iblockaccess, BlockPosition position) {
|
|
+ ((WorldServer) iblockaccess).getChunkSource().getChunk(position.getX() >> 4, position.getZ() >> 4, true);
|
|
+ return iblockaccess.getBlockState(position);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|
|
}
|