SPIGOT-5727: GameRule doImmediateRespawn cannot be set per-world

This commit is contained in:
ShaneBeee 2020-05-09 15:45:52 +10:00 committed by md_5
parent 933e9094bf
commit 214ffea95e

View File

@ -627,7 +627,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutWorldBorder(worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE));
entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)));
@@ -643,17 +917,26 @@
@@ -643,17 +917,28 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
if (worldserver.isRaining()) {
@ -654,11 +654,13 @@
+ // CraftBukkit start - from GameRules
+ int i = entityplayer.world.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23;
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) i));
+ float immediateRespawn = entityplayer.world.getGameRules().getBoolean(GameRules.DO_IMMEDIATE_RESPAWN) ? 1.0F: 0.0F;
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(11, immediateRespawn));
+ // CraftBukkit end
}
public int getPlayerCount() {
@@ -710,33 +993,52 @@
@@ -710,33 +995,52 @@
}
public void shutdown() {
@ -718,7 +720,7 @@
if (file2.exists() && file2.isFile()) {
file2.renameTo(file1);
@@ -744,7 +1046,7 @@
@@ -744,7 +1048,7 @@
}
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
@ -727,7 +729,7 @@
}
return serverstatisticmanager;
@@ -752,14 +1054,14 @@
@@ -752,14 +1056,14 @@
public AdvancementDataPlayer f(EntityPlayer entityplayer) {
UUID uuid = entityplayer.getUniqueID();
@ -744,7 +746,7 @@
}
advancementdataplayer.a(entityplayer);
@@ -795,13 +1097,20 @@
@@ -795,13 +1099,20 @@
}
public void reload() {