Updated Upstream (CraftBukkit)

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
5c77bd28 SPIGOT-6147: InventoryCloseEvent does not fire after closing player inventory
This commit is contained in:
Mariell Hoversholm 2020-10-01 15:16:32 +02:00 committed by Daniel Ennis
parent 7f23e2cab1
commit 8a046c95a4
22 changed files with 72 additions and 76 deletions

View File

@ -1541,7 +1541,7 @@ index 2c671629a43f42da8335e7216f9fd399bb878729..eb3269e0ea3ce33d08e9eee3bca7cf43
PlayerConnectionUtils.LOGGER.debug("Ignoring packet due to disconnection: " + packet);
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 35e474d07eea0a98d48cc073a2274a136f54798b..945d9c91bd967180a9fdacf75b66ca5a21c08a3a 100644
index b9387f4bfa598c4ad8a559a983f3499142d795cd..73ec13ff213ed52a4a5bb79cbd9079f1e74ced8a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1,5 +1,6 @@
@ -1551,7 +1551,7 @@ index 35e474d07eea0a98d48cc073a2274a136f54798b..945d9c91bd967180a9fdacf75b66ca5a
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -952,10 +953,11 @@ public abstract class PlayerList {
@@ -955,10 +956,11 @@ public abstract class PlayerList {
}
public void savePlayers() {
@ -1633,7 +1633,7 @@ index 67fdd560f8136d83a13f75e265d5f5dd11871375..8f51a1e5e37566001e1d419065ce7307
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f69c2055a33a9396e0df6554aa4e498ba0fd4e71..9836de9a748a5d7828d02a1831561f0d35d4b577 100644
index 4059aaf6da1bfe6003e2d94ce33e32eb1aaa93c9..07ba51a801d803109dd92f77c19b389eb24f61b2 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -18,7 +18,6 @@ import org.apache.logging.log4j.Logger;

View File

@ -57,7 +57,7 @@ index d1581c9d9838797eb425020d21bd0fba432e5652..99dc43159f240135957aee35f6129f19
packetdataserializer.a(this.c);
packetdataserializer.a(this.d);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index e68de1a715047ea83573ed963f1df50971bd85db..e11edff6b2b9242883931ed3a0cfc3045a12aee5 100644
index 7f76582918ce1ad48eb0feb9679cf2e2172f02db..0287576bf59128583454ca2f60ca05cb978a36d9 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -75,6 +75,7 @@ public abstract class PlayerList {
@ -82,7 +82,7 @@ index e68de1a715047ea83573ed963f1df50971bd85db..e11edff6b2b9242883931ed3a0cfc304
// CraftBukkit - Moved from above, added world
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, entityplayer.getId(), worldserver1.worldDataServer.getName(), entityplayer.locX(), entityplayer.locY(), entityplayer.locZ());
}
@@ -422,6 +430,16 @@ public abstract class PlayerList {
@@ -425,6 +433,16 @@ public abstract class PlayerList {
entityplayer.playerTick(); // SPIGOT-924
// CraftBukkit end
@ -99,7 +99,7 @@ index e68de1a715047ea83573ed963f1df50971bd85db..e11edff6b2b9242883931ed3a0cfc304
this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle();
@@ -1070,6 +1088,13 @@ public abstract class PlayerList {
@@ -1073,6 +1091,13 @@ public abstract class PlayerList {
}
// CraftBukkit end

View File

@ -7,10 +7,10 @@ Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index e11edff6b2b9242883931ed3a0cfc3045a12aee5..a7b813ef9f72dc89f9044a9121452b3801c4ab8c 100644
index 0287576bf59128583454ca2f60ca05cb978a36d9..4c787974629ce2d39317c7c36036b7e22b0dc35f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -972,11 +972,13 @@ public abstract class PlayerList {
@@ -975,11 +975,13 @@ public abstract class PlayerList {
}
public void savePlayers() {

View File

@ -73,10 +73,10 @@ index 9dd54bea5f9a7d1cb638100312855135f83bcaf9..3f1ab69ac09c0c5ab50a99961a705254
// Spigot Start
private static double calcTps(double avg, double exp, double tps)
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index a7b813ef9f72dc89f9044a9121452b3801c4ab8c..ab3c18b6d29397d1a7faff376043f6c3fe402f5d 100644
index 4c787974629ce2d39317c7c36036b7e22b0dc35f..6375d1061859ea9fa0faef93a92b90d4b38d5903 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1083,10 +1083,15 @@ public abstract class PlayerList {
@@ -1086,10 +1086,15 @@ public abstract class PlayerList {
entityplayer.playerInteractManager.b(worldserver.worldDataServer.getGameType()); // CraftBukkit
}
@ -93,7 +93,7 @@ index a7b813ef9f72dc89f9044a9121452b3801c4ab8c..ab3c18b6d29397d1a7faff376043f6c3
}
// CraftBukkit end
@@ -1098,6 +1103,7 @@ public abstract class PlayerList {
@@ -1101,6 +1106,7 @@ public abstract class PlayerList {
}
// Paper end
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index fb14381b5bfca33431879c8b6a8b559c5599ba4a..ea7527b16571cef5c285e898f5a9fd0c063948fa 100644
index 11ecafedb839454bfac009dec5d41ed45b08c1d4..3fa1ea2958bec57d40b702bdbdc511d67b165d7e 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -540,9 +540,9 @@ public abstract class PlayerList {
@@ -543,9 +543,9 @@ public abstract class PlayerList {
// return chatmessage;
if (!gameprofilebanentry.hasExpired()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage)); // Spigot
@ -20,7 +20,7 @@ index fb14381b5bfca33431879c8b6a8b559c5599ba4a..ea7527b16571cef5c285e898f5a9fd0c
} else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) {
IpBanEntry ipbanentry = this.l.get(socketaddress);
@@ -934,9 +934,25 @@ public abstract class PlayerList {
@@ -937,9 +937,25 @@ public abstract class PlayerList {
this.server.getCommandDispatcher().a(entityplayer);
}

View File

@ -34,7 +34,7 @@ index 0f7e162b342ac589dc357508a1dcd1ab02d1fe3e..cc20b73a993d021789840ed2ee7ba1fc
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 6a8327379e7520d31e5eb0a61893e6d9f23a6814..7ac4e006c76373d2aedb37adf22bbb3044f9e65b 100644
index e2ee907758f5cb5ff2cdb930ad705d38bf5638c8..daeb5a6e005a4b85b5f3ac581c0e7cb6ea64b2c8 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -412,7 +412,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -117,18 +117,18 @@ index c79db4e81883ce8635e91304b288f32e7bc2c763..19524eb45c313be977e8fd68fd3dd5e4
this.player.o();
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index ea7527b16571cef5c285e898f5a9fd0c063948fa..df8a92b082139c84afc32cf02541faa82c914d4f 100644
index 3fa1ea2958bec57d40b702bdbdc511d67b165d7e..129f4095cb98e1e4295b9a12105d06e239d96f6b 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -420,7 +420,7 @@ public abstract class PlayerList {
entityplayer.a(StatisticList.LEAVE_GAME);
@@ -422,7 +422,7 @@ public abstract class PlayerList {
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
- entityplayer.closeInventory();
+ entityplayer.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
// See SPIGOT-5799, SPIGOT-6145
if (entityplayer.activeContainer != entityplayer.defaultContainer) {
- entityplayer.closeInventory();
+ entityplayer.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
}
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
cserver.getPluginManager().callEvent(playerQuitEvent);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 530d55b569cbdf19df4ad39368dd20dc47bc7c97..3d7950ea51a533477d3569d9768ca20a1b6d0822 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
@ -193,7 +193,7 @@ index 23889ce169baf956cfb39f1ec21a8369f80c5555..25175230583bbd6fcfc864dcbae4111d
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e5fce28f7e2d544b98047aac2c3291e216e1d64e..0980c1f19340ac2bb044ff896f5ee6153c95bbd6 100644
index a0f7f69a79a11bc9be879a299e5130e96dc9b5b7..486613df75ea8a41a8a9424d8da4a20c5e39b941 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1173,7 +1173,7 @@ public class CraftEventFactory {
@ -205,7 +205,7 @@ index e5fce28f7e2d544b98047aac2c3291e216e1d64e..0980c1f19340ac2bb044ff896f5ee615
}
CraftServer server = player.world.getServer();
@@ -1338,12 +1338,22 @@ public class CraftEventFactory {
@@ -1338,8 +1338,18 @@ public class CraftEventFactory {
return event;
}
@ -216,15 +216,11 @@ index e5fce28f7e2d544b98047aac2c3291e216e1d64e..0980c1f19340ac2bb044ff896f5ee615
+ */
+ @Deprecated
public static void handleInventoryCloseEvent(EntityHuman human) {
- InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView());
+ handleInventoryCloseEvent(human, org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNKNOWN);
+ }
+ public static void handleInventoryCloseEvent(EntityHuman human, org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) {
+ // Paper end
// SPIGOT-5799 - no need to fire for when no inventory open
if (human.activeContainer == human.defaultContainer) {
return;
}
- InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView());
+ InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView(), reason); // Paper
human.world.getServer().getPluginManager().callEvent(event);
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());

View File

@ -122,10 +122,10 @@ index 5b01e4edb3c0f8bc785b70128cbe31b14356e4fb..9213bfb78e92b838189161045e394558
this.d.values().stream().map((jsonlistentry) -> {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index df8a92b082139c84afc32cf02541faa82c914d4f..bc31e882e77f5b8657107db1e3a830df4cf561e1 100644
index 129f4095cb98e1e4295b9a12105d06e239d96f6b..9a552465a262238614a6ee2a7e9118f9866d2441 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -543,7 +543,7 @@ public abstract class PlayerList {
@@ -546,7 +546,7 @@ public abstract class PlayerList {
} else if (!this.isWhitelisted(gameprofile, event)) { // Paper
chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted");
//event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot // Paper - moved to isWhitelisted

View File

@ -11,10 +11,10 @@ everything to the Whitelist object.
https://github.com/PaperMC/Paper/issues/1880
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 9a56f83e12c65cafe3d1fb00379b78e5ea59b3f1..e9c2fa0fe81320c5953b7dc4ec1cfdedc76068b6 100644
index 3af77481c1f4671602058be8f34504b302e20c9c..4f6784a80cd385dcc73b2b00b3865e8ce6546a9a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -941,9 +941,9 @@ public abstract class PlayerList {
@@ -944,9 +944,9 @@ public abstract class PlayerList {
}
public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) {
boolean isOp = this.operators.d(gameprofile);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index e9c2fa0fe81320c5953b7dc4ec1cfdedc76068b6..cb04de23dd8b506ebfd07d60acd082d6b7e14528 100644
index 4f6784a80cd385dcc73b2b00b3865e8ce6546a9a..19d8497d691e0ec6f4451298dcf4b4831062d5ed 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1059,6 +1059,7 @@ public abstract class PlayerList {
@@ -1062,6 +1062,7 @@ public abstract class PlayerList {
}
public void setHasWhitelist(boolean flag) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index fbed3c1012c5b6fe61598ae6fae64edc2ad2e490..e6b7f1d0e864b32dd670547609c103cf7b6831c5 100644
index 5b2cecba3569a35ba259427747a8d39f51d1c8cb..fe1827d65d616322e6b540b18fff5bf32e0638ac 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -665,9 +665,14 @@ public abstract class PlayerList {
@@ -668,9 +668,14 @@ public abstract class PlayerList {
// this.a(entityplayer1, entityplayer, worldserver1); // CraftBukkit - removed
boolean flag2 = false;
@ -24,7 +24,7 @@ index fbed3c1012c5b6fe61598ae6fae64edc2ad2e490..e6b7f1d0e864b32dd670547609c103cf
WorldServer worldserver1 = this.server.getWorldServer(entityplayer.getSpawnDimension());
if (worldserver1 != null) {
Optional optional;
@@ -718,6 +723,7 @@ public abstract class PlayerList {
@@ -721,6 +726,7 @@ public abstract class PlayerList {
location = respawnEvent.getRespawnLocation();
if (!flag) entityplayer.reset(); // SPIGOT-4785
@ -32,7 +32,7 @@ index fbed3c1012c5b6fe61598ae6fae64edc2ad2e490..e6b7f1d0e864b32dd670547609c103cf
} else {
location.setWorld(worldserver.getWorld());
}
@@ -775,6 +781,13 @@ public abstract class PlayerList {
@@ -778,6 +784,13 @@ public abstract class PlayerList {
if (entityplayer.playerConnection.isDisconnected()) {
this.savePlayerFile(entityplayer);
}

View File

@ -7,10 +7,10 @@ The problem was we were checking isExpired() on the entry, but if it
was expired at that point, then it would be null.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index e6b7f1d0e864b32dd670547609c103cf7b6831c5..8104c335870aac88d9db6fec567360415ff69f99 100644
index fe1827d65d616322e6b540b18fff5bf32e0638ac..120b4941a54750e94f8f10f809fb77214eb63c66 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -531,8 +531,10 @@ public abstract class PlayerList {
@@ -534,8 +534,10 @@ public abstract class PlayerList {
Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.networkManager.getRawAddress()).getAddress());

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657)
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f313571ea06fcc77bef92b2c976f651067c5a8d2..50e751cce467d043965b126b37d0e0d86c735328 100644
index 18c0957ee66a9c806f4a10fcde582aa43142132e..05723df2e94e40e0e23f9a180068455a4f4722b6 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -943,6 +943,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -18,10 +18,10 @@ index f313571ea06fcc77bef92b2c976f651067c5a8d2..50e751cce467d043965b126b37d0e0d8
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.world.getServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 8104c335870aac88d9db6fec567360415ff69f99..330784e8aad1e87d0a86fdb822d0ad5d7cf21d3c 100644
index 120b4941a54750e94f8f10f809fb77214eb63c66..10427498fe34ab5b40ada89597d7ae0a96b5398a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -770,6 +770,8 @@ public abstract class PlayerList {
@@ -773,6 +773,8 @@ public abstract class PlayerList {
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobEffect));
}

View File

@ -40,10 +40,10 @@ index 7bb0843d76864fc10575532745eb63f9ca478354..25e54a1fadc5d31fb250a3f47524b4f3
Stream<VoxelShape> c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate<Entity> predicate);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 330784e8aad1e87d0a86fdb822d0ad5d7cf21d3c..f08de96267ca3bdc7fe4ed1f024b39df3facf0ed 100644
index 10427498fe34ab5b40ada89597d7ae0a96b5398a..bf14839c99a2c2336bba4a12ee49d4c7c79c30c9 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -733,6 +733,7 @@ public abstract class PlayerList {
@@ -736,6 +736,7 @@ public abstract class PlayerList {
entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
// CraftBukkit end

View File

@ -279,10 +279,10 @@ index d3a597d878de4cb625484cbf3a9838961d38ada0..16e4acdb0f834883a480829a864ef757
list.stream().map((playerchunk) -> {
CompletableFuture completablefuture;
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index bf8df178256e5eebbdadfd53e2f0edbfced0aba3..f76bbac925aef6d1e917195ed2f2b4da1d3d7b52 100644
index c11e941ba1ab12507ca5acbcaf034a6dfd97bbca..0b3ab0ecd263137a789c3d58db6a658666534e89 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -429,7 +429,7 @@ public abstract class PlayerList {
@@ -432,7 +432,7 @@ public abstract class PlayerList {
cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());

View File

@ -31,7 +31,7 @@ index da9f50f0e14a3294e63a2b45e1e4521187f8b4cc..6e0a236690663040b3f9e29684a1611a
public void d(Vec3D vec3d) {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 9f5ac100ed011b8d5802aebfbc488bdecf9b0586..ebf532d6bc2faea310c373d1526db4e963e90438 100644
index f128e30e22c0a084124dcddc785162e13242dc8b..aef385243ac031d2636cf438ea4885f5608144d0 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -44,6 +44,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -110,7 +110,7 @@ index d92b2bbfa1e2b284b624efd261d8803db1c4de2c..507c844e7aa43b6bdf5d2fff08c271ab
this.minecraftServer.getMethodProfiler().enter("keepAlive");
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 4995fa3fda87dfb47c8050e57ca29a895b809482..40f2984e5ba7627ef4ce87133bed5df51a68fd65 100644
index 34ec86448b8351792631a66d5078680f9d73a5f2..7b20dd6d65288aca780f61bf2fc1acc47022af10 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -54,11 +54,12 @@ public abstract class PlayerList {
@ -208,8 +208,8 @@ index 4995fa3fda87dfb47c8050e57ca29a895b809482..40f2984e5ba7627ef4ce87133bed5df5
this.playerFileData.save(entityplayer);
ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) entityplayer.getStatisticManager(); // CraftBukkit
@@ -443,7 +495,7 @@ public abstract class PlayerList {
entityplayer.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
@@ -446,7 +498,7 @@ public abstract class PlayerList {
}
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
- cserver.getPluginManager().callEvent(playerQuitEvent);
@ -217,7 +217,7 @@ index 4995fa3fda87dfb47c8050e57ca29a895b809482..40f2984e5ba7627ef4ce87133bed5df5
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
if (server.isMainThread()) entityplayer.playerTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog)
@@ -496,6 +548,13 @@ public abstract class PlayerList {
@@ -499,6 +551,13 @@ public abstract class PlayerList {
// this.p.remove(uuid);
// CraftBukkit end
}
@ -231,7 +231,7 @@ index 4995fa3fda87dfb47c8050e57ca29a895b809482..40f2984e5ba7627ef4ce87133bed5df5
// CraftBukkit start
// this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer}));
@@ -513,7 +572,7 @@ public abstract class PlayerList {
@@ -516,7 +575,7 @@ public abstract class PlayerList {
cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
// CraftBukkit end
@ -240,7 +240,7 @@ index 4995fa3fda87dfb47c8050e57ca29a895b809482..40f2984e5ba7627ef4ce87133bed5df5
}
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
@@ -532,6 +591,13 @@ public abstract class PlayerList {
@@ -535,6 +594,13 @@ public abstract class PlayerList {
list.add(entityplayer);
}
}

View File

@ -115,7 +115,7 @@ index ef61f8e784b7ebd26293d627e8b8e1aef1be6e21..03b1a67aaf3ed75b7669a3157847affd
if (flag1) {
ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 98fddca0b906221d34dd7683d83920bbc8f0d70c..ac4c8192ed0ce9f57fa0bb2c2200dc59e320f641 100644
index c2babc4a70b46a88fdd5fd0bfdc8398b29b90253..a3a4837bbbef3e748a349954586392033728b2f1 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -117,6 +117,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -567,7 +567,7 @@ index b4067657eefe6a418b76b599b4c8ffb8359c3f89..3e73ef8059139b09518075bb6dc89a67
}
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 40f2984e5ba7627ef4ce87133bed5df51a68fd65..4c16da52f4402b21be2df3fdf5999427629d6ae2 100644
index 7b20dd6d65288aca780f61bf2fc1acc47022af10..768adaa809e88412fcf8f7f60d6177667278f8fc 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -175,7 +175,7 @@ public abstract class PlayerList {
@ -579,7 +579,7 @@ index 40f2984e5ba7627ef4ce87133bed5df51a68fd65..4c16da52f4402b21be2df3fdf5999427
entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
@@ -825,7 +825,7 @@ public abstract class PlayerList {
@@ -828,7 +828,7 @@ public abstract class PlayerList {
// CraftBukkit start
WorldData worlddata = worldserver1.getWorldData();
entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), BiomeManager.a(worldserver1.getSeed()), entityplayer1.playerInteractManager.getGameMode(), entityplayer1.playerInteractManager.c(), worldserver1.isDebugWorld(), worldserver1.isFlatWorld(), flag));
@ -588,7 +588,7 @@ index 40f2984e5ba7627ef4ce87133bed5df51a68fd65..4c16da52f4402b21be2df3fdf5999427
entityplayer1.spawnIn(worldserver1);
entityplayer1.dead = false;
entityplayer1.playerConnection.teleport(new Location(worldserver1.getWorld(), entityplayer1.locX(), entityplayer1.locY(), entityplayer1.locZ(), entityplayer1.yaw, entityplayer1.pitch));
@@ -1292,7 +1292,7 @@ public abstract class PlayerList {
@@ -1295,7 +1295,7 @@ public abstract class PlayerList {
public void a(int i) {
this.viewDistance = i;

View File

@ -569,7 +569,7 @@ index c54175eaad6230a1098e9b912e0b4788afe4b9c8..afcbdd8e54ad936a4a3ac03341e1c525
boolean flag1 = this.playerChunkMap.b();
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index ac4c8192ed0ce9f57fa0bb2c2200dc59e320f641..81b9630935d2ae6f9d9d45562f2feb73cef9a595 100644
index a3a4837bbbef3e748a349954586392033728b2f1..bcad9da8e2d2f821c82e1e4125dc4ea417f9bb0e 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -56,6 +56,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -1158,7 +1158,7 @@ index a19ef358baa4daff6753d034e7c8aab81cd14aa4..d2e1f086d25213549c813555464a8aee
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 4c16da52f4402b21be2df3fdf5999427629d6ae2..72d5d39c45e8f0f35a705c0c7d6d69e038b83d92 100644
index 768adaa809e88412fcf8f7f60d6177667278f8fc..c975ca0b7443b732b93f9fe244926074792cc4fb 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -196,8 +196,8 @@ public abstract class PlayerList {
@ -1172,7 +1172,7 @@ index 4c16da52f4402b21be2df3fdf5999427629d6ae2..72d5d39c45e8f0f35a705c0c7d6d69e0
PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pos.pair());
if (updatingChunk != null) {
return updatingChunk.getEntityTickingFuture();
@@ -613,6 +613,7 @@ public abstract class PlayerList {
@@ -616,6 +616,7 @@ public abstract class PlayerList {
SocketAddress socketaddress = loginlistener.networkManager.getSocketAddress();
EntityPlayer entity = new EntityPlayer(this.server, this.server.getWorldServer(World.OVERWORLD), gameprofile, new PlayerInteractManager(this.server.getWorldServer(World.OVERWORLD)));
@ -1180,7 +1180,7 @@ index 4c16da52f4402b21be2df3fdf5999427629d6ae2..72d5d39c45e8f0f35a705c0c7d6d69e0
Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.networkManager.getRawAddress()).getAddress());
@@ -819,6 +820,7 @@ public abstract class PlayerList {
@@ -822,6 +823,7 @@ public abstract class PlayerList {
// CraftBukkit end
worldserver1.getChunkProvider().addTicket(TicketType.POST_TELEPORT, new ChunkCoordIntPair(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper

View File

@ -11,10 +11,10 @@ This will drastically cut down on packet sending cost for worlds with
lots of players in them.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 72d5d39c45e8f0f35a705c0c7d6d69e038b83d92..3e11c9ca6efde2347a963177f325b1efa67eb4f8 100644
index c975ca0b7443b732b93f9fe244926074792cc4fb..a7e3a89a25771e4650bf7d44fe006825f8e766ec 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1070,16 +1070,40 @@ public abstract class PlayerList {
@@ -1073,16 +1073,40 @@ public abstract class PlayerList {
}
public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, ResourceKey<World> resourcekey, Packet<?> packet) {

View File

@ -106,10 +106,10 @@ index ba3db09763d94d730c3fe8662e4dbb24e0636786..3506473f9b9f4c747f7b737d9bd02bef
private void a(IInventory iinventory, ItemStack itemstack) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 65de5c4e5ffb993d85af2410c44d0149878b6859..8d5b08cbeb09049d28e2a02c7a5617386eb3fc5e 100644
index 9127df12252bbd619d97db996a88ae91da9d3345..0f0d70c0622558740086f0f7cf89e5500128f955 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1552,19 +1552,44 @@ public class CraftEventFactory {
@@ -1548,19 +1548,44 @@ public class CraftEventFactory {
return event;
}

View File

@ -10,10 +10,10 @@ This fixes that by checking if the modified spawn location is
still at a respawn anchor.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 3a38e3fc1f59cee5505c6ad7174c7014ec8efc25..00314e40cddd610a9eb4102b52a298d28b57c2ac 100644
index 52322b3e9963b9e1b899a84fbb95bbaf048f8ad6..41f55e575b26200809711637ded5c7cfd34b0d1f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -767,6 +767,7 @@ public abstract class PlayerList {
@@ -770,6 +770,7 @@ public abstract class PlayerList {
// Paper start
boolean isBedSpawn = false;
boolean isRespawn = false;
@ -21,7 +21,7 @@ index 3a38e3fc1f59cee5505c6ad7174c7014ec8efc25..00314e40cddd610a9eb4102b52a298d2
// Paper end
// CraftBukkit start - fire PlayerRespawnEvent
@@ -777,7 +778,7 @@ public abstract class PlayerList {
@@ -780,7 +781,7 @@ public abstract class PlayerList {
Optional optional;
if (blockposition != null) {
@ -30,7 +30,7 @@ index 3a38e3fc1f59cee5505c6ad7174c7014ec8efc25..00314e40cddd610a9eb4102b52a298d2
} else {
optional = Optional.empty();
}
@@ -820,7 +821,12 @@ public abstract class PlayerList {
@@ -823,7 +824,12 @@ public abstract class PlayerList {
}
// Spigot End
@ -44,7 +44,7 @@ index 3a38e3fc1f59cee5505c6ad7174c7014ec8efc25..00314e40cddd610a9eb4102b52a298d2
if (!flag) entityplayer.reset(); // SPIGOT-4785
isRespawn = true; // Paper
} else {
@@ -858,8 +864,12 @@ public abstract class PlayerList {
@@ -861,8 +867,12 @@ public abstract class PlayerList {
}
// entityplayer1.syncInventory();
entityplayer1.setHealth(entityplayer1.getHealth());

View File

@ -25,7 +25,7 @@ index 56e4359ba32339e1bef58061585ff3e12e4215f3..60f03502a7fd622d2de3b2da9fe8014b
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 81b9630935d2ae6f9d9d45562f2feb73cef9a595..04f14691ba9b0552b2c195c4a3b47f45cd72c5a2 100644
index bcad9da8e2d2f821c82e1e4125dc4ea417f9bb0e..8e1655a975af24f6781a95be7030afa8f1b14472 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -43,6 +43,7 @@ import org.bukkit.inventory.MainHand;
@ -59,7 +59,7 @@ index 474b1a3d4e09489d18a9b2b07131af3d2599ab52..e65c0b9618bd4bc9195de64c18f3f23d
// Paper start
for (WorldServer world : getWorlds()) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 00314e40cddd610a9eb4102b52a298d28b57c2ac..2ae926d9a2ad99a46409dfa000c6f895600a2616 100644
index 41f55e575b26200809711637ded5c7cfd34b0d1f..eb247855f880049e85372ea8dfcc2bf10d756835 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -482,6 +482,7 @@ public abstract class PlayerList {
@ -70,7 +70,7 @@ index 00314e40cddd610a9eb4102b52a298d28b57c2ac..2ae926d9a2ad99a46409dfa000c6f895
this.playerFileData.save(entityplayer);
ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) entityplayer.getStatisticManager(); // CraftBukkit
@@ -1138,10 +1139,21 @@ public abstract class PlayerList {
@@ -1141,10 +1142,21 @@ public abstract class PlayerList {
}
public void savePlayers() {

@ -1 +1 @@
Subproject commit 5da21f87d6b0953f73941e68f5a09dc473d7cd5e
Subproject commit 5c77bd28168a4ee3b2f057a1c25849c5b1502c8e