13
0
geforkt von Mirrors/Paper
Paper/nms-patches/CommandSpreadPlayers.patch

43 Zeilen
2.0 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java
2020-06-25 02:00:00 +02:00
@@ -61,7 +61,7 @@
2018-12-25 22:00:00 +01:00
if (entity instanceof EntityHuman) {
set.add(entity.getScoreboardTeam());
} else {
- set.add((Object) null);
+ set.add((ScoreboardTeamBase) null); // CraftBukkit - decompile error
}
}
2020-06-25 02:00:00 +02:00
@@ -270,7 +270,7 @@
2015-02-26 23:41:06 +01:00
2020-06-25 02:00:00 +02:00
for (boolean flag2 = iblockaccess.getType(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > 0; flag2 = flag1) {
blockposition_mutableblockposition.c(EnumDirection.DOWN);
- flag1 = iblockaccess.getType(blockposition_mutableblockposition).isAir();
+ flag1 = getType(iblockaccess, blockposition_mutableblockposition).isAir(); // CraftBukkit
if (!flag1 && flag2 && flag) {
return blockposition_mutableblockposition.getY() + 1;
2015-02-26 23:41:06 +01:00
}
2020-06-25 02:00:00 +02:00
@@ -283,7 +283,7 @@
2015-02-26 23:41:06 +01:00
2020-06-25 02:00:00 +02:00
public boolean b(IBlockAccess iblockaccess, int i) {
BlockPosition blockposition = new BlockPosition(this.a, (double) (this.a(iblockaccess, i) - 1), this.b);
- IBlockData iblockdata = iblockaccess.getType(blockposition);
+ IBlockData iblockdata = getType(iblockaccess, blockposition); // CraftBukkit
2018-07-15 02:00:00 +02:00
Material material = iblockdata.getMaterial();
2020-06-25 02:00:00 +02:00
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
@@ -293,5 +293,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) {
2020-06-25 02:00:00 +02:00
+ ((WorldServer) iblockaccess).getChunkProvider().getChunkAt(position.getX() >> 4, position.getZ() >> 4, true);
2018-07-15 02:00:00 +02:00
+ return iblockaccess.getType(position);
2015-02-26 23:41:06 +01:00
+ }
+ // CraftBukkit end
}
}