Paper/nms-patches/CommandSpreadPlayers.patch

43 lines
1.6 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-12-25 22:00:00 +01:00
@@ -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 @@
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-12-25 22:00:00 +01:00
@@ -282,7 +282,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();
2018-12-25 22:00:00 +01:00
@@ -294,5 +294,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
}
}