3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00
Paper/nms-patches/CommandSpreadPlayers.patch
2019-04-23 12:00:00 +10:00

43 Zeilen
1.6 KiB
Diff

--- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java
@@ -58,7 +58,7 @@
if (entity instanceof EntityHuman) {
set.add(entity.getScoreboardTeam());
} else {
- set.add((Object) null);
+ set.add((ScoreboardTeamBase) null); // CraftBukkit - decompile error
}
}
@@ -266,7 +266,7 @@
}
blockposition = blockposition.down();
- } while (iblockaccess.getType(blockposition).isAir());
+ } while (getType(iblockaccess, blockposition).isAir()); // CraftBukkit
return blockposition.getY() + 1;
}
@@ -282,7 +282,7 @@
}
blockposition = blockposition.down();
- iblockdata = iblockaccess.getType(blockposition);
+ iblockdata = getType(iblockaccess, blockposition); // CraftBukkit
} while (iblockdata.isAir());
Material material = iblockdata.getMaterial();
@@ -294,5 +294,12 @@
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
+ private static IBlockData getType(IBlockAccess iblockaccess, BlockPosition position) {
+ ((ChunkProviderServer) ((World) iblockaccess).chunkProvider).getChunkAt(position.getX() >> 4, position.getZ() >> 4, true);
+ return iblockaccess.getType(position);
+ }
+ // CraftBukkit end
}
}