This commit is contained in:
Jake Potrebic 2024-06-13 16:32:45 -07:00
parent ed2ea4538e
commit ba163e10bb
No known key found for this signature in database
GPG key ID: ECE0B3C133C016C5
72 changed files with 357 additions and 350 deletions

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityInsideBlockEvent
diff --git a/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java diff --git a/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..3e98db83060e614c606de41dcd4b4ac4f242edc9 index 0000000000000000000000000000000000000000..b162d4b6f12c0d7d3542ada3bdae24471a16d622
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java +++ b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java
@@ -0,0 +1,86 @@ @@ -0,0 +1,87 @@
+package io.papermc.paper.event.entity; +package io.papermc.paper.event.entity;
+ +
+import org.bukkit.block.Block; +import org.bukkit.block.Block;
@ -35,6 +35,7 @@ index 0000000000000000000000000000000000000000..3e98db83060e614c606de41dcd4b4ac4
+ * <li>Campfire</li> + * <li>Campfire</li>
+ * <li>Cauldron</li> + * <li>Cauldron</li>
+ * <li>Crops</li> + * <li>Crops</li>
+ * <li>End Gateway</li>
+ * <li>Ender Portal</li> + * <li>Ender Portal</li>
+ * <li>Fires</li> + * <li>Fires</li>
+ * <li>Frogspawn</li> + * <li>Frogspawn</li>

View file

@ -2775,7 +2775,7 @@ index 5f8adf662e5ab9114e2891cfacb8db5d4d40a297..a8a7f1fcf235508d9437ec7c550c3a38
this.chatVisibility = clientOptions.chatVisibility(); this.chatVisibility = clientOptions.chatVisibility();
this.canChatColor = clientOptions.chatColors(); this.canChatColor = clientOptions.chatColors();
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..94008b8a1f2dafdb9efa1fec6096d3eb632b9a5e 100644 index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95d5e0bdac 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -67,7 +67,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -67,7 +67,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -2819,7 +2819,7 @@ index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..94008b8a1f2dafdb9efa1fec6096d3eb
} }
+ // Paper start - adventure + // Paper start - adventure
+ public void disconnect(@Nullable final net.kyori.adventure.text.Component reason) { + public void disconnect(final net.kyori.adventure.text.Component reason) {
+ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(reason)); + this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(reason));
+ } + }
+ // Paper end - adventure + // Paper end - adventure
@ -2977,7 +2977,7 @@ index 2c555c5ad05992b19f67b883c3c0ec7018180747..71540687b4212702cdaaad5fd4815fb3
@Override @Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 6abe921099ff00ecfaf0f423ef27d708420f6f48..9113c183f1e977f71eea95a891618883b075ce5a 100644 index 6abe921099ff00ecfaf0f423ef27d708420f6f48..e9109526880159e2341cc97b53939ba2bcfaeaf9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -271,7 +271,7 @@ public abstract class PlayerList { @@ -271,7 +271,7 @@ public abstract class PlayerList {
@ -3082,7 +3082,7 @@ index 6abe921099ff00ecfaf0f423ef27d708420f6f48..9113c183f1e977f71eea95a891618883
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) { for (ServerPlayer player : this.players) {
- player.connection.disconnect(CraftChatMessage.fromStringOrEmpty(this.server.server.getShutdownMessage())); // CraftBukkit - add custom shutdown message - player.connection.disconnect(CraftChatMessage.fromStringOrEmpty(this.server.server.getShutdownMessage())); // CraftBukkit - add custom shutdown message
+ player.connection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure + player.connection.disconnect(java.util.Objects.requireNonNullElseGet(this.server.server.shutdownMessage(), net.kyori.adventure.text.Component::empty)); // CraftBukkit - add custom shutdown message // Paper - Adventure
} }
// CraftBukkit end // CraftBukkit end

View file

@ -382,7 +382,7 @@ index 3d92c61f7781221cfdc0324d11bd0088954e4a68..84a2c6c397604279ba821286f5c3c855
if (!SwingUtilities.isEventDispatchThread()) { if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9113c183f1e977f71eea95a891618883b075ce5a..9807c5b2b248a62a476bfe3ae023d57d35811049 100644 index e9109526880159e2341cc97b53939ba2bcfaeaf9..9dcfcea63f57f45a5584bb80c34fe445d65849e8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -161,8 +161,7 @@ public abstract class PlayerList { @@ -161,8 +161,7 @@ public abstract class PlayerList {

View file

@ -1277,7 +1277,7 @@ index 27cf5dceba5835f94f5397ec011f409e7b226ad5..4f50e2f5de529813c269b7670a47e063
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9807c5b2b248a62a476bfe3ae023d57d35811049..62174dae20bd9ff092238f1437f7e2b0114ef83b 100644 index 9dcfcea63f57f45a5584bb80c34fe445d65849e8..765c412cd0c5cd410c224b4bc55dbf431fd6617b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@

View file

@ -12,7 +12,7 @@ improve setPosition to use raw
public net.minecraft.world.entity.Entity setRot(FF)V public net.minecraft.world.entity.Entity setRot(FF)V
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 62174dae20bd9ff092238f1437f7e2b0114ef83b..a3e695c321b9164822506e787bb5c54813aad7c2 100644 index 765c412cd0c5cd410c224b4bc55dbf431fd6617b..3cc30aaf63a3a953c1947f0f19ca8816b92654f6 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -226,7 +226,7 @@ public abstract class PlayerList { @@ -226,7 +226,7 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 94008b8a1f2dafdb9efa1fec6096d3eb632b9a5e..d2061ea6f670edd33be2460eef0b489e88857690 100644 index 678f12679985c6fa9effe8beec306d95d5e0bdac..8520f0f2b4b4e758b2e2fae206b7fd818a6fa14f 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -202,7 +202,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -202,7 +202,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

View file

@ -43,7 +43,7 @@ index 4fd88b63ae6e6aa3265f72f4f0ae1b1895b70be9..8f0a0384d12b738553a6bec02e3b9438
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a3e695c321b9164822506e787bb5c54813aad7c2..aaae646588a3a09c96a4bc481f15a44a96efbb8e 100644 index 3cc30aaf63a3a953c1947f0f19ca8816b92654f6..5c7e8387a885221960df818a1c1178f739a72c43 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -159,6 +159,7 @@ public abstract class PlayerList { @@ -159,6 +159,7 @@ public abstract class PlayerList {

View file

@ -19,7 +19,7 @@ index 916ba7c09b077bc3c9ed9fad579e607e4c065e06..813c3bc9943e2700d2e4ad2335b7d235
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index d2061ea6f670edd33be2460eef0b489e88857690..e8d1ade5542dcf01476ba8580cc281b28f36c9a0 100644 index 8520f0f2b4b4e758b2e2fae206b7fd818a6fa14f..73d40f768b6882062656cba30acc5f86f26d1a96 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -179,7 +179,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -179,7 +179,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

View file

@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads. the same way we handle async chunk loads.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index aaae646588a3a09c96a4bc481f15a44a96efbb8e..9d46c2241098959e30a2e45762a67386eeec6d5d 100644 index 5c7e8387a885221960df818a1c1178f739a72c43..f47c1ccba18b98854fb3671ed5bbce6548a5ef27 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1029,11 +1029,13 @@ public abstract class PlayerList { @@ -1029,11 +1029,13 @@ public abstract class PlayerList {

View file

@ -64,7 +64,7 @@ index 56d51073eb0cd902fa2c1e790201f74d120b149f..7335f9bb936eeb585ee077b0b9c461d7
if (waitForShutdown) { if (waitForShutdown) {
try { try {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9d46c2241098959e30a2e45762a67386eeec6d5d..bad29b6f6bf2859a876799a053eef0374b9d7140 100644 index f47c1ccba18b98854fb3671ed5bbce6548a5ef27..c2faf513ad435f979d889d43809e2caa92d11b18 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1143,8 +1143,15 @@ public abstract class PlayerList { @@ -1143,8 +1143,15 @@ public abstract class PlayerList {
@ -79,8 +79,8 @@ index 9d46c2241098959e30a2e45762a67386eeec6d5d..bad29b6f6bf2859a876799a053eef037
+ // Paper end + // Paper end
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) { for (ServerPlayer player : this.players) {
+ if (isRestarting) player.connection.disconnect(org.spigotmc.SpigotConfig.restartMessage); else // Paper + if (isRestarting) player.connection.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.restartMessage)); else // Paper
player.connection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure player.connection.disconnect(java.util.Objects.requireNonNullElseGet(this.server.server.shutdownMessage(), net.kyori.adventure.text.Component::empty)); // CraftBukkit - add custom shutdown message // Paper - Adventure
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java

View file

@ -5,7 +5,7 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index bad29b6f6bf2859a876799a053eef0374b9d7140..1c3b21eaff8481724858cf3013dbfc2f210f317b 100644 index c2faf513ad435f979d889d43809e2caa92d11b18..5375fd660e3ed4a5997896d28ea234a81d183a10 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -624,9 +624,9 @@ public abstract class PlayerList { @@ -624,9 +624,9 @@ public abstract class PlayerList {

View file

@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients. random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index e8d1ade5542dcf01476ba8580cc281b28f36c9a0..0ac9f9d4816767ced7928a7d79743d97870a21a4 100644 index 73d40f768b6882062656cba30acc5f86f26d1a96..07d2e60bcd7d1f3ba2f8005ec496561b3648ae86 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -117,14 +117,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -117,14 +117,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

View file

@ -17,7 +17,7 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer. at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 0ac9f9d4816767ced7928a7d79743d97870a21a4..e2a07d4e006d90132102a6449d57dd9e9642e6af 100644 index 07d2e60bcd7d1f3ba2f8005ec496561b3648ae86..382920335337c8d0abd8b1f600fddd391249fe21 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -69,7 +69,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -69,7 +69,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

View file

@ -40,7 +40,7 @@ index 2d9db1ac80216a509a7590254e422b3c4792e3ec..b31f00f2f0b7cec59301afe36c9dd7cd
playerName = gameprofile.getName(); playerName = gameprofile.getName();
uniqueId = gameprofile.getId(); uniqueId = gameprofile.getId();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 1c3b21eaff8481724858cf3013dbfc2f210f317b..8ff6b8ada1cfb9a4b344ba7d77db95f3ddcff6c5 100644 index 5375fd660e3ed4a5997896d28ea234a81d183a10..e959c7e45bffdcf46908a6919c07a0cdf9aa83bb 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -831,10 +831,16 @@ public abstract class PlayerList { @@ -831,10 +831,16 @@ public abstract class PlayerList {

View file

@ -96,7 +96,7 @@ index ecc2ce39629f6edbd09e96c85e14ab2196ac3173..75736ebe99e96a20c2c3e7ac5350ab55
this.player.doCloseContainer(); this.player.doCloseContainer();
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 8ff6b8ada1cfb9a4b344ba7d77db95f3ddcff6c5..0c3be0663a3e69701e6b91ef65c7fbd764ae7c46 100644 index e959c7e45bffdcf46908a6919c07a0cdf9aa83bb..3cb56ccb3a42871488b76706d7a6edecd122c418 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -510,7 +510,7 @@ public abstract class PlayerList { @@ -510,7 +510,7 @@ public abstract class PlayerList {

View file

@ -23,7 +23,7 @@ Modified isEmpty to use the isEmpty() method instead of the slightly confusing s
The point of this is readability, but does have a side-benefit of a small microptimization The point of this is readability, but does have a side-benefit of a small microptimization
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0c3be0663a3e69701e6b91ef65c7fbd764ae7c46..91206bb797f82936abea75f1956c08a92a15bd2c 100644 index 3cb56ccb3a42871488b76706d7a6edecd122c418..db80ad51dd824c2d6d119184fd80d3c12199862c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -627,7 +627,7 @@ public abstract class PlayerList { @@ -627,7 +627,7 @@ public abstract class PlayerList {

View file

@ -28,7 +28,7 @@ index fcbb0b64feb8d5624de3805d4db6d489110b4e69..a2adbad6382276b149c41ff422e4aa9b
public boolean queueHealthUpdatePacket; public boolean queueHealthUpdatePacket;
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 91206bb797f82936abea75f1956c08a92a15bd2c..92e81514ce85f32303506d6ffc501946c0320c83 100644 index db80ad51dd824c2d6d119184fd80d3c12199862c..91c1f58aea3f0f7ee5dd314aa3dda099d12ffb46 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -182,6 +182,7 @@ public abstract class PlayerList { @@ -182,6 +182,7 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 92e81514ce85f32303506d6ffc501946c0320c83..f82728bece2723a8f676ebc5b09885c7833174e4 100644 index 91c1f58aea3f0f7ee5dd314aa3dda099d12ffb46..6dff0c73f1187daed7c037b5c781b6e4c681723c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1126,6 +1126,7 @@ public abstract class PlayerList { @@ -1126,6 +1126,7 @@ public abstract class PlayerList {

View file

@ -34,7 +34,7 @@ index b151506b96a51c74ba408cb555a4d38507b2f8c1..bbcee9d8dbf17085b11bb5e38eb37271
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f82728bece2723a8f676ebc5b09885c7833174e4..f9794c0eaced71d242cb04b0815bad322ed7165d 100644 index 6dff0c73f1187daed7c037b5c781b6e4c681723c..f3b154a14690d6a4650f20a4ab7da7b727b0fa49 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -223,6 +223,11 @@ public abstract class PlayerList { @@ -223,6 +223,11 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerPostRespawnEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f9794c0eaced71d242cb04b0815bad322ed7165d..7fa13f1fe02a1bdfa93c76e9c2eefc81c9bded50 100644 index f3b154a14690d6a4650f20a4ab7da7b727b0fa49..54668cfc4666b07681d03c1c2cbad0f387b89b2b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -738,6 +738,10 @@ public abstract class PlayerList { @@ -738,6 +738,10 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index e2a07d4e006d90132102a6449d57dd9e9642e6af..adf953994d2c7e8f1e15075722ee2b9213e4bf94 100644 index 382920335337c8d0abd8b1f600fddd391249fe21..2d1fad00ee084841618f0da8113c7aac8c0e2b0d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -366,7 +366,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -366,7 +366,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

View file

@ -35,7 +35,7 @@ index d2f5ff035d4d496c035b8ae0c04c67e3de78fd4b..142bdd74f930a1a2a004c8b6d9435318
this.gameMode.setLevel((ServerLevel) world); this.gameMode.setLevel((ServerLevel) world);
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 7fa13f1fe02a1bdfa93c76e9c2eefc81c9bded50..5cc92a5f55a9492928c4ba140d4e45dcf75b5431 100644 index 54668cfc4666b07681d03c1c2cbad0f387b89b2b..511333fc0f00c5de544f5e10ddf4c5262fdf5ee3 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -226,6 +226,7 @@ public abstract class PlayerList { @@ -226,6 +226,7 @@ public abstract class PlayerList {

View file

@ -55,7 +55,7 @@ index df6fb7dd6015ce6e558a97598c822243dcc1c284..b808d9c710d6cd59ac34ea537f603fd4
// CraftBukkit end // CraftBukkit end
public boolean isRealPlayer; // Paper public boolean isRealPlayer; // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 5cc92a5f55a9492928c4ba140d4e45dcf75b5431..47392be43dffcb983c29683263227780a3ddee24 100644 index 511333fc0f00c5de544f5e10ddf4c5262fdf5ee3..cbad29d23f5c90dadd7d442372247e7befe18e49 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -297,6 +297,12 @@ public abstract class PlayerList { @@ -297,6 +297,12 @@ public abstract class PlayerList {

View file

@ -10,7 +10,7 @@ Co-authored-by: Wyatt Childers <wchilders@nearce.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 47392be43dffcb983c29683263227780a3ddee24..fa35bc76575a3ffe6435ff24db0c7ad78b53e309 100644 index cbad29d23f5c90dadd7d442372247e7befe18e49..7d5c82b50c59de0a40ae11e8d7751500288889c5 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -197,6 +197,7 @@ public abstract class PlayerList { @@ -197,6 +197,7 @@ public abstract class PlayerList {

View file

@ -17,14 +17,14 @@ index b808d9c710d6cd59ac34ea537f603fd4002073d0..45d36070735cd7a8baee585165a95a16
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index adf953994d2c7e8f1e15075722ee2b9213e4bf94..4761a8d8f342c649bc2e5f530819fa88f43542ec 100644 index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90b479e34f 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -78,6 +78,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -78,6 +78,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private volatile boolean suspendFlushingOnServerThread = false; private volatile boolean suspendFlushingOnServerThread = false;
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
+ protected static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support + protected static final ResourceLocation MINECRAFT_BRAND = ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver; this.server = minecraftserver;

View file

@ -40,7 +40,7 @@ index 45d36070735cd7a8baee585165a95a169d7059b4..2c24de44e48a1c55b81e2ecfb92c57e4
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 4761a8d8f342c649bc2e5f530819fa88f43542ec..125a80951f6e4d19c6aa61e104339242de7a4b00 100644 index a3c67bdc2c08b3550534f37d15b0db90b479e34f..24bf661e76fb421a8be565d9ea68edf7205254d2 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -371,6 +371,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -371,6 +371,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -52,7 +52,7 @@ index 4761a8d8f342c649bc2e5f530819fa88f43542ec..125a80951f6e4d19c6aa61e104339242
this.connection.disconnect(disconnectiondetails); this.connection.disconnect(disconnectiondetails);
})); }));
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index fa35bc76575a3ffe6435ff24db0c7ad78b53e309..858bbd4add280f0cd04aa94fb0b2f8f9423299cf 100644 index 7d5c82b50c59de0a40ae11e8d7751500288889c5..60845fe39f6e24474c1fa39c06a8b164348cb326 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -570,7 +570,7 @@ public abstract class PlayerList { @@ -570,7 +570,7 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Fix villager boat exploit
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 858bbd4add280f0cd04aa94fb0b2f8f9423299cf..f565dd3ae7cce3de0aa230155fb955efbab681af 100644 index 60845fe39f6e24474c1fa39c06a8b164348cb326..5a709e301b336ee2fc62b422a2f3d878b81f9743 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -595,6 +595,14 @@ public abstract class PlayerList { @@ -595,6 +595,14 @@ public abstract class PlayerList {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f565dd3ae7cce3de0aa230155fb955efbab681af..05365355fe54d2ed37724d17b174b32fbe6f417f 100644 index 5a709e301b336ee2fc62b422a2f3d878b81f9743..f9ecdb537b7cbf4a97888a88a61686d9a2847cd6 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1062,6 +1062,11 @@ public abstract class PlayerList { @@ -1062,6 +1062,11 @@ public abstract class PlayerList {

View file

@ -48,7 +48,7 @@ index 2b1d7a2360a9ee7bca9d93a2dc8c61d1648a8348..d5153f804cfcfd1a70c46975e3fb1e50
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) { if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
return false; return false;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 05365355fe54d2ed37724d17b174b32fbe6f417f..0e3aa2a16ecdc607efba8db92aedf877657f1026 100644 index f9ecdb537b7cbf4a97888a88a61686d9a2847cd6..bf1a8d273a9599597fc4bb0c8e33b15177ad5d8e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -179,6 +179,7 @@ public abstract class PlayerList { @@ -179,6 +179,7 @@ public abstract class PlayerList {

View file

@ -7,7 +7,7 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro
Closes #5036 Closes #5036
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0e3aa2a16ecdc607efba8db92aedf877657f1026..d6c5a664b9e08083e856e79522b85b2e75e677a8 100644 index bf1a8d273a9599597fc4bb0c8e33b15177ad5d8e..995f085b0a1c7b14c4942dd4ed700f0271e18ec5 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -588,6 +588,14 @@ public abstract class PlayerList { @@ -588,6 +588,14 @@ public abstract class PlayerList {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4a5553335cd6bbad8d3a05694710d95c96f62b9d..a04c7677ded862890e6e809db610817b4cfff56a 100644 index 498104eb1509e0f8389c07d1573a6b496b0bcd41..71a1b5108847b6284482ce33cdc07b944adeadba 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1734,6 +1734,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1746,6 +1746,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (itemstack.isItemEnabled(worldserver.enabledFeatures())) { if (itemstack.isItemEnabled(worldserver.enabledFeatures())) {
BlockHitResult movingobjectpositionblock = packet.getHitResult(); BlockHitResult movingobjectpositionblock = packet.getHitResult();
Vec3 vec3d = movingobjectpositionblock.getLocation(); Vec3 vec3d = movingobjectpositionblock.getLocation();

View file

@ -8,7 +8,7 @@ in order to fire the BlockDispenseEvent. This patch corrects
that. that.
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 6c0ec15d47c8174976b40555cf5d3b00d7f97b20..dc68ade2ed576020a4a40608243059d6d9d82f19 100644 index 32f06b29930906cdb6d3ceefa609c1a45518f80f..fb80b00b34ae5a4b1491c618a7fe1bdbbde0de9b 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -405,7 +405,13 @@ public interface DispenseItemBehavior { @@ -405,7 +405,13 @@ public interface DispenseItemBehavior {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add Unix domain socket support
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index c0261c3cd6de850edbd197272c2d1c52f76e6ebe..b8043b7e778792153620923ea228c1a211c27969 100644 index 4057ade698a227b4f6efd3aa30b16d78c777be83..adbd61c41cc30afa89c6ee3544c562b351304a01 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -232,6 +232,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -236,6 +236,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist); this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
// this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading // this.worldData.setGameType(dedicatedserverproperties.gamemode); // CraftBukkit - moved to world loading
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode); DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
@ -29,7 +29,7 @@ index c0261c3cd6de850edbd197272c2d1c52f76e6ebe..b8043b7e778792153620923ea228c1a2
InetAddress inetaddress = null; InetAddress inetaddress = null;
if (!this.getLocalIp().isEmpty()) { if (!this.getLocalIp().isEmpty()) {
@@ -241,12 +255,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -245,12 +259,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (this.getPort() < 0) { if (this.getPort() < 0) {
this.setPort(dedicatedserverproperties.serverPort); this.setPort(dedicatedserverproperties.serverPort);
} }
@ -87,10 +87,10 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a04c7677ded862890e6e809db610817b4cfff56a..f4c6e815253f3e49577c554bf632e5c9f4f578ff 100644 index 71a1b5108847b6284482ce33cdc07b944adeadba..4a3f6197aae50e35584e3e2134551a955e4b6729 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2534,6 +2534,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2551,6 +2551,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start // Spigot Start
public SocketAddress getRawAddress() public SocketAddress getRawAddress()
{ {
@ -103,10 +103,10 @@ index a04c7677ded862890e6e809db610817b4cfff56a..f4c6e815253f3e49577c554bf632e5c9
} }
// Spigot End // Spigot End
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index b5d8ef9dd24687b99f5cf547574351c359fb85ba..45a2683c9489bee6d67a1f3d702c17f2e9dc02e4 100644 index a5bbea6a073e00c10c3c5facd997eb8473fd9a5f..ddf42645402afefc0f5caebc684b191eef9d6ec2 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -80,6 +80,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -81,6 +81,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
this.connection.setupOutboundProtocol(LoginProtocols.CLIENTBOUND); this.connection.setupOutboundProtocol(LoginProtocols.CLIENTBOUND);
// CraftBukkit start - Connection throttle // CraftBukkit start - Connection throttle
try { try {
@ -114,7 +114,7 @@ index b5d8ef9dd24687b99f5cf547574351c359fb85ba..45a2683c9489bee6d67a1f3d702c17f2
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
long connectionThrottle = this.server.server.getConnectionThrottle(); long connectionThrottle = this.server.server.getConnectionThrottle();
InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress(); InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
@@ -108,6 +109,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -109,6 +110,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
} }
} }
} }
@ -122,7 +122,7 @@ index b5d8ef9dd24687b99f5cf547574351c359fb85ba..45a2683c9489bee6d67a1f3d702c17f2
} catch (Throwable t) { } catch (Throwable t) {
org.apache.logging.log4j.LogManager.getLogger().debug("Failed to check connection throttle", t); org.apache.logging.log4j.LogManager.getLogger().debug("Failed to check connection throttle", t);
} }
@@ -165,8 +167,11 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -166,8 +168,11 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
if (!handledByEvent && proxyLogicEnabled) { // Paper if (!handledByEvent && proxyLogicEnabled) { // Paper
// if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above!
if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - Add bypass host check if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.BYPASS_HOSTCHECK || ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { // Paper - Add bypass host check

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityInsideBlockEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
index 83f48d543eac94276ee4d7f7a4c21abdfa8eb8e6..39a92a25c55fb16f1371b0dfe2fb94258e4b7f0d 100644 index 993538f613e52ecd009f01e7b68fddba76b6a3e8..c36e64c3df09f14ffb06b81ef20c5e200e386e50 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java --- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
@@ -124,6 +124,7 @@ public abstract class BaseFireBlock extends Block { @@ -124,6 +124,7 @@ public abstract class BaseFireBlock extends Block {
@ -53,7 +53,7 @@ index 7c70c98ee27a6a09e73942ff4dc0f88ceb77936f..4c1f20fafdbd86011959cc2d4983b6c2
if (blockState.isAir()) { if (blockState.isAir()) {
entity.onAboveBubbleCol(state.getValue(DRAG_DOWN)); entity.onAboveBubbleCol(state.getValue(DRAG_DOWN));
diff --git a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
index dc9dca35ec406b8046372719392d20acc3f5dac9..776357342c76127af0868591a56a059f89a55f20 100644 index 4a58bf1081e57bd34858481dee824e2a75120281..4c37d9ebd74b32b9ad6dc46d000afc7a7d1bb4a3 100644
--- a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java --- a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
@@ -206,6 +206,7 @@ public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock { @@ -206,6 +206,7 @@ public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock {
@ -77,16 +77,16 @@ index fd344c5cf0d6d523abe34d5e3f8d939106942cbb..ff4dda48116a2969704b355ff96407ba
} }
diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
index 47f1f2fec847ff19b994c98d0f5b01d063f37067..d6fffb0953494e8667cc456137cac0f5deebfbb6 100644 index e81bf62cf9dbc27391deaad46d2098e81f746746..7f6058f4def83867971121751acd51c398583651 100644
--- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
@@ -105,6 +105,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB @@ -104,6 +104,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
@Override @Override
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if ((Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) { if ((Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity) {
entity.hurt(world.damageSources().inFire().directBlock(world, pos), (float) this.fireDamage); // CraftBukkit entity.hurt(world.damageSources().campfire().directBlock(world, pos), (float) this.fireDamage); // CraftBukkit
} }
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
index fcaf6b4bb7371ce9f00a7d4306f7b2b6884b7c4c..73595922dcff8e7a8595fcf033ab238bc4096630 100644 index fcaf6b4bb7371ce9f00a7d4306f7b2b6884b7c4c..73595922dcff8e7a8595fcf033ab238bc4096630 100644
@ -112,20 +112,32 @@ index 55a97da8786ec0ae98abe56876c00f4678ba0007..9d69e439ff853465303c2abd896e6c53
if (!world.isClientSide) { if (!world.isClientSide) {
if (!(Boolean) state.getValue(DetectorRailBlock.POWERED)) { if (!(Boolean) state.getValue(DetectorRailBlock.POWERED)) {
this.checkPressed(world, pos, state); this.checkPressed(world, pos, state);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
index 6845beea2a10adf5eab08744c7eef63c0bd42254..a2de13a366e4a462b746dab035372838127f4994 100644 index 2ad77d7666cc9a5101b3da58f07f497409676a26..11486419dd98a013c7387d3d73f322a95a18c574 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java --- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
@@ -52,6 +52,7 @@ public class EndPortalBlock extends BaseEntityBlock { @@ -90,6 +90,7 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
@Override @Override
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (world instanceof ServerLevel && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) { if (entity.canUsePortal(false)) {
ResourceKey<Level> resourcekey = world.getTypeKey() == LevelStem.END ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends BlockEntity tileentity = world.getBlockEntity(pos);
ServerLevel worldserver = ((ServerLevel) world).getServer().getLevel(resourcekey);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index e2d6693da4abe6204c0ecb5e924a3903fa80ab7d..cff3e9869340f1ffb7093431cbe1ac5e67792a4e 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -63,6 +63,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
@Override
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (entity.canUsePortal(false) && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) {
// CraftBukkit start - Entity in portal
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
index d7a6d4f11325791767be8fcb2355916ca2f63f11..a3339b47165814238351d307c729af14d5e5d1ff 100644 index 211b7809f099678bc3bd64bd29fd9c4d19e3ab0d..6e7595193275e88c69b82ebbc9f9df636879a03e 100644
--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java --- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
@@ -79,6 +79,7 @@ public class FrogspawnBlock extends Block { @@ -79,6 +79,7 @@ public class FrogspawnBlock extends Block {
@ -185,15 +197,15 @@ index 5f778ea22efa76ced1ba4455d50b94b3519113fc..7c67efa6e344870b764eb39d55081903
// CraftBukkit start // CraftBukkit start
if (entity.mayInteract(world, pos)) { if (entity.mayInteract(world, pos)) {
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
index d3f2c0e3107a781b462a2b67c10cd1e5f05feefb..a9e3078cefcae8cc4672d514a7add162590d48df 100644 index ab1cbcf5ef1ebffd39373bacb2b0983d2c8fa15a..caa22afb0781671b901c23ebcc89e5bb0d2bd615 100644
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java --- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
@@ -90,6 +90,7 @@ public class NetherPortalBlock extends Block { @@ -107,6 +107,7 @@ public class NetherPortalBlock extends Block implements Portal {
@Override @Override
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (entity.canChangeDimensions()) { if (entity.canUsePortal(false)) {
// CraftBukkit start - Entity in portal // CraftBukkit start - Entity in portal
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ())); EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java

View file

@ -7,24 +7,24 @@ Also fixes an issue where upstream isn't
actually getting the correct default attributes actually getting the correct default attributes
diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
index 8afbb8e0cb368e95f23bb78c1261f9aa9b8abd86..0a18983151d17b8e1460b82326b0380087e13795 100644 index de0eba19c0c963adb4f17cea22333240021fd801..3b171a08bd0bedfe224905feb5838d2540199bce 100644
--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
+++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java
@@ -74,7 +74,7 @@ public class CraftAttributeInstance implements AttributeInstance { @@ -75,7 +75,7 @@ public class CraftAttributeInstance implements AttributeInstance {
return new AttributeModifier(nms.id(), nms.name, nms.amount(), AttributeModifier.Operation.values()[nms.operation().ordinal()]); return new AttributeModifier(CraftNamespacedKey.fromMinecraft(nms.id()), nms.amount(), AttributeModifier.Operation.values()[nms.operation().ordinal()], org.bukkit.inventory.EquipmentSlotGroup.ANY);
} }
- public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, EquipmentSlot slot) { - public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, EquipmentSlot slot) {
- return new AttributeModifier(nms.id(), nms.name, nms.amount(), AttributeModifier.Operation.values()[nms.operation().ordinal()], slot); - return new AttributeModifier(CraftNamespacedKey.fromMinecraft(nms.id()), nms.amount(), AttributeModifier.Operation.values()[nms.operation().ordinal()], slot.getGroup());
+ public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, net.minecraft.world.entity.EquipmentSlotGroup slot) { // Paper + public static AttributeModifier convert(net.minecraft.world.entity.ai.attributes.AttributeModifier nms, net.minecraft.world.entity.EquipmentSlotGroup slot) { // Paper
+ return new AttributeModifier(nms.id(), nms.name, nms.amount(), AttributeModifier.Operation.values()[nms.operation().ordinal()], org.bukkit.craftbukkit.CraftEquipmentSlot.getSlot(slot)); // Paper + return new AttributeModifier(CraftNamespacedKey.fromMinecraft(nms.id()), nms.amount(), AttributeModifier.Operation.values()[nms.operation().ordinal()], org.bukkit.craftbukkit.CraftEquipmentSlot.getSlot(slot)); // Paper
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java
index 1218163a4d803288aeb1c9254f8cd03013a9fbcc..5fcf64a30a798a516cd3b30123d16cc5c420e45f 100644 index 761d943658de9c7faadf24584baf63057e99d04a..c0ef1c99fa384fa4f898ef020ec16060a7675e84 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java
@@ -199,15 +199,34 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han @@ -198,15 +198,34 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han
// return CraftEquipmentSlot.getSlot(EntityInsentient.getEquipmentSlotForItem(CraftItemStack.asNMSCopy(ItemStack.of(this)))); // return CraftEquipmentSlot.getSlot(EntityInsentient.getEquipmentSlotForItem(CraftItemStack.asNMSCopy(ItemStack.of(this))));
// } // }
@ -66,7 +66,7 @@ index 1218163a4d803288aeb1c9254f8cd03013a9fbcc..5fcf64a30a798a516cd3b30123d16cc5
return defaultAttributes.build(); return defaultAttributes.build();
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 206f7fff1be676bebef086a0c1b5350cfd175e33..44e3e4c8326dc93292f482c136fe2d6e6b8eb0b6 100644 index 080ab25d3585552c1abd62a9992d48bf094fc065..a867c9de9c2c1798d8e9014f5114b0f4e32b3261 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -400,15 +400,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -400,15 +400,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3816b445279fcd562acc06f08b8cd04bffa49592..3e935df2de58bd57b061c33b00f9d2ea4134ca80 100644 index 58c56636f324f1073bbb03d94f51cd69600a80c4..9a09946b6b178837c44daae894555000668aeb72 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -440,8 +440,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -441,8 +441,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setClearWeatherTime(clearDuration); this.serverLevelData.setClearWeatherTime(clearDuration);
this.serverLevelData.setRainTime(rainDuration); this.serverLevelData.setRainTime(rainDuration);
this.serverLevelData.setThunderTime(rainDuration); this.serverLevelData.setThunderTime(rainDuration);
@ -19,7 +19,7 @@ index 3816b445279fcd562acc06f08b8cd04bffa49592..3e935df2de58bd57b061c33b00f9d2ea
} }
@Override @Override
@@ -874,8 +874,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -875,8 +875,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setThunderTime(j); this.serverLevelData.setThunderTime(j);
this.serverLevelData.setRainTime(k); this.serverLevelData.setRainTime(k);
this.serverLevelData.setClearWeatherTime(i); this.serverLevelData.setClearWeatherTime(i);
@ -30,7 +30,7 @@ index 3816b445279fcd562acc06f08b8cd04bffa49592..3e935df2de58bd57b061c33b00f9d2ea
} }
this.oThunderLevel = this.thunderLevel; this.oThunderLevel = this.thunderLevel;
@@ -942,14 +942,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -943,14 +943,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting @VisibleForTesting
public void resetWeatherCycle() { public void resetWeatherCycle() {
// CraftBukkit start // CraftBukkit start
@ -95,7 +95,7 @@ index e50ad48658193f889d65d37c57b1e30ce46758b7..efd0bcfebb3b4f63018d4e20a6a89f79
if (weather.isCancelled()) { if (weather.isCancelled()) {
return; return;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0f1f5e4cbe476f45f9473cc9ce4e50f837eba652..e75d2970329dd92263bc57c7452d0c46afa3da16 100644 index ab8a2906ee2c5eb3d11001f421e76ddde1172d46..a27fb39dfada76b1d33364b2b3e92e4f5203074b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1231,7 +1231,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -1231,7 +1231,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -5,21 +5,21 @@ Subject: [PATCH] Limit item frame cursors on maps
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 38c0855a6f9398f8d075f304288cf9e9f695770a..ad24a79e190d07c75d8e29e816fc398894771c2c 100644 index d6a0a882331226c3ae4ced09e449eb7931740f8f..a43544704109f21bab230dd9bf0401e28f878582 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -321,8 +321,10 @@ public class MapItemSavedData extends SavedData { @@ -322,8 +322,10 @@ public class MapItemSavedData extends SavedData {
MapFrame worldmapframe1 = new MapFrame(blockposition, entityitemframe.getDirection().get2DDataValue() * 90, entityitemframe.getId()); MapFrame worldmapframe1 = new MapFrame(blockposition, entityitemframe.getDirection().get2DDataValue() * 90, entityitemframe.getId());
+ if (this.decorations.size() < player.level().paperConfig().maps.itemFrameCursorLimit) { // Paper - Limit item frame cursors on maps + if (this.decorations.size() < player.level().paperConfig().maps.itemFrameCursorLimit) { // Paper - Limit item frame cursors on maps
this.addDecoration(MapDecorationTypes.FRAME, player.level(), "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DDataValue() * 90), (Component) null); this.addDecoration(MapDecorationTypes.FRAME, player.level(), MapItemSavedData.getFrameKey(entityitemframe.getId()), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DDataValue() * 90), (Component) null);
this.frameMarkers.put(worldmapframe1.getId(), worldmapframe1); this.frameMarkers.put(worldmapframe1.getId(), worldmapframe1);
+ } // Paper - Limit item frame cursors on maps + } // Paper - Limit item frame cursors on maps
} }
MapDecorations mapdecorations = (MapDecorations) stack.getOrDefault(DataComponents.MAP_DECORATIONS, MapDecorations.EMPTY); MapDecorations mapdecorations = (MapDecorations) stack.getOrDefault(DataComponents.MAP_DECORATIONS, MapDecorations.EMPTY);
@@ -487,7 +489,7 @@ public class MapItemSavedData extends SavedData { @@ -488,7 +490,7 @@ public class MapItemSavedData extends SavedData {
return true; return true;
} }

View file

@ -43,15 +43,15 @@ index dbcf183483766f39334d7f7e8336033906625f3f..300929a406905f5ff1ede664d5b99fb0
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5c47573843c25b0d15037a28e55b616c829f694d..cdbdacee826c424177096ee78427eaf80131b5fd 100644 index fa37c6b43f76af0b82b056cf87ba350abf92e7bb..ee212ed5538357830ea8b69da650ab67d67634bb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2266,7 +2266,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2294,7 +2294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerPlayer entityplayer = (ServerPlayer) iterator.next(); ServerPlayer entityplayer = (ServerPlayer) iterator.next();
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
- entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use configurable message - entityplayer.connection.disconnect(net.kyori.adventure.text.Component.text(org.spigotmc.SpigotConfig.whitelistMessage));
+ entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage, org.bukkit.event.player.PlayerKickEvent.Cause.WHITELIST); // Paper - use configurable message + entityplayer.connection.disconnect(net.kyori.adventure.text.Component.text(org.spigotmc.SpigotConfig.whitelistMessage), org.bukkit.event.player.PlayerKickEvent.Cause.WHITELIST); // Paper - use configurable message & kick event cause
} }
} }
@ -95,134 +95,130 @@ index d1caaecfdfba1cdeba032f0bc38c06541fa61633..6468b3a25c7527a2fde6899e4812b5cb
i++; i++;
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 661765a9fe1c2e49299262190501ee3b3294a2f1..7659a3f50f5a90814dc7331ea00d6251dcf32600 100644 index 24bf661e76fb421a8be565d9ea68edf7205254d2..feb529adf2168025c785ab92d95a3246e73c0236 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -127,7 +127,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -128,7 +128,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
} else if (!this.isSingleplayerOwner()) { } else if (!this.isSingleplayerOwner()) {
// Paper start - This needs to be handled on the main thread for plugins // Paper start - This needs to be handled on the main thread for plugins
server.submit(() -> { server.submit(() -> {
- this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE); - this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE);
+ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause + this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
}); });
// Paper end - This needs to be handled on the main thread for plugins // Paper end - This needs to be handled on the main thread for plugins
} }
@@ -163,7 +163,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -164,7 +164,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
} }
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
- this.disconnect("Invalid payload REGISTER!"); - this.disconnect(Component.literal("Invalid payload REGISTER!"));
+ this.disconnect("Invalid payload REGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause + this.disconnect(Component.literal("Invalid payload REGISTER!"), PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
} }
} else if (identifier.equals(ServerCommonPacketListenerImpl.CUSTOM_UNREGISTER)) { } else if (identifier.equals(ServerCommonPacketListenerImpl.CUSTOM_UNREGISTER)) {
try { try {
@@ -173,7 +173,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -174,7 +174,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
} }
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
- this.disconnect("Invalid payload UNREGISTER!"); - this.disconnect(Component.literal("Invalid payload UNREGISTER!"));
+ this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause + this.disconnect(Component.literal("Invalid payload UNREGISTER!"), PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
} }
} else { } else {
try { try {
@@ -191,7 +191,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -192,7 +192,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), identifier.toString(), data); this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), identifier.toString(), data);
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
- this.disconnect("Invalid custom payload!"); - this.disconnect(Component.literal("Invalid custom payload!"));
+ this.disconnect("Invalid custom payload!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause + this.disconnect(Component.literal("Invalid custom payload!"), PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
} }
} }
@@ -207,7 +207,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -208,7 +208,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
PacketUtils.ensureRunningOnSameThread(packet, this, (BlockableEventLoop) this.server); PacketUtils.ensureRunningOnSameThread(packet, this, (BlockableEventLoop) this.server);
if (packet.action() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { if (packet.action() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id()); ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id());
- this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); - this.disconnect((Component) Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
+ this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - kick event cause + this.disconnect((Component) Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - kick event cause
} }
// Paper start - adventure pack callbacks // Paper start - adventure pack callbacks
// call the callbacks before the previously-existing event so the event has final say // call the callbacks before the previously-existing event so the event has final say
@@ -237,7 +237,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -238,7 +238,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
return; return;
} }
// CraftBukkit end // CraftBukkit end
- this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY); - this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY);
+ this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY, org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_COOKIE); // Paper - kick event cause + this.disconnect(ServerCommonPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY, PlayerKickEvent.Cause.INVALID_COOKIE); // Paper - kick event cause
} }
protected void keepConnectionAlive() { protected void keepConnectionAlive() {
@@ -249,7 +249,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -250,7 +250,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // Paper - use vanilla's 15000L between keep alive packets if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // Paper - use vanilla's 15000L between keep alive packets
if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected
- this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE); - this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE);
+ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause + this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
} else if (this.checkIfClosed(currentTime)) { // Paper } else if (this.checkIfClosed(currentTime)) { // Paper
this.keepAlivePending = true; this.keepAlivePending = true;
this.keepAliveTime = currentTime; this.keepAliveTime = currentTime;
@@ -265,7 +265,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -266,7 +266,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private boolean checkIfClosed(long time) { private boolean checkIfClosed(long time) {
if (this.closed) { if (this.closed) {
if (time - this.closedListenerTime >= 15000L) { if (time - this.closedListenerTime >= 15000L) {
- this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE); - this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE);
+ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause + this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
} }
return false; return false;
@@ -316,18 +316,28 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -318,15 +318,25 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
// CraftBukkit start // Paper start - adventure
- @Deprecated public void disconnect(final net.kyori.adventure.text.Component reason) {
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(reason));
public void disconnect(String s) { // Paper + this.disconnect(reason, PlayerKickEvent.Cause.UNKNOWN);
- this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s)); // Paper + }
+ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); // Paper + public void disconnect(final net.kyori.adventure.text.Component reason, PlayerKickEvent.Cause cause) {
+ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(reason), cause);
+ // Paper end - kick event causes
} }
// CraftBukkit end // Paper end - adventure
+ // Paper start - kick event cause + @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - kick event causes
+ public void disconnect(String s, PlayerKickEvent.Cause cause) { public void disconnect(Component reason) {
+ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), cause); - this.disconnect(new DisconnectionDetails(reason));
+ // Paper start - kick event causes
+ this.disconnect(reason, PlayerKickEvent.Cause.UNKNOWN);
+ } + }
+
// Paper start
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
public void disconnect(final Component reason) {
- this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason));
+ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN);
+ }
+
+ public void disconnect(final Component reason, PlayerKickEvent.Cause cause) { + public void disconnect(final Component reason, PlayerKickEvent.Cause cause) {
+ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason), cause); + this.disconnect(new DisconnectionDetails(reason), cause);
+ // Paper end - kick event causes
} }
- public void disconnect(net.kyori.adventure.text.Component reason) { - public void disconnect(DisconnectionDetails disconnectionInfo) {
+ public void disconnect(net.kyori.adventure.text.Component reason, org.bukkit.event.player.PlayerKickEvent.Cause cause) { // Paper - kick event cause + public void disconnect(DisconnectionDetails disconnectionInfo, PlayerKickEvent.Cause cause) { // Paper - kick event cause
// Paper end
// CraftBukkit start - fire PlayerKickEvent // CraftBukkit start - fire PlayerKickEvent
if (this.processedDisconnect) { if (this.processedDisconnect) {
@@ -337,7 +347,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack return;
@@ -335,7 +345,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
Waitable waitable = new Waitable() { Waitable waitable = new Waitable() {
@Override @Override
protected Object evaluate() { protected Object evaluate() {
- ServerCommonPacketListenerImpl.this.disconnect(reason); // Paper - adventure - ServerCommonPacketListenerImpl.this.disconnect(disconnectionInfo);
+ ServerCommonPacketListenerImpl.this.disconnect(reason, cause); // Paper - adventure + ServerCommonPacketListenerImpl.this.disconnect(disconnectionInfo, cause); // Paper - kick event causes
return null; return null;
} }
}; };
@@ -356,7 +366,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -354,7 +364,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure
- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - adventure - PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(disconnectionInfo.reason()), leaveMessage); // Paper - adventure
+ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage, cause); // Paper - adventure + PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(disconnectionInfo.reason()), leaveMessage, cause); // Paper - adventure & kick event causes
if (this.cserver.getServer().isRunning()) { if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9dd60bdca 100644 index 4a3f6197aae50e35584e3e2134551a955e4b6729..b9db64ac1a3a3e179adf08157a4dbe9c2d1e9682 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -247,8 +243,8 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
- this.disconnect(Component.translatable("multiplayer.disconnect.idling")); - this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause + this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
} }
} }
@ -256,21 +252,21 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) { public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) { if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) {
- this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement")); - this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause + this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause
} else { } else if (!this.updateAwaitingTeleport()) {
Entity entity = this.player.getRootVehicle(); Entity entity = this.player.getRootVehicle();
@@ -683,7 +683,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -686,7 +686,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (packet.getId() == this.awaitingTeleport) { if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) { if (this.awaitingPositionFromClient == null) {
- this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement")); - this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause + this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
return; return;
} }
@@ -741,7 +741,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -744,7 +744,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
// CraftBukkit start // CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - configurable tab spam limits if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - configurable tab spam limits
@ -279,7 +275,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return; return;
} }
// CraftBukkit end // CraftBukkit end
@@ -906,7 +906,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -909,7 +909,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - validate pick item position // Paper start - validate pick item position
if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) { if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -288,7 +284,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return; return;
} }
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
@@ -1085,7 +1085,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1088,7 +1088,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) { if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
@ -297,7 +293,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return; return;
} }
byteTotal += byteLength; byteTotal += byteLength;
@@ -1108,14 +1108,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1111,14 +1111,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (byteTotal > byteAllowed) { if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
@ -309,48 +305,48 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
// Paper end - Book size limits // Paper end - Book size limits
// CraftBukkit start // CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) { if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
- this.disconnect("Book edited too quickly!"); - this.disconnect(Component.literal("Book edited too quickly!"));
+ this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause + this.disconnect(Component.literal("Book edited too quickly!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return; return;
} }
this.lastBookTick = MinecraftServer.currentTick; this.lastBookTick = MinecraftServer.currentTick;
@@ -1227,7 +1227,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1230,7 +1230,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleMovePlayer(ServerboundMovePlayerPacket packet) { public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
- this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement")); - this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause + this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
} else { } else {
ServerLevel worldserver = this.player.serverLevel(); ServerLevel worldserver = this.player.serverLevel();
@@ -1656,7 +1656,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1668,7 +1668,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.dropCount++; this.dropCount++;
if (this.dropCount >= 20) { if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
- this.disconnect("You dropped your items too quickly (Hacking?)"); - this.disconnect(Component.literal("You dropped your items too quickly (Hacking?)"));
+ this.disconnect("You dropped your items too quickly (Hacking?)", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause + this.disconnect(Component.literal("You dropped your items too quickly (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return; return;
} }
} }
@@ -1939,7 +1939,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1956,7 +1956,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime(); this.player.resetLastActionTime();
} else { } else {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
- this.disconnect("Invalid hotbar selection (Hacking?)"); // CraftBukkit - this.disconnect(Component.literal("Invalid hotbar selection (Hacking?)")); // CraftBukkit
+ this.disconnect("Invalid hotbar selection (Hacking?)", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // CraftBukkit // Paper - kick event cause + this.disconnect(Component.literal("Invalid hotbar selection (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // CraftBukkit // Paper - kick event cause
} }
} }
@@ -2137,7 +2137,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2154,7 +2154,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit
if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) {
- this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters")); - this.disconnect((Component) Component.translatable("multiplayer.disconnect.illegal_characters"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper + this.disconnect((Component) Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
} else { } else {
@@ -2160,7 +2160,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2177,7 +2177,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (optional.isEmpty()) { if (optional.isEmpty()) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -359,16 +355,16 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} }
return optional; return optional;
@@ -2346,7 +2346,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2363,7 +2363,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// this.chatSpamTickCount += 20; // this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
// CraftBukkit end // CraftBukkit end
- this.disconnect(Component.translatable("disconnect.spam")); - this.disconnect((Component) Component.translatable("disconnect.spam"));
+ this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause + this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
} }
} }
@@ -2358,7 +2358,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2375,7 +2375,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
synchronized (this.lastSeenMessages) { synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) { if (!this.lastSeenMessages.applyOffset(packet.offset())) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -377,34 +373,34 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} }
} }
@@ -2506,7 +2506,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2523,7 +2523,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
if (i > 4096) { if (i > 4096) {
- this.disconnect(Component.translatable("multiplayer.disconnect.too_many_pending_chats")); - this.disconnect((Component) Component.translatable("multiplayer.disconnect.too_many_pending_chats"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.too_many_pending_chats"), org.bukkit.event.player.PlayerKickEvent.Cause.TOO_MANY_PENDING_CHATS); // Paper - kick event cause + this.disconnect((Component) Component.translatable("multiplayer.disconnect.too_many_pending_chats"), org.bukkit.event.player.PlayerKickEvent.Cause.TOO_MANY_PENDING_CHATS); // Paper - kick event cause
} }
} }
@@ -2564,7 +2564,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2581,7 +2581,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start // Spigot Start
if ( entity == this.player && !this.player.isSpectator() ) if ( entity == this.player && !this.player.isSpectator() )
{ {
- this.disconnect( "Cannot interact with self!" ); - this.disconnect( Component.literal( "Cannot interact with self!" ) );
+ this.disconnect( "Cannot interact with self!" , org.bukkit.event.player.PlayerKickEvent.Cause.SELF_INTERACTION ); // Paper - kick event cause + this.disconnect( Component.literal( "Cannot interact with self!" ), org.bukkit.event.player.PlayerKickEvent.Cause.SELF_INTERACTION ); // Paper - kick event cause
return; return;
} }
// Spigot End // Spigot End
@@ -2678,7 +2678,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2695,7 +2695,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
} }
- ServerGamePacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.invalid_entity_attacked")); - ServerGamePacketListenerImpl.this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_entity_attacked"));
+ ServerGamePacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.invalid_entity_attacked"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_ENTITY_ATTACKED); // Paper - add cause + ServerGamePacketListenerImpl.this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_entity_attacked"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_ENTITY_ATTACKED); // Paper - add cause
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
} }
}); });
@@ -3075,7 +3075,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3092,7 +3092,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - auto recipe limit // Paper start - auto recipe limit
if (!org.bukkit.Bukkit.isPrimaryThread()) { if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -413,7 +409,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return; return;
} }
} }
@@ -3317,7 +3317,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3334,7 +3334,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) { if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) {
if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) { if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) {
@ -422,7 +418,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} else { } else {
try { try {
SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator(); SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator();
@@ -3330,7 +3330,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3347,7 +3347,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
} catch (ProfilePublicKey.ValidationException profilepublickey_b) { } catch (ProfilePublicKey.ValidationException profilepublickey_b) {
ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage());
@ -432,10 +428,10 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 40d1451b43228b802aabe8c021ad781ceb8d8df8..709cf6655e5ccb17caf0b8a735ae957cb0509f2c 100644 index 995f085b0a1c7b14c4942dd4ed700f0271e18ec5..51f723ef7362ff3eb1bb58f2a75acd12928fabac 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -681,7 +681,7 @@ public abstract class PlayerList { @@ -675,7 +675,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) { while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next(); entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@ -444,17 +440,15 @@ index 40d1451b43228b802aabe8c021ad781ceb8d8df8..709cf6655e5ccb17caf0b8a735ae957c
} }
// Instead of kicking then returning, we need to store the kick reason // Instead of kicking then returning, we need to store the kick reason
@@ -1318,8 +1318,8 @@ public abstract class PlayerList { @@ -1272,7 +1272,7 @@ public abstract class PlayerList {
// Paper end // Paper end
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) { for (ServerPlayer player : this.players) {
- if (isRestarting) player.connection.disconnect(org.spigotmc.SpigotConfig.restartMessage); else // Paper - if (isRestarting) player.connection.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.restartMessage)); else // Paper
- player.connection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure + if (isRestarting) player.connection.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.restartMessage), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); else // Paper - kick event cause (cause is never used here)
+ if (isRestarting) player.connection.disconnect(org.spigotmc.SpigotConfig.restartMessage, org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); else // Paper - kick event cause (cause is never used here) player.connection.disconnect(java.util.Objects.requireNonNullElseGet(this.server.server.shutdownMessage(), net.kyori.adventure.text.Component::empty)); // CraftBukkit - add custom shutdown message // Paper - Adventure
+ player.connection.disconnect(this.server.server.shutdownMessage(), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN); // CraftBukkit - add custom shutdown message // Paper - Adventure & KickEventCause (cause is never used here)
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java b/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java diff --git a/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java b/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java
index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66cecfda7d2 100644 index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66cecfda7d2 100644
--- a/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java --- a/src/main/java/net/minecraft/world/entity/player/ProfilePublicKey.java
@ -486,19 +480,19 @@ index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66c
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9a3ba0011f306a3cd1e3c60fcc329ab93011ebd8..eee0c49bbf9bc768fcf7275c29536b4f16b1d421 100644 index ed08f30d7163d01b5c280d20ea721da8d7f4b41e..26a8006a1daa9eecb226732a5a33d2a5d1cdedf9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -633,7 +633,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -635,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot
if (this.getHandle().connection == null) return; if (this.getHandle().connection == null) return;
- this.getHandle().connection.disconnect(message == null ? "" : message); - this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message));
+ this.getHandle().connection.disconnect(message == null ? "" : message, org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause + this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message), org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause
} }
// Paper start // Paper start
@@ -645,10 +645,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -647,10 +647,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void kick(final net.kyori.adventure.text.Component message) { public void kick(final net.kyori.adventure.text.Component message) {
@ -515,7 +509,7 @@ index 9a3ba0011f306a3cd1e3c60fcc329ab93011ebd8..eee0c49bbf9bc768fcf7275c29536b4f
} }
} }
@@ -707,7 +712,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -709,7 +714,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start - Improve chat handling // Paper start - Improve chat handling
if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) {
@ -525,15 +519,15 @@ index 9a3ba0011f306a3cd1e3c60fcc329ab93011ebd8..eee0c49bbf9bc768fcf7275c29536b4f
if (msg.startsWith("/")) { if (msg.startsWith("/")) {
this.getHandle().connection.handleCommand(msg); this.getHandle().connection.handleCommand(msg);
diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java
index 051b9e3a5d29a5840d596468e3ddd013bedc8da3..e3b262add194a126e731c68e68f3139a00cacacb 100644 index 9a1fffa0c07c24eed8bd6ea8f3cd26c9f926c54d..f3fa0340babfc5eb627066115164e2d885c602c2 100644
--- a/src/main/java/org/spigotmc/RestartCommand.java --- a/src/main/java/org/spigotmc/RestartCommand.java
+++ b/src/main/java/org/spigotmc/RestartCommand.java +++ b/src/main/java/org/spigotmc/RestartCommand.java
@@ -73,7 +73,7 @@ public class RestartCommand extends Command @@ -74,7 +74,7 @@ public class RestartCommand extends Command
// Kick all players // Kick all players
for ( ServerPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) for ( ServerPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) )
{ {
- p.connection.disconnect(SpigotConfig.restartMessage); - p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) );
+ p.connection.disconnect(SpigotConfig.restartMessage, org.bukkit.event.player.PlayerKickEvent.Cause.RESTART_COMMAND); // Paper - kick event reason (cause is never used)) + p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ), org.bukkit.event.player.PlayerKickEvent.Cause.RESTART_COMMAND); // Paper - kick event reason (cause is never used))
} }
// Give the socket a chance to send the packets // Give the socket a chance to send the packets
try try

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix PlayerBucketEmptyEvent result itemstack
Fixes SPIGOT-2560: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-2560 Fixes SPIGOT-2560: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-2560
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
index b20263db1988529dd6e7969d65ee30096f10d591..6d494b80ae002aea00afa44adf83dad1ae5bbbc1 100644 index 7617b6a0ad44e8b135d071836dc30df5ad062c42..6caed156ed0cfe0017d578f58cb963ee68272d78 100644
--- a/src/main/java/net/minecraft/world/item/BucketItem.java --- a/src/main/java/net/minecraft/world/item/BucketItem.java
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java +++ b/src/main/java/net/minecraft/world/item/BucketItem.java
@@ -40,6 +40,8 @@ import org.bukkit.event.player.PlayerBucketFillEvent; @@ -40,6 +40,8 @@ import org.bukkit.event.player.PlayerBucketFillEvent;
@ -18,7 +18,7 @@ index b20263db1988529dd6e7969d65ee30096f10d591..6d494b80ae002aea00afa44adf83dad1
public final Fluid content; public final Fluid content;
public BucketItem(Fluid fluid, Item.Properties settings) { public BucketItem(Fluid fluid, Item.Properties settings) {
@@ -123,6 +125,13 @@ public class BucketItem extends Item implements DispensibleContainerItem { @@ -125,6 +127,13 @@ public class BucketItem extends Item implements DispensibleContainerItem {
} }
public static ItemStack getEmptySuccessItem(ItemStack stack, Player player) { public static ItemStack getEmptySuccessItem(ItemStack stack, Player player) {
@ -32,7 +32,7 @@ index b20263db1988529dd6e7969d65ee30096f10d591..6d494b80ae002aea00afa44adf83dad1
return !player.hasInfiniteMaterials() ? new ItemStack(Items.BUCKET) : stack; return !player.hasInfiniteMaterials() ? new ItemStack(Items.BUCKET) : stack;
} }
@@ -180,6 +189,7 @@ public class BucketItem extends Item implements DispensibleContainerItem { @@ -182,6 +191,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541 ((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
return false; return false;
} }

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to fix items merging through walls
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index a6dc7c7aab40a9b21c7debd0f9a1619238cff94c..1817e8876f13695578b0a5b2f75e738b3286db48 100644 index 2e550c7db6cebc941590c35337fd47416407a5aa..5448a0f54080ac02bc4ce8ad5645173b67841e1a 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -283,6 +283,14 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -284,6 +284,14 @@ public class ItemEntity extends Entity implements TraceableEntity {
ItemEntity entityitem = (ItemEntity) iterator.next(); ItemEntity entityitem = (ItemEntity) iterator.next();
if (entityitem.isMergable()) { if (entityitem.isMergable()) {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix invulnerable end crystals
MC-108513 MC-108513
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
index dd0c441fef3b4db28d6ba52118095600512ffe9c..d8e440e14b72dc48ae97244f1bed2c06abd997ab 100644 index 6f8d4584aae56fc7fbcbc38b1291ea415208fd5e..a33d89fe9ca9e343edab8bb1cc88c54130ddb4a7 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
@@ -30,6 +30,7 @@ public class EndCrystal extends Entity { @@ -30,6 +30,7 @@ public class EndCrystal extends Entity {
@ -17,7 +17,7 @@ index dd0c441fef3b4db28d6ba52118095600512ffe9c..d8e440e14b72dc48ae97244f1bed2c06
public EndCrystal(EntityType<? extends EndCrystal> type, Level world) { public EndCrystal(EntityType<? extends EndCrystal> type, Level world) {
super(type, world); super(type, world);
@@ -66,6 +67,17 @@ public class EndCrystal extends Entity { @@ -68,6 +69,17 @@ public class EndCrystal extends Entity {
} }
// CraftBukkit end // CraftBukkit end
} }
@ -35,7 +35,7 @@ index dd0c441fef3b4db28d6ba52118095600512ffe9c..d8e440e14b72dc48ae97244f1bed2c06
} }
} }
@@ -77,6 +89,7 @@ public class EndCrystal extends Entity { @@ -79,6 +91,7 @@ public class EndCrystal extends Entity {
} }
nbt.putBoolean("ShowBottom", this.showsBottom()); nbt.putBoolean("ShowBottom", this.showsBottom());
@ -43,7 +43,7 @@ index dd0c441fef3b4db28d6ba52118095600512ffe9c..d8e440e14b72dc48ae97244f1bed2c06
} }
@Override @Override
@@ -85,6 +98,7 @@ public class EndCrystal extends Entity { @@ -87,6 +100,7 @@ public class EndCrystal extends Entity {
if (nbt.contains("ShowBottom", 1)) { if (nbt.contains("ShowBottom", 1)) {
this.setShowBottom(nbt.getBoolean("ShowBottom")); this.setShowBottom(nbt.getBoolean("ShowBottom"));
} }

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 5b03665a04a68dc49fb0100b58148ffa2d8f6000..f6febeb8f24b227520cda80efac7e43c023f1b10 100644 index 55381753736e3ec4a84730f22731544cdddfcb29..3bcc79b4f4d69ca7bbf1c8311869243853a19f3e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3704,7 +3704,8 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3726,7 +3726,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
@ -19,10 +19,10 @@ index 5b03665a04a68dc49fb0100b58148ffa2d8f6000..f6febeb8f24b227520cda80efac7e43c
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index 9bf4d9eaa961196873b3be89c2ca05e701025871..54a79d802806d5354db74d27c04458e8baedfa0c 100644 index 04a39cb6c13c26e2cb1d73a9da98df5d04df69bc..5d137f8c42356359701e1bea7525f82c018b502c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -519,5 +519,21 @@ public abstract class CraftRegionAccessor implements RegionAccessor { @@ -520,5 +520,21 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
public org.bukkit.NamespacedKey getKey() { public org.bukkit.NamespacedKey getKey() {
return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.getHandle().getLevel().dimension().location()); return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.getHandle().getLevel().dimension().location());
} }
@ -45,10 +45,10 @@ index 9bf4d9eaa961196873b3be89c2ca05e701025871..54a79d802806d5354db74d27c04458e8
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 2701e53086f4be07c341cd1e4fcd7a351e77c486..1cfc3d18fb785410f5acfcf3c338776858efe25a 100644 index 36ec4032ade4b0f7ae9428e7871354ef9527f0c8..c23f60a6a3bc294a6ce68b6e72f8eda30812a8f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -627,6 +627,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -629,6 +629,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return this.getHandle().hasLineOfSight(((CraftEntity) other).getHandle()); return this.getHandle().hasLineOfSight(((CraftEntity) other).getHandle());
} }

View file

@ -5,7 +5,7 @@ Subject: [PATCH] add per world spawn limits
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e75d2970329dd92263bc57c7452d0c46afa3da16..e10043db80ee5dc6468c8caa16d55ad418fa3670 100644 index a27fb39dfada76b1d33364b2b3e92e4f5203074b..6734f9e22e9bd1d1b385812d35a72487fe2b7b9b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -222,6 +222,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -222,6 +222,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -8,10 +8,10 @@ Fixes SPIGOT-6221: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-6
Fix splash events cancellation that still show particles/sound Fix splash events cancellation that still show particles/sound
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
index d7fe99e55b64b66af7795c2d0aeca69023f93bae..bf627d66310f201172d3cd3ea12f1d321cd3cd62 100644 index be787a5b52e90796d4f06e17e564f4324807c3e6..cb34cc9443da56c0497c7a0192c8b8363c3426fe 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
@@ -104,55 +104,76 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @@ -106,55 +106,76 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
ItemStack itemstack = this.getItem(); ItemStack itemstack = this.getItem();
PotionContents potioncontents = (PotionContents) itemstack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); PotionContents potioncontents = (PotionContents) itemstack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
@ -103,7 +103,7 @@ index d7fe99e55b64b66af7795c2d0aeca69023f93bae..bf627d66310f201172d3cd3ea12f1d32
AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D); AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
List<net.minecraft.world.entity.LivingEntity> list = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb); List<net.minecraft.world.entity.LivingEntity> list = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb);
Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit
@@ -170,6 +191,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @@ -172,6 +193,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
if (d0 < 16.0D) { if (d0 < 16.0D) {
double d1; double d1;
@ -111,7 +111,7 @@ index d7fe99e55b64b66af7795c2d0aeca69023f93bae..bf627d66310f201172d3cd3ea12f1d32
if (entityliving == entity) { if (entityliving == entity) {
d1 = 1.0D; d1 = 1.0D;
} else { } else {
@@ -225,10 +247,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @@ -227,10 +249,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
} }
} }
} }
@ -124,7 +124,7 @@ index d7fe99e55b64b66af7795c2d0aeca69023f93bae..bf627d66310f201172d3cd3ea12f1d32
AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ()); AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
Entity entity = this.getOwner(); Entity entity = this.getOwner();
@@ -241,14 +264,16 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @@ -243,14 +266,16 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
entityareaeffectcloud.setWaitTime(10); entityareaeffectcloud.setWaitTime(10);
entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration()); entityareaeffectcloud.setRadiusPerTick(-entityareaeffectcloud.getRadius() / (float) entityareaeffectcloud.getDuration());
entityareaeffectcloud.setPotionContents(potioncontents); entityareaeffectcloud.setPotionContents(potioncontents);
@ -143,10 +143,10 @@ index d7fe99e55b64b66af7795c2d0aeca69023f93bae..bf627d66310f201172d3cd3ea12f1d32
public boolean isLingering() { public boolean isLingering() {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b3aceea0a7f57f32da3924ed73231a0dc65ccc51..3102324bfdaa82826eead1f40d24bf13553f6506 100644 index 388f0a53e993b84376ce2549c6b041bed283b8a7..f99247b37a6fb04d27611051908364bcde168afa 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -875,6 +875,32 @@ public class CraftEventFactory { @@ -876,6 +876,32 @@ public class CraftEventFactory {
return event; return event;
} }

View file

@ -31,10 +31,10 @@ index c81fd3e1108fb0a02f9240263404af2b968c8494..0d9de4c61c7b26a6ff37c12fde629161
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 2ff11c9aff04f404d45e0b267285e2b4a2a23b6f..b342516707448ab5f0f1e763bf6be3f004b9e4b4 100644 index ff6a8a3977ec489a372c72323e6285c16f00bd7f..90855f6929a0de660d0827aff41f466677d80e0b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2434,7 +2434,7 @@ public class ServerPlayer extends Player { @@ -2483,7 +2483,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
if (retainOwnership) { if (retainOwnership) {
if (!itemstack1.isEmpty()) { if (!itemstack1.isEmpty()) {
@ -44,10 +44,10 @@ index 2ff11c9aff04f404d45e0b267285e2b4a2a23b6f..b342516707448ab5f0f1e763bf6be3f0
this.awardStat(Stats.DROP); this.awardStat(Stats.DROP);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 444e226a32062efff45e3d3d42fdc756787bc6ac..56f7a753d2167504b6d91219093097323a9081c5 100644 index 6ce03f49f5085cf468ae2114f08f1faa1b099aaa..c89b7cf63d067895bbd07f43eef467ff1861f625 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -726,6 +726,11 @@ public abstract class Player extends LivingEntity { @@ -744,6 +744,11 @@ public abstract class Player extends LivingEntity {
} }
double d0 = this.getEyeY() - 0.30000001192092896D; double d0 = this.getEyeY() - 0.30000001192092896D;

View file

@ -128,10 +128,10 @@ index 2cd61138dfaa82fa698ef8d32d690f51f621ee3b..957eb2ba3f647f70522243fedf36b921
this.leader = null; this.leader = null;
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index d4389172c3c006ebec5d9cd8213cdd499ab39b68..d317b8500e8d2c280e52140440cf2b9cb61c3b28 100644 index 615b57fac9def18d9dcaefcfe397c74c11cac627..f933654b66f7474dc071da5f10cf1684fdac367a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -543,11 +543,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -554,11 +554,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.setFlag(4, hasStung); this.setFlag(4, hasStung);
} }
@ -146,7 +146,7 @@ index d4389172c3c006ebec5d9cd8213cdd499ab39b68..d317b8500e8d2c280e52140440cf2b9c
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index 864cb9bd4c71e41cf2ed165e5d252ccb613de6cb..290d41136f5ec7671bc4990dfe50da0a770c124d 100644 index b06d39d3bd39a4dc4f273a359a89592d3b8cf184..43046f4a0cff620834ac4647efdcde227185b2ff 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java --- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -50,6 +50,7 @@ public class Tadpole extends AbstractFish { @@ -50,6 +50,7 @@ public class Tadpole extends AbstractFish {
@ -206,10 +206,10 @@ index 864cb9bd4c71e41cf2ed165e5d252ccb613de6cb..290d41136f5ec7671bc4990dfe50da0a
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
index d53ef42e64d87790ea86d806153f047005accb9f..57952ad65c905265799ba2d8f99cc4cf4aa69f94 100644 index affa2e133611b7a045a99bac801398263d114ba7..f1e43254936feedfe0ffbf77071505f3a65e5053 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
@@ -753,6 +753,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -760,6 +760,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
} }
@ -225,7 +225,7 @@ index d53ef42e64d87790ea86d806153f047005accb9f..57952ad65c905265799ba2d8f99cc4cf
@Override @Override
public InteractionResult mobInteract(Player player, InteractionHand hand) { public InteractionResult mobInteract(Player player, InteractionHand hand) {
if (!this.isVehicle() && !this.isBaby()) { if (!this.isVehicle() && !this.isBaby()) {
@@ -795,6 +804,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -802,6 +811,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
this.setFlag(16, eatingGrass); this.setFlag(16, eatingGrass);
} }
@ -238,7 +238,7 @@ index d53ef42e64d87790ea86d806153f047005accb9f..57952ad65c905265799ba2d8f99cc4cf
if (angry) { if (angry) {
this.setEating(false); this.setEating(false);
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
index 37da58385ecf40baeb4665a0d9c262da03c01763..b6574ffbe3b9fac6ce0f4d398508c9914139f7ec 100644 index 8afd453deda455bd486c9a4a69790151f5012f62..33b7e578f39608d522a9c270cac69be44a34456b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
@@ -74,10 +74,11 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V @@ -74,10 +74,11 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@ -254,7 +254,7 @@ index 37da58385ecf40baeb4665a0d9c262da03c01763..b6574ffbe3b9fac6ce0f4d398508c991
} }
public boolean isTraderLlama() { public boolean isTraderLlama() {
@@ -318,7 +319,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V @@ -313,7 +314,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@Override @Override
public int getMaxTemper() { public int getMaxTemper() {
@ -264,7 +264,7 @@ index 37da58385ecf40baeb4665a0d9c262da03c01763..b6574ffbe3b9fac6ce0f4d398508c991
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index b0ac85dc3c67d2e4d70dfb09d4e8fc349aba14d2..b5cb4e4682f66ac9423af8d1547d0f1a4f9e6c5d 100644 index 3ee24382ef3614ff0c5d5cdc614a41286ba4af5e..3cd4a744c3e3aeba90f342de9dea67ef2f3de626 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -88,6 +88,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -88,6 +88,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@ -279,20 +279,20 @@ index b0ac85dc3c67d2e4d70dfb09d4e8fc349aba14d2..b5cb4e4682f66ac9423af8d1547d0f1a
public WitherBoss(EntityType<? extends WitherBoss> type, Level world) { public WitherBoss(EntityType<? extends WitherBoss> type, Level world) {
super(type, world); super(type, world);
@@ -594,7 +599,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -595,7 +600,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@Override @Override
public boolean canChangeDimensions() { public boolean canUsePortal(boolean allowVehicles) {
- return false; - return false;
+ return super.canChangeDimensions() && canPortal; // Paper + return this.canPortal; // Paper
} }
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index 853d65025d5e049467c1f1e7322580880506c347..57f84a0eccbdb051adddc25a1a7126f60c7c274b 100644 index 0214e8bbcaefdd92ee3719d9a570f9d256ee29ba..7caa5469a4daa5d0c569f446ff2d597a9f10e8ac 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -440,6 +440,16 @@ public class EnderMan extends Monster implements NeutralMob { @@ -442,6 +442,16 @@ public class EnderMan extends Monster implements NeutralMob {
this.entityData.set(EnderMan.DATA_STARED_AT, true); this.entityData.set(EnderMan.DATA_STARED_AT, true);
} }
@ -310,7 +310,7 @@ index 853d65025d5e049467c1f1e7322580880506c347..57f84a0eccbdb051adddc25a1a7126f6
public boolean requiresCustomPersistence() { public boolean requiresCustomPersistence() {
return super.requiresCustomPersistence() || this.getCarriedBlock() != null; return super.requiresCustomPersistence() || this.getCarriedBlock() != null;
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
index ba7104784cbbbb6eeacf0ca333af20212f6c47b0..373a4f036157017b0d95e8f1849780582235a549 100644 index 603e948583ce0a99fc0061a85f495e8262659035..a836a902bebf318ceabaed4e98fab1141b46a28b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Ghast.java --- a/src/main/java/net/minecraft/world/entity/monster/Ghast.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Ghast.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
@@ -65,6 +65,12 @@ public class Ghast extends FlyingMob implements Enemy { @@ -65,6 +65,12 @@ public class Ghast extends FlyingMob implements Enemy {
@ -327,10 +327,10 @@ index ba7104784cbbbb6eeacf0ca333af20212f6c47b0..373a4f036157017b0d95e8f184978058
protected boolean shouldDespawnInPeaceful() { protected boolean shouldDespawnInPeaceful() {
return true; return true;
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index b6653a942b07c2d1f7774054a68bf04d547d7cc0..deedc707971be0bd1b7757f4e9b6d2729cc669d0 100644 index 9cf453248b6ee9e1af9f5945b1e515a9ad7ff236..f8c733961015ace508bfe14fd61d5188ca9d551b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -202,6 +202,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -205,6 +205,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
} }
public void startConverting(@Nullable UUID uuid, int delay) { public void startConverting(@Nullable UUID uuid, int delay) {
@ -343,7 +343,7 @@ index b6653a942b07c2d1f7774054a68bf04d547d7cc0..deedc707971be0bd1b7757f4e9b6d272
this.conversionStarter = uuid; this.conversionStarter = uuid;
this.villagerConversionTime = delay; this.villagerConversionTime = delay;
this.getEntityData().set(ZombieVillager.DATA_CONVERTING_ID, true); this.getEntityData().set(ZombieVillager.DATA_CONVERTING_ID, true);
@@ -209,7 +215,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -212,7 +218,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
this.removeEffect(MobEffects.WEAKNESS, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); this.removeEffect(MobEffects.WEAKNESS, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
this.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, delay, Math.min(this.level().getDifficulty().getId() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); this.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, delay, Math.min(this.level().getDifficulty().getId() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
// CraftBukkit end // CraftBukkit end
@ -353,10 +353,10 @@ index b6653a942b07c2d1f7774054a68bf04d547d7cc0..deedc707971be0bd1b7757f4e9b6d272
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
index 636638bfee54618b36b09d49a76a46d47e1d09b4..c75ac52f302e8e29e0bdea32c85ccf6713257a9b 100644 index 46b67c38dccf911973e6a7643f06972019073eb2..e45c3a9805d9fac1fabe6d891c817743acd9969e 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
@@ -105,6 +105,20 @@ public class ThrownTrident extends AbstractArrow { @@ -106,6 +106,20 @@ public class ThrownTrident extends AbstractArrow {
return (Boolean) this.entityData.get(ThrownTrident.ID_FOIL); return (Boolean) this.entityData.get(ThrownTrident.ID_FOIL);
} }
@ -705,10 +705,10 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index d30e1dd1b4525674c8a52da9b677c09a251b2467..9edcdc71b28cf08e42fbe44723ba540e8d4f7808 100644 index 4134bfb3579e91367644df517c161c1b40cdbe66..7310f53747e68b918f132ee0f0a142e36537902e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1067,4 +1067,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1084,4 +1084,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return set; return set;
} }
// Paper end - tracked players API // Paper end - tracked players API
@ -737,11 +737,11 @@ index d30e1dd1b4525674c8a52da9b677c09a251b2467..9edcdc71b28cf08e42fbe44723ba540e
+ // Paper end - missing entity api + // Paper end - missing entity api
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
index 763cfa6cfc8447c5a963e79f128e734efe542f89..b0a02c9ca4349ab56ceceae8b78559e20a9b0af5 100644 index 142f3e3257afebb2e831fd0970678123d99a1717..1b084d63bdbb24dad45d28eed1693eb6e26e24dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
@@ -84,6 +84,18 @@ public class CraftFireball extends AbstractProjectile implements Fireball { @@ -84,6 +84,18 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
return new Vector(this.getHandle().xPower, this.getHandle().yPower, this.getHandle().zPower); return new Vector(delta.x, delta.y, delta.z);
} }
+ // Paper start - Expose power on fireball projectiles + // Paper start - Expose power on fireball projectiles
@ -828,10 +828,10 @@ index 2cec61a1bb050c1ef81c5fc3d0afafe9ff29d459..97fa4e1e70203194bd939618b2fad926
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 1cfc3d18fb785410f5acfcf3c338776858efe25a..e549c827d68ca96afea1ffdabf6802275c3328d1 100644 index c23f60a6a3bc294a6ce68b6e72f8eda30812a8f8..af0a44df65277dae72dfb3496c9296bf4ac73da3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -122,6 +122,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -123,6 +123,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
} }
} }
@ -845,7 +845,7 @@ index 1cfc3d18fb785410f5acfcf3c338776858efe25a..e549c827d68ca96afea1ffdabf680227
@Override @Override
public double getAbsorptionAmount() { public double getAbsorptionAmount() {
return this.getHandle().getAbsorptionAmount(); return this.getHandle().getAbsorptionAmount();
@@ -906,14 +913,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -908,14 +915,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override @Override
public boolean isInvisible() { public boolean isInvisible() {

View file

@ -5,15 +5,15 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1f6e123fbd146129e5460631fdd88de9dd60bdca..66d6bd361edfb04eeed4076feb20cb8861d48874 100644 index b9db64ac1a3a3e179adf08157a4dbe9c2d1e9682..13d052ae4661b6d725d016cc35437a0125e098d7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1115,7 +1115,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1118,7 +1118,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper end - Book size limits // Paper end - Book size limits
// CraftBukkit start // CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) { if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
- this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause - this.disconnect(Component.literal("Book edited too quickly!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
+ server.scheduleOnMain(() -> this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause // Paper - Also ensure this is called on main + server.scheduleOnMain(() -> this.disconnect(Component.literal("Book edited too quickly!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause // Paper - Also ensure this is called on main
return; return;
} }
this.lastBookTick = MinecraftServer.currentTick; this.lastBookTick = MinecraftServer.currentTick;

View file

@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case). load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3e935df2de58bd57b061c33b00f9d2ea4134ca80..eecc5704582ce7c9a45adee8057d8297eae03a86 100644 index 9a09946b6b178837c44daae894555000668aeb72..8c268f57d44d70df3210510abf7832939d41781d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -230,7 +230,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -231,7 +231,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
public LevelChunk getChunkIfLoaded(int x, int z) { public LevelChunk getChunkIfLoaded(int x, int z) {
@ -21,10 +21,10 @@ index 3e935df2de58bd57b061c33b00f9d2ea4134ca80..eecc5704582ce7c9a45adee8057d8297
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 88b09635590958b4edf992490dd30616c35d4d6d..fd5dc0e09c89f4e21fde5d06b0fc0d4d45e52280 100644 index cfd5d3e50197b38d0ffef6debbb7f5b4b208382a..ed1fc466151ebebf7c3ac135c6893f4ea9a55a52 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -179,6 +179,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -180,6 +180,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return (CraftServer) Bukkit.getServer(); return (CraftServer) Bukkit.getServer();
} }

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 66d6bd361edfb04eeed4076feb20cb8861d48874..dd3767f482929d7d8105a4164c27651099935a89 100644 index 13d052ae4661b6d725d016cc35437a0125e098d7..0a21e25e7a7771e1c86a857af8133cf7203333e3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2396,7 +2396,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2413,7 +2413,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} // Paper end - Call interact event } // Paper end - Call interact event
// Arm swing animation // Arm swing animation

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index b342516707448ab5f0f1e763bf6be3f004b9e4b4..ea2c8c91408cb65b3b6a520877c9273dbffd0ac1 100644 index 90855f6929a0de660d0827aff41f466677d80e0b..db04b3dcd83599042c02566b533a8ec0c9f0fcd4 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -285,7 +285,6 @@ public class ServerPlayer extends Player { @@ -289,7 +289,6 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
public boolean joining = true; public boolean joining = true;
public boolean sentListPacket = false; public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
@ -17,63 +17,63 @@ index b342516707448ab5f0f1e763bf6be3f004b9e4b4..ea2c8c91408cb65b3b6a520877c9273d
public boolean isRealPlayer; // Paper public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 7659a3f50f5a90814dc7331ea00d6251dcf32600..308aef9c4933b2bcdd622a34b68efab4a220fe4d 100644 index feb529adf2168025c785ab92d95a3246e73c0236..7ab900fcb949962d226b8293360bb42f7cb0836b 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -109,6 +109,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -110,6 +110,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@Override @Override
public void onDisconnect(Component reason) { public void onDisconnect(DisconnectionDetails info) {
+ // Paper start - Fix kick event leave message not being sent + // Paper start - Fix kick event leave message not being sent
+ this.onDisconnect(reason, null); + this.onDisconnect(info, null);
+ } + }
+ public void onDisconnect(Component reason, @Nullable net.kyori.adventure.text.Component quitMessage) { + public void onDisconnect(DisconnectionDetails info, @Nullable net.kyori.adventure.text.Component quitMessage) {
+ // Paper end - Fix kick event leave message not being sent + // Paper end - Fix kick event leave message not being sent
if (this.isSingleplayerOwner()) { if (this.isSingleplayerOwner()) {
ServerCommonPacketListenerImpl.LOGGER.info("Stopping singleplayer server as player logged out"); ServerCommonPacketListenerImpl.LOGGER.info("Stopping singleplayer server as player logged out");
this.server.halt(false); this.server.halt(false);
@@ -376,7 +381,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -374,7 +379,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
// Do not kick the player // Do not kick the player
return; return;
} }
- this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent - this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent
// Send the possibly modified leave message // Send the possibly modified leave message
final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure this.disconnect0(new DisconnectionDetails(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()), disconnectionInfo.report(), disconnectionInfo.bugReportLink())); // Paper - Adventure
// CraftBukkit end }
@@ -385,7 +389,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -385,7 +389,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { this.connection.send(new ClientboundDisconnectPacket(disconnectiondetails.reason()), PacketSendListener.thenRun(() -> {
this.connection.disconnect(ichatbasecomponent); this.connection.disconnect(disconnectiondetails);
})); }));
- this.onDisconnect(ichatbasecomponent); // CraftBukkit - fire quit instantly - this.onDisconnect(disconnectiondetails); // CraftBukkit - fire quit instantly
+ this.onDisconnect(ichatbasecomponent, event.leaveMessage()); // CraftBukkit - fire quit instantly // Paper - use kick event leave message + this.onDisconnect(disconnectiondetails, event.leaveMessage()); // CraftBukkit - fire quit instantly // Paper - use kick event leave message
this.connection.setReadOnly(); this.connection.setReadOnly();
MinecraftServer minecraftserver = this.server; MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection; Connection networkmanager = this.connection;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dd3767f482929d7d8105a4164c27651099935a89..5ba7340d3860975b826dc878385e0879a9f07957 100644 index 0a21e25e7a7771e1c86a857af8133cf7203333e3..1aad9232786994b89d08fb36ca877ceffcf98d2c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1878,6 +1878,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1895,6 +1895,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void onDisconnect(Component reason) { public void onDisconnect(DisconnectionDetails info) {
+ // Paper start - Fix kick event leave message not being sent + // Paper start - Fix kick event leave message not being sent
+ this.onDisconnect(reason, null); + this.onDisconnect(info, null);
+ } + }
+ @Override + @Override
+ public void onDisconnect(Component reason, @Nullable net.kyori.adventure.text.Component quitMessage) { + public void onDisconnect(DisconnectionDetails info, @Nullable net.kyori.adventure.text.Component quitMessage) {
+ // Paper end - Fix kick event leave message not being sent + // Paper end - Fix kick event leave message not being sent
// CraftBukkit start - Rarely it would send a disconnect line twice // CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) { if (this.processedDisconnect) {
return; return;
@@ -1886,11 +1892,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1903,11 +1909,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
// CraftBukkit end // CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString()); ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), info.reason().getString());
- this.removePlayerFromWorld(); - this.removePlayerFromWorld();
- super.onDisconnect(reason); - super.onDisconnect(info);
+ this.removePlayerFromWorld(quitMessage); // Paper - Fix kick event leave message not being sent + this.removePlayerFromWorld(quitMessage); // Paper - Fix kick event leave message not being sent
+ super.onDisconnect(reason, quitMessage); // Paper - Fix kick event leave message not being sent + super.onDisconnect(info, quitMessage); // Paper - Fix kick event leave message not being sent
} }
+ // Paper start - Fix kick event leave message not being sent + // Paper start - Fix kick event leave message not being sent
@ -86,7 +86,7 @@ index dd3767f482929d7d8105a4164c27651099935a89..5ba7340d3860975b826dc878385e0879
this.chatMessageChain.close(); this.chatMessageChain.close();
// CraftBukkit start - Replace vanilla quit message handling with our own. // CraftBukkit start - Replace vanilla quit message handling with our own.
/* /*
@@ -1900,7 +1912,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1917,7 +1929,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.disconnect(); this.player.disconnect();
// Paper start - Adventure // Paper start - Adventure
@ -96,10 +96,10 @@ index dd3767f482929d7d8105a4164c27651099935a89..5ba7340d3860975b826dc878385e0879
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 709cf6655e5ccb17caf0b8a735ae957cb0509f2c..2b7ad2b9cd525814c9f91d22606c42aa82ce9f94 100644 index 51f723ef7362ff3eb1bb58f2a75acd12928fabac..ab0b33de277c90404a24b842d7d17124895d6d4e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -567,6 +567,11 @@ public abstract class PlayerList { @@ -561,6 +561,11 @@ public abstract class PlayerList {
} }
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component

View file

@ -11,10 +11,10 @@ It does not make a lot of sense to damage players if they get crammed,
For those who really want it a config option is provided. For those who really want it a config option is provided.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ea2c8c91408cb65b3b6a520877c9273dbffd0ac1..bb0ac7db0467ec8468fcbf63b8f22580ed11e723 100644 index db04b3dcd83599042c02566b533a8ec0c9f0fcd4..0b2d9f069a5f4aa77a267a2df92b87817c503691 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -98,6 +98,7 @@ import net.minecraft.util.Mth; @@ -95,6 +95,7 @@ import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit; import net.minecraft.util.Unit;
import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageSource;
@ -22,7 +22,7 @@ index ea2c8c91408cb65b3b6a520877c9273dbffd0ac1..bb0ac7db0467ec8468fcbf63b8f22580
import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects; import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
@@ -1507,7 +1508,7 @@ public class ServerPlayer extends Player { @@ -1548,7 +1549,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@Override @Override
public boolean isInvulnerableTo(DamageSource damageSource) { public boolean isInvulnerableTo(DamageSource damageSource) {

View file

@ -19,10 +19,10 @@ index b9c2b41d9c46c871bab44cfb1d454f4141f1627b..d975b349aa81327c6b6c23e83e955215
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java
index fb4c7220c4edad54813036d62db7e3eefeda92a3..83d8a09980c4ab3c7c97b07c3dcdb3d7dab9e1aa 100644 index 8df42121aa22ec9f95a1b8627b64b0ff71e36314..7b3d5322611990406028e59b1409907291e27b21 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
@@ -549,11 +549,13 @@ public class Panda extends Animal { @@ -554,11 +554,13 @@ public class Panda extends Animal {
List<ItemStack> list1 = loottable.getRandomItems(lootparams); List<ItemStack> list1 = loottable.getRandomItems(lootparams);
Iterator iterator1 = list1.iterator(); Iterator iterator1 = list1.iterator();
@ -36,7 +36,7 @@ index fb4c7220c4edad54813036d62db7e3eefeda92a3..83d8a09980c4ab3c7c97b07c3dcdb3d7
} }
} }
@@ -677,7 +679,9 @@ public class Panda extends Animal { @@ -682,7 +684,9 @@ public class Panda extends Animal {
ItemStack itemstack1 = this.getItemBySlot(EquipmentSlot.MAINHAND); ItemStack itemstack1 = this.getItemBySlot(EquipmentSlot.MAINHAND);
if (!itemstack1.isEmpty() && !player.hasInfiniteMaterials()) { if (!itemstack1.isEmpty() && !player.hasInfiniteMaterials()) {
@ -57,10 +57,10 @@ index fb4c7220c4edad54813036d62db7e3eefeda92a3..83d8a09980c4ab3c7c97b07c3dcdb3d7
int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10; int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 11f4a2e15d42a029406fe8399b8d93ae136f0295..5ebf49a565af4ab3bead60a83bca2e6561e6a29c 100644 index faff64ae69eb689cea7754f221f374f8faa6e541..26b050599984ae3ba3827a0cabab255374e38c1e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -468,7 +468,9 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol @@ -472,7 +472,9 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
this.playSound(SoundEvents.ARMOR_UNEQUIP_WOLF); this.playSound(SoundEvents.ARMOR_UNEQUIP_WOLF);
itemstack1 = this.getBodyArmorItem(); itemstack1 = this.getBodyArmorItem();
this.setBodyArmorItem(ItemStack.EMPTY); this.setBodyArmorItem(ItemStack.EMPTY);
@ -71,10 +71,10 @@ index 11f4a2e15d42a029406fe8399b8d93ae136f0295..5ebf49a565af4ab3bead60a83bca2e65
} else if (((Ingredient) ((ArmorMaterial) ArmorMaterials.ARMADILLO.value()).repairIngredient().get()).test(itemstack) && this.isInSittingPose() && this.hasArmor() && this.isOwnedBy(player) && this.getBodyArmorItem().isDamaged()) { } else if (((Ingredient) ((ArmorMaterial) ArmorMaterials.ARMADILLO.value()).repairIngredient().get()).test(itemstack) && this.isInSittingPose() && this.hasArmor() && this.isOwnedBy(player) && this.getBodyArmorItem().isDamaged()) {
itemstack.shrink(1); itemstack.shrink(1);
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
index e1f2425ae6d3737302f6a7e010b172a62b41a018..20d9690127aed9c8ae2632bcf497ba0e473b7bea 100644 index 691d23bcd3e34a89e14c2e124595e076325dedbc..d2dfa49e124460f4762b950f9ded106d2ec15dc2 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -311,7 +311,9 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @@ -310,7 +310,9 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override @Override
protected void finishConversion(ServerLevel world) { protected void finishConversion(ServerLevel world) {
PiglinAi.cancelAdmiring(this); PiglinAi.cancelAdmiring(this);
@ -85,7 +85,7 @@ index e1f2425ae6d3737302f6a7e010b172a62b41a018..20d9690127aed9c8ae2632bcf497ba0e
} }
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
index a3df3798ebbbc2ccdf29d9f5ddc62d5e395fb8e5..31bb652c7ef35e7d61df2b1b60589fbb5c845bb0 100644 index 545e20e558d3bb934ec4bf32847c9fd83edfd85e..3ca643747535bf7b71e5877ca47f730a2aca4ba5 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -271,7 +271,9 @@ public class PiglinAi { @@ -271,7 +271,9 @@ public class PiglinAi {
@ -109,10 +109,10 @@ index a3df3798ebbbc2ccdf29d9f5ddc62d5e395fb8e5..31bb652c7ef35e7d61df2b1b60589fbb
} }
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 9f54e46b870e78d1d360ea79604708db08276ae3..d3fef00a351a6c6ae6af1f1dcf793c5954fd3485 100644 index e5dff812dc979ecf71939a85b2213965d15e7954..b4ba60c9cb69bb139d603a5c0506c8fd425b22e3 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -272,7 +272,9 @@ public abstract class Raider extends PatrollingMonster { @@ -230,7 +230,9 @@ public abstract class Raider extends PatrollingMonster {
double d0 = (double) this.getEquipmentDropChance(enumitemslot); double d0 = (double) this.getEquipmentDropChance(enumitemslot);
if (!itemstack1.isEmpty() && (double) Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d0) { if (!itemstack1.isEmpty() && (double) Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d0) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Stinger API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index e549c827d68ca96afea1ffdabf6802275c3328d1..f4574527cb1dddb97dba1fa2dfe1c17b89728015 100644 index af0a44df65277dae72dfb3496c9296bf4ac73da3..f37fe6724b8a85c7fd8eb3b08c7d5a412ca2263d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -360,6 +360,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -361,6 +361,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
} }
// Paper end // Paper end
} }
@ -20,7 +20,7 @@ index e549c827d68ca96afea1ffdabf6802275c3328d1..f4574527cb1dddb97dba1fa2dfe1c17b
// Paper start - Add methods for working with arrows stuck in living entities // Paper start - Add methods for working with arrows stuck in living entities
@Override @Override
@@ -374,6 +379,34 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -375,6 +380,34 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
} }
// Paper end - Add methods for working with arrows stuck in living entities // Paper end - Add methods for working with arrows stuck in living entities

View file

@ -105,10 +105,10 @@ index 0000000000000000000000000000000000000000..a8e813ca89b033f061e695288b3383bd
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 14616e4be1cfd4961fdb0d990310bf625cc821a9..54820a8d11bb12c516d4138fb0bf77c16f053f3f 100644 index d0eefb53fb88c56d72dea68269bd2b0ce6fd1c1b..0fc2e453c63b63e12f33cde28ad5afea5657ac57 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -305,6 +305,7 @@ public final class CraftServer implements Server { @@ -307,6 +307,7 @@ public final class CraftServer implements Server {
public Set<String> activeCompatibilities = Collections.emptySet(); public Set<String> activeCompatibilities = Collections.emptySet();
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
public static Exception excessiveVelEx; // Paper - Velocity warnings public static Exception excessiveVelEx; // Paper - Velocity warnings

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent AFK kick while watching end credits
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5ba7340d3860975b826dc878385e0879a9f07957..40d2c7bfc8ba8b8b366f23e53cf37f331e19ccf7 100644 index 1aad9232786994b89d08fb36ca877ceffcf98d2c..83b0df341f4be1191191718e871dac6842d4a31a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -397,7 +397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -397,7 +397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -15,5 +15,5 @@ index 5ba7340d3860975b826dc878385e0879a9f07957..40d2c7bfc8ba8b8b366f23e53cf37f33
- if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { - if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
+ if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits + if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
} }

View file

@ -49,20 +49,20 @@ index a2d0699e8427b2262a2396495111125eccafbb66..15db9368227dbc29d07d74e85bd126b3
} }
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index bb0ac7db0467ec8468fcbf63b8f22580ed11e723..b90b525faa5bba684c783a56f136532a8195de84 100644 index 0b2d9f069a5f4aa77a267a2df92b87817c503691..bc0a26cfbc5e1d21880f976c6bd4d0e30b277767 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1384,7 +1384,7 @@ public class ServerPlayer extends Player { @@ -1425,7 +1425,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
} else if (this.bedBlocked(blockposition, enumdirection)) { } else if (this.bedBlocked(blockposition, enumdirection)) {
return Either.left(Player.BedSleepingProblem.OBSTRUCTED); return Either.left(net.minecraft.world.entity.player.Player.BedSleepingProblem.OBSTRUCTED);
} else { } else {
- this.setRespawnPosition(this.level().dimension(), blockposition, this.getYRot(), false, true, PlayerSpawnChangeEvent.Cause.BED); // CraftBukkit - this.setRespawnPosition(this.level().dimension(), blockposition, this.getYRot(), false, true, PlayerSpawnChangeEvent.Cause.BED); // CraftBukkit
+ this.setRespawnPosition(this.level().dimension(), blockposition, this.getYRot(), false, true, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.BED); // Paper - Add PlayerSetSpawnEvent + this.setRespawnPosition(this.level().dimension(), blockposition, this.getYRot(), false, true, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.BED); // Paper - Add PlayerSetSpawnEvent
if (this.level().isDay()) { if (this.level().isDay()) {
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW); return Either.left(net.minecraft.world.entity.player.Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else { } else {
@@ -2354,44 +2354,50 @@ public class ServerPlayer extends Player { @@ -2403,44 +2403,50 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
return this.respawnForced; this.setRespawnPosition(player.getRespawnDimension(), player.getRespawnPosition(), player.getRespawnAngle(), player.isRespawnForced(), false);
} }
+ @Deprecated // Paper - Add PlayerSetSpawnEvent + @Deprecated // Paper - Add PlayerSetSpawnEvent
@ -145,7 +145,7 @@ index bb0ac7db0467ec8468fcbf63b8f22580ed11e723..b90b525faa5bba684c783a56f136532a
} else { } else {
this.respawnPosition = null; this.respawnPosition = null;
this.respawnDimension = Level.OVERWORLD; this.respawnDimension = Level.OVERWORLD;
@@ -2399,6 +2405,7 @@ public class ServerPlayer extends Player { @@ -2448,6 +2454,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.respawnForced = false; this.respawnForced = false;
} }
@ -154,18 +154,18 @@ index bb0ac7db0467ec8468fcbf63b8f22580ed11e723..b90b525faa5bba684c783a56f136532a
public SectionPos getLastSectionPos() { public SectionPos getLastSectionPos() {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2b7ad2b9cd525814c9f91d22606c42aa82ce9f94..d7bbdcc97745246718c92c9aba56d9f926897975 100644 index ab0b33de277c90404a24b842d7d17124895d6d4e..1ba8fa300b95ad5709e35068e8a372b627d132f9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -870,7 +870,7 @@ public abstract class PlayerList { @@ -841,7 +841,7 @@ public abstract class PlayerList {
location = CraftLocation.toBukkit(vec3d, worldserver1.getWorld(), f1, 0.0F); // CraftBukkit end
} else if (blockposition != null) { if (dimensiontransition.missingRespawnBlock()) {
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F)); entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));
- entityplayer1.setRespawnPosition(null, null, 0f, false, false, PlayerSpawnChangeEvent.Cause.RESET); // CraftBukkit - SPIGOT-5988: Clear respawn location when obstructed - entityplayer1.setRespawnPosition(null, null, 0f, false, false, PlayerSpawnChangeEvent.Cause.RESET); // CraftBukkit - SPIGOT-5988: Clear respawn location when obstructed
+ entityplayer1.setRespawnPosition(null, null, 0f, false, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLAYER_RESPAWN); // CraftBukkit - SPIGOT-5988: Clear respawn location when obstructed // Paper - Add PlayerSetSpawnEvent + entityplayer1.setRespawnPosition(null, null, 0f, false, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLAYER_RESPAWN); // CraftBukkit - SPIGOT-5988: Clear respawn location when obstructed // Paper - PlayerSetSpawnEvent
}
} }
int i = flag ? 1 : 0;
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043fe256103 100644 index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043fe256103 100644
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java --- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
@ -187,10 +187,10 @@ index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index eee0c49bbf9bc768fcf7275c29536b4f16b1d421..634da85870b31a9fc09d53f5670239e18bcb3d47 100644 index 26a8006a1daa9eecb226732a5a33d2a5d1cdedf9..9c1205b6b3cae33e735e5d64735935e8396db7d8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1399,9 +1399,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1412,9 +1412,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void setRespawnLocation(Location location, boolean override) { public void setRespawnLocation(Location location, boolean override) {
if (location == null) { if (location == null) {

View file

@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Steinborn <git@steinborn.me>
Date: Sun, 8 Aug 2021 00:52:54 -0400
Subject: [PATCH] Optimize entity tracker passenger checks
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 9f04dc7817909d81f387b03bfc57d2d9a1d63478..7e8a43ea1b32f444fb66e270a5f6b48bf7bcd2a0 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -71,7 +71,7 @@ public class ServerEntity {
private Vec3 lastSentMovement;
private int tickCount;
private int teleportDelay;
- private List<Entity> lastPassengers = Collections.emptyList();
+ private List<Entity> lastPassengers = com.google.common.collect.ImmutableList.of(); // Paper - optimize passenger checks
private boolean wasRiding;
private boolean wasOnGround;
@Nullable

View file

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Steinborn <git@steinborn.me>
Date: Sun, 8 Aug 2021 00:52:54 -0400
Subject: [PATCH] Optimize entity tracker passenger checks
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 002c73c7dc7c72968ed8692a67e1bce4236f7214..56408fa2603137819f47e7bd9b53b0b5f647edd6 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -83,7 +83,7 @@ public class ServerEntity {
this.trackedPlayers = trackedPlayers;
// CraftBukkit end
this.ap = Vec3.ZERO;
- this.lastPassengers = Collections.emptyList();
+ this.lastPassengers = com.google.common.collect.ImmutableList.of(); // Paper - optimize passenger checks
this.level = worldserver;
this.broadcast = consumer;
this.entity = entity;