some more work

This commit is contained in:
Jake Potrebic 2023-09-21 15:26:51 -07:00
parent a27262375c
commit ef6a41195d
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
56 changed files with 225 additions and 223 deletions

View File

@ -2419,7 +2419,7 @@ index e7a9dd7791a0dd200c4d74922c6e5adaa5013669..b9062fe651de34d5b3f9d5f146ae0b4f
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> {
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 bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a393684747d9d 100644 index bbd256d088879f04762fcf628573f1348e4961a8..463d268c3e9450996f58f9820dbd8fc527c213ea 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
@@ -45,6 +45,7 @@ import net.minecraft.nbt.ListTag; @@ -45,6 +45,7 @@ import net.minecraft.nbt.ListTag;
@ -2454,11 +2454,13 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936
} }
// CraftBukkit end // CraftBukkit end
this.player.getTextFilter().leave(); this.player.getTextFilter().leave();
@@ -1754,10 +1759,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1752,12 +1757,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
CompletableFuture<FilteredText> completablefuture = this.filterTextPacket(playerchatmessage.signedContent()); }
Component ichatbasecomponent = this.server.getChatDecorator().decorate(this.player, playerchatmessage.decoratedContent());
CompletableFuture<FilteredText> completablefuture = this.filterTextPacket(playerchatmessage.signedContent());
- Component ichatbasecomponent = this.server.getChatDecorator().decorate(this.player, playerchatmessage.decoratedContent());
+ CompletableFuture<ChatDecorator.Result> componentFuture = this.server.getChatDecorator().decorate(this.player, null, playerchatmessage.decoratedContent()); // Paper + CompletableFuture<ChatDecorator.Result> componentFuture = this.server.getChatDecorator().decorate(this.player, null, playerchatmessage.decoratedContent()); // Paper
this.chatMessageChain.append((executor) -> { this.chatMessageChain.append((executor) -> {
- return completablefuture.thenAcceptAsync((filteredtext) -> { - return completablefuture.thenAcceptAsync((filteredtext) -> {
- PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent(ichatbasecomponent).filter(filteredtext.mask()); - PlayerChatMessage playerchatmessage1 = playerchatmessage.withUnsignedContent(ichatbasecomponent).filter(filteredtext.mask());
@ -2468,7 +2470,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936
this.broadcastChatMessage(playerchatmessage1); this.broadcastChatMessage(playerchatmessage1);
}, this.server.chatExecutor); // CraftBukkit - async chat }, this.server.chatExecutor); // CraftBukkit - async chat
}); });
@@ -1862,7 +1867,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1862,7 +1866,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment); Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment);
if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
@ -2477,7 +2479,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936
return Optional.empty(); return Optional.empty();
} else { } else {
this.player.resetLastActionTime(); this.player.resetLastActionTime();
@@ -1920,7 +1925,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1920,7 +1924,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.handleCommand(s); this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
@ -2491,7 +2493,7 @@ index bbd256d088879f04762fcf628573f1348e4961a8..92b18f382e91936aad54b083284a3936
Player player = this.getCraftPlayer(); Player player = this.getCraftPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(server)); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(server));
String originalFormat = event.getFormat(), originalMessage = event.getMessage(); String originalFormat = event.getFormat(), originalMessage = event.getMessage();
@@ -2044,7 +2054,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2044,7 +2053,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
}); });
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check

View File

@ -1275,7 +1275,7 @@ index e2eff46cae9771931b2e0dfee5e73fd4842e3ab5..988a17cd0b960a07795d999dd125eae3
this.entityManager.saveAll(); this.entityManager.saveAll();
} else { } else {
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 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8539b3dbf 100644 index 463d268c3e9450996f58f9820dbd8fc527c213ea..e85268e4c20371d4264effb70ae9fa8e435f8766 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
@@ -320,7 +320,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -320,7 +320,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -1294,7 +1294,7 @@ index 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8
} }
@@ -2006,7 +2004,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2005,7 +2003,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
private void handleCommand(String s) { private void handleCommand(String s) {
@ -1303,7 +1303,7 @@ index 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
@@ -2016,7 +2014,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2015,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@ -1312,7 +1312,7 @@ index 92b18f382e91936aad54b083284a393684747d9d..d755ce65ffd22a7f39bb19c547f655f8
return; return;
} }
@@ -2029,7 +2027,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2028,7 +2026,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return; return;
} finally { } finally {

View File

@ -17,10 +17,10 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com> Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
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 d755ce65ffd22a7f39bb19c547f655f8539b3dbf..0f264a3efe33935df463cc8048bc70ab14526386 100644 index e85268e4c20371d4264effb70ae9fa8e435f8766..98266c0349d21fc1ebf0d34a3d898825d477d6e5 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
@@ -1919,7 +1919,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1918,7 +1918,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original); OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
@ -29,7 +29,7 @@ index d755ce65ffd22a7f39bb19c547f655f8539b3dbf..0f264a3efe33935df463cc8048bc70ab
this.handleCommand(s); this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
@@ -2003,7 +2003,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2002,7 +2002,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
} }

View File

@ -28,10 +28,10 @@ index 644a0fdea6576647539b96528717dbaeab498d93..221e64a66ff12a8de5c75992fc26a54a
+ // Paper end - PlayerUseUnknownEntityEvent + // Paper end - PlayerUseUnknownEntityEvent
} }
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 0f264a3efe33935df463cc8048bc70ab14526386..e58a87d933b916dd246f392577432d8022f117f7 100644 index 98266c0349d21fc1ebf0d34a3d898825d477d6e5..a4e010b9195d0afeb4724dc64c85964a843eb59a 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
@@ -2386,8 +2386,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2385,8 +2385,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}); });
} }
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable packet in spam threshold
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 e58a87d933b916dd246f392577432d8022f117f7..0ce757dd60d167886d56eb651140cec93b1af41e 100644 index a4e010b9195d0afeb4724dc64c85964a843eb59a..2233a21dfe7a745a95886784dcbcbf1d95a93f7a 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
@@ -1498,13 +1498,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1498,13 +1498,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable flying kick messages
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 0ce757dd60d167886d56eb651140cec93b1af41e..4c9454589b5fe98d8b6be84fe07970efa5f07732 100644 index 2233a21dfe7a745a95886784dcbcbf1d95a93f7a..855bb02f3879bc2ab74ceb7e837b562496aca30e 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
@@ -336,7 +336,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -336,7 +336,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -14,10 +14,10 @@ To be converted into a Paper-API event at some point in the future?
public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
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 4c9454589b5fe98d8b6be84fe07970efa5f07732..4ab881766975eb4853094ad0d70e9e0647a0c23e 100644 index 855bb02f3879bc2ab74ceb7e837b562496aca30e..4f420687d7afc6cdb8175d510c54a0d8dd3847b6 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
@@ -2163,6 +2163,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2162,6 +2162,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
switch (packet.getAction()) { switch (packet.getAction()) {
case PRESS_SHIFT_KEY: case PRESS_SHIFT_KEY:
this.player.setShiftKeyDown(true); this.player.setShiftKeyDown(true);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent
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 4ab881766975eb4853094ad0d70e9e0647a0c23e..d849ca56d36f4652a5c1526a92f183a2defb3e0d 100644 index 4f420687d7afc6cdb8175d510c54a0d8dd3847b6..875c98d4f93b3fdd93af3a1087a818f7250515b1 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
@@ -1192,7 +1192,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1192,7 +1192,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -16,7 +16,7 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent
Co-authored-by: Aikar <aikar@aikar.co> Co-authored-by: Aikar <aikar@aikar.co>
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 d849ca56d36f4652a5c1526a92f183a2defb3e0d..8e27c443b31566a8e57c29ba29fa914fe4a53275 100644 index 875c98d4f93b3fdd93af3a1087a818f7250515b1..c14ebcc46c033834a14de5d6335a4dcc7830069d 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
@@ -687,27 +687,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -687,27 +687,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in.
public-f net.minecraft.world.entity.player.Player gameProfile public-f net.minecraft.world.entity.player.Player gameProfile
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 8e27c443b31566a8e57c29ba29fa914fe4a53275..2addf6dfbe808d4a74d74812ae024925cb3bdb13 100644 index c14ebcc46c033834a14de5d6335a4dcc7830069d..6ad9b294aadf96465834cde1ff1cda1710441c79 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
@@ -1430,7 +1430,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1430,7 +1430,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -75,7 +75,7 @@ index 491dffdcbb065acf5861dc01b403d1a895c92baa..3a9fd9ea736d1b3dbb261158d690e218
this.doCloseContainer(); this.doCloseContainer();
} }
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 2addf6dfbe808d4a74d74812ae024925cb3bdb13..025eacdf53f42b47f5815cbacfe74d0990da0e42 100644 index 6ad9b294aadf96465834cde1ff1cda1710441c79..f32e04f1c6394769983dec0d931798e0b5fda2fe 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
@@ -215,6 +215,7 @@ import org.bukkit.event.inventory.ClickType; @@ -215,6 +215,7 @@ import org.bukkit.event.inventory.ClickType;
@ -86,7 +86,7 @@ index 2addf6dfbe808d4a74d74812ae024925cb3bdb13..025eacdf53f42b47f5815cbacfe74d09
import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent; import org.bukkit.event.inventory.SmithItemEvent;
@@ -2517,10 +2518,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2516,10 +2517,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleContainerClose(ServerboundContainerClosePacket packet) { public void handleContainerClose(ServerboundContainerClosePacket packet) {

View File

@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem. cancelled to avoid this problem.
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 025eacdf53f42b47f5815cbacfe74d0990da0e42..4af898571bfe218d38ce8a1ec042f142317cd00d 100644 index f32e04f1c6394769983dec0d931798e0b5fda2fe..c63b0a3ff5fe5c03199693d8e2cbf08a25f33d70 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
@@ -2398,6 +2398,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2397,6 +2397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
if (event.isCancelled()) { if (event.isCancelled()) {

View File

@ -22,7 +22,7 @@ to take the burden of this into their own hand without having to rely on
plugins doing unsafe things. plugins doing unsafe things.
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 4af898571bfe218d38ce8a1ec042f142317cd00d..879b27c58a8a3479e2ab83b020b6ee9e98b93d2b 100644 index c63b0a3ff5fe5c03199693d8e2cbf08a25f33d70..423390ff2508ab9af804925044142ea289068bae 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
@@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
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 240f90460ddddf8168b7bc661a55fe7e5c94c67d..b5e85e664dda27c1fb342e47d901909742aec67d 100644 index 9366cc71807cc88d5dd70138b9ce5d49335731db..42034c3ce08ef4432cb71dfd10dc561bda7c8dc8 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
@@ -2827,6 +2827,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2801,6 +2801,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers; return this.adventure$pointers;
} }

View File

@ -19,11 +19,11 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou
public net.minecraft.world.entity.LivingEntity getSoundVolume()F public net.minecraft.world.entity.LivingEntity getSoundVolume()F
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 bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6e46031ea 100644 index 3a9fd9ea736d1b3dbb261158d690e218baa4df96..9f36555177b98f4d66a8b45fc2b3a032c6bbce0d 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
@@ -243,6 +243,10 @@ public class ServerPlayer extends Player { @@ -241,6 +241,10 @@ public class ServerPlayer extends Player {
public int latency; private int containerCounter;
public boolean wonGame; public boolean wonGame;
private int containerUpdateDelay; // Paper private int containerUpdateDelay; // Paper
+ // Paper start - cancellable death event + // Paper start - cancellable death event
@ -33,7 +33,7 @@ index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6
// CraftBukkit start // CraftBukkit start
public String displayName; public String displayName;
@@ -872,6 +876,15 @@ public class ServerPlayer extends Player { @@ -831,6 +835,15 @@ public class ServerPlayer extends Player {
String deathmessage = defaultMessage.getString(); String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure
@ -49,7 +49,7 @@ index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6
// SPIGOT-943 - only call if they have an inventory open // SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) { if (this.containerMenu != this.inventoryMenu) {
@@ -1023,8 +1036,17 @@ public class ServerPlayer extends Player { @@ -982,8 +995,17 @@ public class ServerPlayer extends Player {
} }
} }
} }
@ -70,7 +70,7 @@ index bd7b8ede44a5971b034ffb75fbddbadda8f42702..41e0b2826bae59e48fef7e35caeb3ce6
} }
} }
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 c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2f995633e 100644 index 8f8f343139444cc6fddf0d13083194ec7bbce545..4fdf034205ea0ff9d6803928672b23c185fd3065 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
@@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -81,7 +81,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
@Override @Override
public float getBukkitYaw() { public float getBukkitYaw() {
@@ -1494,13 +1495,12 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1526,13 +1527,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (knockbackCancelled) this.level().broadcastEntityEvent(this, (byte) 2); // Paper - Disable explosion knockback if (knockbackCancelled) this.level().broadcastEntityEvent(this, (byte) 2); // Paper - Disable explosion knockback
if (this.isDeadOrDying()) { if (this.isDeadOrDying()) {
if (!this.checkTotemDeathProtection(source)) { if (!this.checkTotemDeathProtection(source)) {
@ -99,7 +99,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
} }
} else if (flag1) { } else if (flag1) {
this.playHurtSound(source); this.playHurtSound(source);
@@ -1652,7 +1652,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1685,7 +1685,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.isRemoved() && !this.dead) { if (!this.isRemoved() && !this.dead) {
Entity entity = damageSource.getEntity(); Entity entity = damageSource.getEntity();
LivingEntity entityliving = this.getKillCredit(); LivingEntity entityliving = this.getKillCredit();
@ -108,7 +108,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
if (this.deathScore >= 0 && entityliving != null) { if (this.deathScore >= 0 && entityliving != null) {
entityliving.awardKillScore(this, this.deathScore, damageSource); entityliving.awardKillScore(this, this.deathScore, damageSource);
} }
@@ -1664,24 +1664,59 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1697,24 +1697,59 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.level().isClientSide && this.hasCustomName()) { if (!this.level().isClientSide && this.hasCustomName()) {
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
} }
@ -173,7 +173,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
} }
} }
@@ -1689,7 +1724,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1722,7 +1757,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.level().isClientSide) { if (!this.level().isClientSide) {
boolean flag = false; boolean flag = false;
@ -182,7 +182,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
BlockPos blockposition = this.blockPosition(); BlockPos blockposition = this.blockPosition();
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
@@ -1718,7 +1753,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1751,7 +1786,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
} }
@ -195,7 +195,7 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
Entity entity = source.getEntity(); Entity entity = source.getEntity();
int i; int i;
@@ -1733,18 +1772,27 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1766,18 +1805,27 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.dropEquipment(); // CraftBukkit - from below this.dropEquipment(); // CraftBukkit - from below
if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
this.dropFromLootTable(source, flag); this.dropFromLootTable(source, flag);
@ -225,10 +225,10 @@ index c995c8ac6785e5f8951013f3a37127573351c2c7..d84375984c67a8ad2790efc1c584f7e2
// CraftBukkit start // CraftBukkit start
public int getExpReward() { public int getExpReward() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 2fc099e2fb17073f3ab4ac5e868b1c583bf8a594..3081c1370a0854f07214cbc50b06cbb005d171fb 100644 index 2b5f5aed31bd235a213f57b9d65b0ea1fae8de08..df0cc02f9bbea857226765c6066a2b945036a0d9 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1068,7 +1068,13 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -1076,7 +1076,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
} }
this.spawnAtLocation(itemstack); this.spawnAtLocation(itemstack);
@ -243,10 +243,10 @@ index 2fc099e2fb17073f3ab4ac5e868b1c583bf8a594..3081c1370a0854f07214cbc50b06cbb0
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index 44b6d232d940d4020fa7664e48a483c20959dde0..24ae11d300d0856350f185f03552ba592f3d218a 100644 index 0d4b86411d2d064b04334b508b1cb65695afaebd..df06cad9447982ebe57d07c9967cb68c6dd20ca3 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -706,15 +706,25 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> { @@ -712,15 +712,25 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
} }
@Override @Override
@ -274,12 +274,12 @@ index 44b6d232d940d4020fa7664e48a483c20959dde0..24ae11d300d0856350f185f03552ba59
+ return deathEvent; // Paper + return deathEvent; // Paper
} }
public static boolean isPathClear(Fox fox, LivingEntity chasedEntity) { @Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
index ebe207e2c4d8b7e125fec8a5182fe4882c9339e3..8ac82d3efc0f6d8ff40226e4f8084435c136eba4 100644 index bb399f775a5530a01f59332848c8ab9b8eceb2b5..14edfe103e61024b569f33de0b6608f39e749319 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
@@ -69,11 +69,19 @@ public abstract class AbstractChestedHorse extends AbstractHorse { @@ -70,11 +70,19 @@ public abstract class AbstractChestedHorse extends AbstractHorse {
this.spawnAtLocation(Blocks.CHEST); this.spawnAtLocation(Blocks.CHEST);
} }
@ -301,10 +301,10 @@ index ebe207e2c4d8b7e125fec8a5182fe4882c9339e3..8ac82d3efc0f6d8ff40226e4f8084435
public void addAdditionalSaveData(CompoundTag nbt) { public void addAdditionalSaveData(CompoundTag nbt) {
super.addAdditionalSaveData(nbt); super.addAdditionalSaveData(nbt);
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7e10b34d7 100644 index 6483ad071c119353267a4f13b192a50931995c2a..7eecbe85949e47b367014c04d7a37c2cbea80168 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -491,8 +491,10 @@ public class ArmorStand extends LivingEntity { @@ -492,8 +492,10 @@ public class ArmorStand extends LivingEntity {
} }
// CraftBukkit end // CraftBukkit end
if (source.is(DamageTypeTags.IS_EXPLOSION)) { if (source.is(DamageTypeTags.IS_EXPLOSION)) {
@ -317,7 +317,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
return false; return false;
} else if (source.is(DamageTypeTags.IGNITES_ARMOR_STANDS)) { } else if (source.is(DamageTypeTags.IGNITES_ARMOR_STANDS)) {
if (this.isOnFire()) { if (this.isOnFire()) {
@@ -536,9 +538,9 @@ public class ArmorStand extends LivingEntity { @@ -549,9 +551,9 @@ public class ArmorStand extends LivingEntity {
this.gameEvent(GameEvent.ENTITY_DAMAGE, source.getEntity()); this.gameEvent(GameEvent.ENTITY_DAMAGE, source.getEntity());
this.lastHit = i; this.lastHit = i;
} else { } else {
@ -329,7 +329,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
} }
return true; return true;
@@ -590,8 +592,10 @@ public class ArmorStand extends LivingEntity { @@ -603,8 +605,10 @@ public class ArmorStand extends LivingEntity {
f1 -= amount; f1 -= amount;
if (f1 <= 0.5F) { if (f1 <= 0.5F) {
@ -342,7 +342,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
} else { } else {
this.setHealth(f1); this.setHealth(f1);
this.gameEvent(GameEvent.ENTITY_DAMAGE, damageSource.getEntity()); this.gameEvent(GameEvent.ENTITY_DAMAGE, damageSource.getEntity());
@@ -599,7 +603,7 @@ public class ArmorStand extends LivingEntity { @@ -612,7 +616,7 @@ public class ArmorStand extends LivingEntity {
} }
@ -351,7 +351,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
ItemStack itemstack = new ItemStack(Items.ARMOR_STAND); ItemStack itemstack = new ItemStack(Items.ARMOR_STAND);
if (this.hasCustomName()) { if (this.hasCustomName()) {
@@ -607,10 +611,10 @@ public class ArmorStand extends LivingEntity { @@ -620,10 +624,10 @@ public class ArmorStand extends LivingEntity {
} }
drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops
@ -364,7 +364,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
this.playBrokenSound(); this.playBrokenSound();
// this.dropAllDeathLoot(damagesource); // CraftBukkit - moved down // this.dropAllDeathLoot(damagesource); // CraftBukkit - moved down
@@ -632,7 +636,7 @@ public class ArmorStand extends LivingEntity { @@ -645,7 +649,7 @@ public class ArmorStand extends LivingEntity {
this.armorItems.set(i, ItemStack.EMPTY); this.armorItems.set(i, ItemStack.EMPTY);
} }
} }
@ -373,7 +373,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
} }
@@ -764,7 +768,16 @@ public class ArmorStand extends LivingEntity { @@ -772,7 +776,16 @@ public class ArmorStand extends LivingEntity {
@Override @Override
public void kill() { public void kill() {
@ -392,10 +392,10 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..a35a0952ce8e1fc42e92734786d531c7
this.gameEvent(GameEvent.ENTITY_DIE); this.gameEvent(GameEvent.ENTITY_DIE);
} }
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 b5e85e664dda27c1fb342e47d901909742aec67d..1c09e955e34380b99572cc5950806417ac10bfc8 100644 index 42034c3ce08ef4432cb71dfd10dc561bda7c8dc8..874f515eb8cf7bc3fa2e37f09993fd4454ec089e 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
@@ -2327,7 +2327,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2301,7 +2301,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void sendHealthUpdate() { public void sendHealthUpdate() {
FoodData foodData = this.getHandle().getFoodData(); FoodData foodData = this.getHandle().getFoodData();
@ -412,10 +412,10 @@ index b5e85e664dda27c1fb342e47d901909742aec67d..1c09e955e34380b99572cc5950806417
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) { public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
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 53af54ffecd7fdb20588d75a8c32003cb89a75b1..eaca76dfec9cbe3cbb9972a0c9cf30599816fcda 100644 index f423e98fccb7712f7d989ee5780dd5e7b824255f..01ce54dba8c3efcc147b694ba57e070686375f68 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
@@ -863,9 +863,16 @@ public class CraftEventFactory { @@ -865,9 +865,16 @@ public class CraftEventFactory {
public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) { public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward()); EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
@ -432,7 +432,7 @@ index 53af54ffecd7fdb20588d75a8c32003cb89a75b1..eaca76dfec9cbe3cbb9972a0c9cf3059
victim.expToDrop = event.getDroppedExp(); victim.expToDrop = event.getDroppedExp();
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
@@ -882,8 +889,15 @@ public class CraftEventFactory { @@ -884,8 +891,15 @@ public class CraftEventFactory {
PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure
event.setKeepInventory(keepInventory); event.setKeepInventory(keepInventory);
event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel
@ -448,7 +448,7 @@ index 53af54ffecd7fdb20588d75a8c32003cb89a75b1..eaca76dfec9cbe3cbb9972a0c9cf3059
victim.keepLevel = event.getKeepLevel(); victim.keepLevel = event.getKeepLevel();
victim.newLevel = event.getNewLevel(); victim.newLevel = event.getNewLevel();
@@ -900,6 +914,31 @@ public class CraftEventFactory { @@ -902,6 +916,31 @@ public class CraftEventFactory {
return event; return event;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Allow chests to be placed with NBT data
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index c33660718c0ea281d7bcdb15df0568d4d46547e2..0caf3eeb7984e842f7a0bdfed3021d0b231a0dd0 100644 index cae548dbb5a3027e2de0bfbe38918ec7c2803e8e..77db59d433d4189f96b9da006898bded5edbb0ba 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -381,6 +381,7 @@ public final class ItemStack { @@ -386,6 +386,7 @@ public final class ItemStack {
enuminteractionresult = InteractionResult.FAIL; // cancel placement enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed // PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory(); placeEvent.getPlayer().updateInventory();

View File

@ -160,10 +160,10 @@ index 0000000000000000000000000000000000000000..064712e7b27a200b29c72076a82f4f56
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
index 4ad2ac8d1e9111933fa58c47442fa1f5e8173fd3..2a335f277bd0e4b8ad0f60d8226eb8aaa80a871f 100644 index 539dc45c3c7ffc60cf3fb47ae4df65e604e8627b..eea4c932d909145e7af848cf76e3f49dbb2deff2 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java --- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
@@ -21,6 +21,7 @@ public class Path { @@ -18,6 +18,7 @@ public class Path {
private final BlockPos target; private final BlockPos target;
private final float distToTarget; private final float distToTarget;
private final boolean reached; private final boolean reached;

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks
also prevents if out of world border bounds also prevents if out of world border bounds
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 6ac513d3044fab1cb1ca0b0c7e85ff871d49d572..2503d4691e47083a9d99a38c4ed3f50a2374821a 100644 index b3a7d065900f63b15ee2a8e3c1d69d5513f7b85c..9ed7abddf30d298a5abb04974efd1b470d015b09 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -170,9 +170,9 @@ public final class NaturalSpawner { @@ -170,9 +170,9 @@ public final class NaturalSpawner {

View File

@ -11,7 +11,7 @@ to the nearest Integer when updating its current cook time.
Modified by: Eric Su <ericsu@alumni.usc.edu> Modified by: Eric Su <ericsu@alumni.usc.edu>
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index d56a64b058d8848e405e33d9884a61ea952a8f71..40dc29288a13ae9c1f8b0434922fdb5c7d02daa9 100644 index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc36369710 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -77,11 +77,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -77,11 +77,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@ -58,7 +58,7 @@ index d56a64b058d8848e405e33d9884a61ea952a8f71..40dc29288a13ae9c1f8b0434922fdb5c
@@ -359,7 +368,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -359,7 +368,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0)); CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0));
CookingRecipe<?> recipe = (CookingRecipe<?>) irecipe.toBukkitRecipe(); CookingRecipe<?> recipe = (CookingRecipe<?>) recipeholder.toBukkitRecipe();
- FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, pos), source, recipe); - FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, pos), source, recipe);
+ FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, pos), source, recipe, AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity.recipeType, blockEntity, blockEntity.cookSpeedMultiplier)); // Paper - cook speed multiplier API + FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, pos), source, recipe, AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity.recipeType, blockEntity, blockEntity.cookSpeedMultiplier)); // Paper - cook speed multiplier API
@ -74,26 +74,28 @@ index d56a64b058d8848e405e33d9884a61ea952a8f71..40dc29288a13ae9c1f8b0434922fdb5c
blockEntity.cookingProgress = 0; blockEntity.cookingProgress = 0;
- blockEntity.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity); - blockEntity.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity);
+ blockEntity.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity.recipeType, blockEntity, blockEntity.cookSpeedMultiplier); // Paper + blockEntity.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(world, blockEntity.recipeType, blockEntity, blockEntity.cookSpeedMultiplier); // Paper
if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, world.registryAccess(), irecipe, blockEntity.items, i)) { // CraftBukkit if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, world.registryAccess(), recipeholder, blockEntity.items, i)) { // CraftBukkit
blockEntity.setRecipeUsed(irecipe); blockEntity.setRecipeUsed(recipeholder);
} }
@@ -469,9 +478,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -469,11 +478,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
} }
} }
- private static int getTotalCookTime(Level world, AbstractFurnaceBlockEntity furnace) { - private static int getTotalCookTime(Level world, AbstractFurnaceBlockEntity furnace) {
- return (world != null) ? (Integer) furnace.quickCheck.getRecipeFor(furnace, world).map(AbstractCookingRecipe::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 - if (world == null) return 200; // CraftBukkit - SPIGOT-4302
- return (Integer) furnace.quickCheck.getRecipeFor(furnace, world).map((recipeholder) -> {
- return ((AbstractCookingRecipe) recipeholder.value()).getCookingTime();
- }).orElse(200);
+ // Paper start + // Paper start
+ public static int getTotalCookTime(@Nullable Level world, RecipeType<? extends AbstractCookingRecipe> recipeType, AbstractFurnaceBlockEntity furnace, double cookSpeedMultiplier) { + public static int getTotalCookTime(@Nullable Level world, RecipeType<? extends AbstractCookingRecipe> recipeType, AbstractFurnaceBlockEntity furnace, double cookSpeedMultiplier) {
+ /* Scale the recipe's cooking time to the current cookSpeedMultiplier */ + /* Scale the recipe's cooking time to the current cookSpeedMultiplier */
+ int cookTime = world != null ? furnace.quickCheck.getRecipeFor(furnace, world).map(AbstractCookingRecipe::getCookingTime).orElse(200) : (net.minecraft.server.MinecraftServer.getServer().getRecipeManager().getRecipeFor(recipeType, furnace, world /* passing a null level here is safe. world is only used for map extending recipes which won't happen here */).map(AbstractCookingRecipe::getCookingTime).orElse(200)); + int cookTime = world != null ? furnace.quickCheck.getRecipeFor(furnace, world).map(holder -> holder.value().getCookingTime()).orElse(200) : (net.minecraft.server.MinecraftServer.getServer().getRecipeManager().getRecipeFor(recipeType, furnace, world /* passing a null level here is safe. world is only used for map extending recipes which won't happen here */).map(holder -> holder.value().getCookingTime()).orElse(200));
+ return (int) Math.ceil (cookTime / cookSpeedMultiplier); + return (int) Math.ceil (cookTime / cookSpeedMultiplier);
+ // Paper end
} }
+ // Paper end
public static boolean isFuel(ItemStack stack) { public static boolean isFuel(ItemStack stack) {
return AbstractFurnaceBlockEntity.getFuel().containsKey(stack.getItem()); @@ -543,7 +553,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@@ -540,7 +553,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
} }
if (slot == 0 && !flag) { if (slot == 0 && !flag) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection throttle kick message
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 a3b610cb1ed97a635677bc46ccdf0463c9918585..94b062874ef9d4935a7ad2c7b45b2e6b786eaa81 100644 index 17f01fa589cb7c4eff4233a27e60a5928cbd604d..1cdcb62ead4b9f2e88f1e282813d990ddf2297a5 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
@@ -51,7 +51,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -51,7 +51,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b79625561 100644 index 818c83934a97c4b2ad4db69f4b0fcf0a500ea918..f7527ed1d47901e52df4e3fffbdcd838782c90db 100644
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
@@ -175,7 +175,8 @@ public abstract class FlowingFluid extends Fluid { @@ -176,7 +176,8 @@ public abstract class FlowingFluid extends Fluid {
Direction enumdirection = (Direction) entry.getKey(); Direction enumdirection = (Direction) entry.getKey();
FluidState fluid1 = (FluidState) entry.getValue(); FluidState fluid1 = (FluidState) entry.getValue();
BlockPos blockposition1 = pos.relative(enumdirection); BlockPos blockposition1 = pos.relative(enumdirection);
@ -18,7 +18,7 @@ index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b
if (this.canSpreadTo(world, pos, blockState, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) { if (this.canSpreadTo(world, pos, blockState, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) {
// CraftBukkit start // CraftBukkit start
@@ -202,7 +203,9 @@ public abstract class FlowingFluid extends Fluid { @@ -203,7 +204,9 @@ public abstract class FlowingFluid extends Fluid {
while (iterator.hasNext()) { while (iterator.hasNext()) {
Direction enumdirection = (Direction) iterator.next(); Direction enumdirection = (Direction) iterator.next();
BlockPos blockposition1 = pos.relative(enumdirection); BlockPos blockposition1 = pos.relative(enumdirection);
@ -29,7 +29,7 @@ index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b
FluidState fluid = iblockdata1.getFluidState(); FluidState fluid = iblockdata1.getFluidState();
if (fluid.getType().isSame(this) && this.canPassThroughWall(enumdirection, world, pos, state, blockposition1, iblockdata1)) { if (fluid.getType().isSame(this) && this.canPassThroughWall(enumdirection, world, pos, state, blockposition1, iblockdata1)) {
@@ -319,11 +322,18 @@ public abstract class FlowingFluid extends Fluid { @@ -320,11 +323,18 @@ public abstract class FlowingFluid extends Fluid {
if (enumdirection1 != direction) { if (enumdirection1 != direction) {
BlockPos blockposition2 = pos.relative(enumdirection1); BlockPos blockposition2 = pos.relative(enumdirection1);
short short0 = FlowingFluid.getCacheKey(fromPos, blockposition2); short short0 = FlowingFluid.getCacheKey(fromPos, blockposition2);
@ -52,7 +52,7 @@ index fbf699e777d45db3dcf1606d34f509ca1a5bbb7a..c694b16be7c276fbf34aed2fd2aa6d6b
BlockState iblockdata1 = (BlockState) pair.getFirst(); BlockState iblockdata1 = (BlockState) pair.getFirst();
FluidState fluid = (FluidState) pair.getSecond(); FluidState fluid = (FluidState) pair.getSecond();
@@ -395,11 +405,16 @@ public abstract class FlowingFluid extends Fluid { @@ -396,11 +406,16 @@ public abstract class FlowingFluid extends Fluid {
Direction enumdirection = (Direction) iterator.next(); Direction enumdirection = (Direction) iterator.next();
BlockPos blockposition1 = pos.relative(enumdirection); BlockPos blockposition1 = pos.relative(enumdirection);
short short0 = FlowingFluid.getCacheKey(pos, blockposition1); short short0 = FlowingFluid.getCacheKey(pos, blockposition1);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity
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 d84375984c67a8ad2790efc1c584f7e2f995633e..f800b3e4debcd141a75de9e6025a87e81cee083c 100644 index 4fdf034205ea0ff9d6803928672b23c185fd3065..ffed90c0fc1240fc10b4cdd8df8377647b75beda 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
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable; @@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
@ -16,7 +16,7 @@ index d84375984c67a8ad2790efc1c584f7e2f995633e..f800b3e4debcd141a75de9e6025a87e8
import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.PlayerTeam;
@@ -3833,6 +3834,38 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3892,6 +3893,38 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.level().clip(raytrace); return this.level().clip(raytrace);
} }
@ -56,7 +56,7 @@ index d84375984c67a8ad2790efc1c584f7e2f995633e..f800b3e4debcd141a75de9e6025a87e8
public int getShieldBlockingDelay() { public int getShieldBlockingDelay() {
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 0707329670292551d966afe30818f17d079fcb3b..2913ad431b09a75106115257729960f8ba1637f4 100644 index 3d9e4ebb29f670d32bfe044ad22daaf82313498d..d5f53ddf1bb24c933bf38efbe142411663ec2470 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
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Add sun related API
public net.minecraft.world.entity.Mob isSunBurnTick()Z public net.minecraft.world.entity.Mob isSunBurnTick()Z
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 57f9324aa73be4fcbb9668ef7be6b6e64d57800e..be17e1a4afc2fd5490a59aa7bcb199fb61643d35 100644 index b7c5d1c9db8284e2ed51da603ebed36be1563046..7d9942004b52b4deae7ca09dafb43795d0d9c31d 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
@@ -692,6 +692,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -702,6 +702,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
} }
} }

View File

@ -13,40 +13,29 @@ Shulkers) may need to be changed in order for it to re-save properly
No more crashing though. No more crashing though.
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index 82a1a87822e3fc323b92e1aa30ddb0cdb351d89c..c69088a2ec374b2d236fec61e267f42afa2967b1 100644 index ff8876b7e7cc2172a2cb5e12d6836b9875cc9aa1..b9949b44553a8ac91565b6e614ac7bd7cd140dd0 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java --- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java +++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -18,6 +18,8 @@ import net.minecraft.core.BlockPos; @@ -538,4 +538,19 @@ public final class MCUtil {
import net.minecraft.core.Direction; public static int getTicketLevelFor(net.minecraft.world.level.chunk.ChunkStatus status) {
import net.minecraft.core.Vec3i; return net.minecraft.server.level.ChunkMap.MAX_VIEW_DISTANCE + net.minecraft.world.level.chunk.ChunkStatus.getDistance(status);
import net.minecraft.server.MinecraftServer;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ChunkHolder;
import net.minecraft.server.level.ChunkMap;
import net.minecraft.server.level.DistanceManager;
@@ -551,6 +553,21 @@ public final class MCUtil {
}
} }
+
+ @Nullable + @Nullable
+ public static Component getBaseComponentFromNbt(String key, CompoundTag compound) { + public static net.minecraft.network.chat.Component getBaseComponentFromNbt(String key, net.minecraft.nbt.CompoundTag compound) {
+ if (!compound.contains(key)) { + if (!compound.contains(key)) {
+ return null; + return null;
+ } + }
+ String string = compound.getString(key); + String string = compound.getString(key);
+ try { + try {
+ return Component.Serializer.fromJson(string); + return net.minecraft.network.chat.Component.Serializer.fromJson(string);
+ } catch (com.google.gson.JsonParseException e) { + } catch (com.google.gson.JsonParseException e) {
+ org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); + org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
+ } + }
+ +
+ return null; + return null;
+ } + }
+ }
public static ChunkStatus getChunkStatus(ChunkHolder chunk) {
return chunk.getChunkHolderStatus();
}
diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..9c7b7434ccd64668eb5d7bb61d03a9cb4105ea6e 100644 index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..9c7b7434ccd64668eb5d7bb61d03a9cb4105ea6e 100644
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java --- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
@ -61,7 +50,7 @@ index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..9c7b7434ccd64668eb5d7bb61d03a9cb
if (nbt.contains("TrackOutput", 1)) { if (nbt.contains("TrackOutput", 1)) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
index 6b983e3e867bdd8cdffaf4575bbf67ad96b57ec7..66e2137f9379e885294f2b9f67f7e35296792770 100644 index c6194fa1611412ac119fed493d5eab5a160e593d..d89037a83ae1b6d2afa6a589c1b8098cbedf3d2d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
@@ -98,7 +98,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { @@ -98,7 +98,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable {
@ -87,12 +76,12 @@ index e85022b31f2bc2783e88f5ba4c5173ac8a096c96..f1acd19432877a833f0d4339f9de4830
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index 8b79df496e1fad57e8c5c0aa97d0d84ab0deed1e..154e4652a93b50e9b26c93531a4e854601ed75e1 100644 index 18349957bd6d1a4bc21aff781a791f912dddff1d..cd28ee0cbc69713a641a21c9a626c694a4bcbfc9 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -367,7 +367,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -389,7 +389,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
this.levels = nbt.getInt("Levels"); // SPIGOT-5053, use where available this.secondaryPower = BeaconBlockEntity.loadEffect(nbt, "secondary_effect");
// CraftBukkit end this.levels = nbt.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available
if (nbt.contains("CustomName", 8)) { if (nbt.contains("CustomName", 8)) {
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); - this.name = Component.Serializer.fromJson(nbt.getString("CustomName"));
+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException + this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException

View File

@ -25,10 +25,10 @@ index 60e291abb3ebdf8676c13a2138d8eb436d033fa2..d27e5f9dac4703b839ab8444f6b54bf5
private final int searchRange; private final int searchRange;
private final int verticalSearchRange; private final int verticalSearchRange;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
index 3a3f5e567fdefad6887e42c8e9147194ae0c4d89..fd6ce6e8a3a7c889276e06fb427e0d17ed093149 100644 index ed1f6e77d5fc9b6f5f52b1a10275783b514c162c..652a8150f7343050b6da6c01f4e73a755138d491 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
@@ -487,14 +487,18 @@ public class Turtle extends Animal { @@ -496,14 +496,18 @@ public class Turtle extends Animal {
if (!this.turtle.isInWater() && this.isReachedTarget()) { if (!this.turtle.isInWater() && this.isReachedTarget()) {
if (this.turtle.layEggCounter < 1) { if (this.turtle.layEggCounter < 1) {
@ -50,7 +50,7 @@ index 3a3f5e567fdefad6887e42c8e9147194ae0c4d89..fd6ce6e8a3a7c889276e06fb427e0d17
world.setBlock(blockposition1, iblockdata, 3); world.setBlock(blockposition1, iblockdata, 3);
world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata)); world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata));
@@ -564,7 +568,7 @@ public class Turtle extends Animal { @@ -573,7 +577,7 @@ public class Turtle extends Animal {
@Override @Override
public boolean canUse() { public boolean canUse() {

View File

@ -19,10 +19,10 @@ spectate the target entity.
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
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 41e0b2826bae59e48fef7e35caeb3ce6e46031ea..040f93638d3c71fb8f23301b8903e7cfda980e5d 100644 index 9f36555177b98f4d66a8b45fc2b3a032c6bbce0d..ddc3522e38b3bafb3c3b32492d842d588efd1495 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
@@ -1978,6 +1978,19 @@ public class ServerPlayer extends Player { @@ -1942,6 +1942,19 @@ public class ServerPlayer extends Player {
this.camera = (Entity) (entity == null ? this : entity); this.camera = (Entity) (entity == null ? this : entity);
if (entity1 != this.camera) { if (entity1 != this.camera) {
@ -42,7 +42,7 @@ index 41e0b2826bae59e48fef7e35caeb3ce6e46031ea..040f93638d3c71fb8f23301b8903e7cf
Level world = this.camera.level(); Level world = this.camera.level();
if (world instanceof ServerLevel) { if (world instanceof ServerLevel) {
@@ -1993,7 +2006,6 @@ public class ServerPlayer extends Player { @@ -1957,7 +1970,6 @@ public class ServerPlayer extends Player {
this.connection.send(new ClientboundSetCameraPacket(this.camera)); this.connection.send(new ClientboundSetCameraPacket(this.camera));
this.connection.resetPosition(); this.connection.resetPosition();
} }

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Add more Witch API
public net.minecraft.world.entity.monster.Witch usingTime public net.minecraft.world.entity.monster.Witch usingTime
diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d96ea5a6c9 100644 index ca24b592273208e61e0e0ba59b7e5a3c11ebf952..580dff41d746d9591f718081d9dfe4ac77e7eeaa 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
@@ -157,21 +157,11 @@ public class Witch extends Raider implements RangedAttackMob { @@ -160,21 +160,10 @@ public class Witch extends Raider implements RangedAttackMob {
} }
if (potionregistry != null) { if (potionregistry != null) {
@ -28,13 +28,13 @@ index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d9
- } - }
- -
- AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); - AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED);
-
- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING); - attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId());
- attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); - attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING);
} }
} }
@@ -183,6 +173,24 @@ public class Witch extends Raider implements RangedAttackMob { @@ -186,6 +175,24 @@ public class Witch extends Raider implements RangedAttackMob {
super.aiStep(); super.aiStep();
} }
@ -51,7 +51,7 @@ index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d9
+ +
+ AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED);
+ +
+ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING); + attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId());
+ attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); + attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING);
+ } + }
+ // Paper end + // Paper end

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
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 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b14daebd2 100644 index 423390ff2508ab9af804925044142ea289068bae..a0e1010066b34650f5c554bfa8324ed0621f77f0 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
@@ -569,9 +569,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -466,9 +466,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d0 = entity.getX(); double d0 = entity.getX();
double d1 = entity.getY(); double d1 = entity.getY();
double d2 = entity.getZ(); double d2 = entity.getZ();
@ -22,7 +22,7 @@ index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b
float f = Mth.wrapDegrees(packet.getYRot()); float f = Mth.wrapDegrees(packet.getYRot());
float f1 = Mth.wrapDegrees(packet.getXRot()); float f1 = Mth.wrapDegrees(packet.getXRot());
double d6 = d3 - this.vehicleFirstGoodX; double d6 = d3 - this.vehicleFirstGoodX;
@@ -606,6 +606,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -503,6 +503,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
@ -39,7 +39,7 @@ index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b
if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
// CraftBukkit end // CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
@@ -1259,9 +1269,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1149,9 +1159,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.allowedPlayerTicks = 20; // CraftBukkit this.allowedPlayerTicks = 20; // CraftBukkit
} else { } else {
this.awaitingTeleportTime = this.tickCount; this.awaitingTeleportTime = this.tickCount;
@ -52,7 +52,7 @@ index 9092a04f7a98f022c9a9bfe5310643b4b89ce2e7..585376aecc7329975a5d3e6b7c091f5b
float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot()));
float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot()));
@@ -1316,6 +1326,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1206,6 +1216,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else { } else {
speed = this.player.getAbilities().walkingSpeed * 10f; speed = this.player.getAbilities().walkingSpeed * 10f;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn
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 040f93638d3c71fb8f23301b8903e7cfda980e5d..715314de7a92a8e06f82c6bff5fe74e3b23044f8 100644 index ddc3522e38b3bafb3c3b32492d842d588efd1495..10044e1d596665b8f8b88f0baf1c61c8d3af0c4e 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
@@ -2454,6 +2454,7 @@ public class ServerPlayer extends Player { @@ -2414,6 +2414,7 @@ public class ServerPlayer extends Player {
this.setHealth(this.getMaxHealth()); this.setHealth(this.getMaxHealth());
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset

View File

@ -7,20 +7,20 @@ Mojang was sleeping even if we had no more requests to go after
the current one finished, resulting in 100ms lost per profile lookup the current one finished, resulting in 100ms lost per profile lookup
diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
index cc38e909d1fa83206fa09666599d853a6e89ef36..c48a40155108b6bae18073638a0ba12649344261 100644 index da26c2e6c5ff88b50606e94cfbff5725da37ac7f..f3e8552e651faf6f50ca1cb66415c8d4484a7f27 100644
--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java --- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
+++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
@@ -43,6 +43,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { @@ -44,6 +44,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
} .collect(Collectors.toSet());
final int page = 0; final int page = 0;
+ boolean hasRequested = false; // Paper + boolean hasRequested = false; // Paper
for (final List<String> request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) { for (final List<String> request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) {
int failCount = 0; final List<String> normalizedRequest = request.stream().map(YggdrasilGameProfileRepository::normalizeName).toList();
@@ -68,6 +69,12 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { @@ -75,6 +76,12 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
LOGGER.debug("Couldn't find profile {}", name); LOGGER.debug("Couldn't find profile {}", name);
callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile")); callback.onProfileLookupFailed(name, new ProfileNotFoundException("Server did not find the requested profile"));
} }
+ // Paper start + // Paper start
+ if (!hasRequested) { + if (!hasRequested) {

View File

@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..b60f59cf5cc8eb84a6055b7861857dec
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795fe611a65 100644 index 30237ca94a36197ce21369bdcc7bb1dfafe02680..5e9401f0c2de0743aca9237ee8c4dfba586cfdb9 100644
--- a/src/main/java/net/minecraft/Util.java --- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java
@@ -81,7 +81,7 @@ public class Util { @@ -81,7 +81,7 @@ public class Util {
@ -47,7 +47,7 @@ index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795
// Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread // Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread
public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() { public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() {
@@ -144,14 +144,18 @@ public class Util { @@ -145,14 +145,18 @@ public class Util {
return FILENAME_DATE_TIME_FORMATTER.format(ZonedDateTime.now()); return FILENAME_DATE_TIME_FORMATTER.format(ZonedDateTime.now());
} }
@ -70,7 +70,7 @@ index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795
@Override @Override
protected void onTermination(Throwable throwable) { protected void onTermination(Throwable throwable) {
if (throwable != null) { if (throwable != null) {
@@ -167,6 +171,7 @@ public class Util { @@ -168,6 +172,7 @@ public class Util {
return forkJoinWorkerThread; return forkJoinWorkerThread;
}, Util::onThreadException, true); }, Util::onThreadException, true);
} }
@ -79,10 +79,10 @@ index 0f05d26248d8c999048a88796df227a6a1e3755f..7354711e194ab58b11b68f447c1fc795
return executorService; return executorService;
} }
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 d05f776204a720084a583c6d6dfe47936761b6e3..e5ab15722fe640d4766b9a24fb82b1d60f15a241 100644 index 715ebeb36f0620eaeafa63bf87a30e63363069a3..c2a2985362672aba907039907605b3ea3e53262c 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
@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
thread.setUncaughtExceptionHandler((thread1, throwable) -> { thread.setUncaughtExceptionHandler((thread1, throwable) -> {
MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable); MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable);
}); });

View File

@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet
object for every player unless they have per-player time enabled. object for every player unless they have per-player time enabled.
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 e5ab15722fe640d4766b9a24fb82b1d60f15a241..1a74b7c252d16e5ab2c303e6e96c62e78ef9311c 100644 index c2a2985362672aba907039907605b3ea3e53262c..0f50236866984efd7b8cb95373215b240117be0d 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
@@ -1386,12 +1386,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1379,12 +1379,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Use Vanilla Minecart Speeds
CraftBukkit changed the values on flying speed, restore back to vanilla CraftBukkit changed the values on flying speed, restore back to vanilla
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
index 700db80055d93274aeccbe4a57a1a98f261442fb..c2a18a8e52f897bc96227854646e53e4dc189362 100644 index ceedb9e76bab57a7d04a05cc6fd2ee4005cbf203..8bea12248bf3ae95c629578386292732d0b74630 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -104,9 +104,9 @@ public abstract class AbstractMinecart extends Entity { @@ -108,9 +108,9 @@ public abstract class AbstractMinecart extends Entity {
private double derailedX = 0.5; private double derailedX = 0.5;
private double derailedY = 0.5; private double derailedY = 0.5;
private double derailedZ = 0.5; private double derailedZ = 0.5;

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling
Only process drops when the block is actually going to be removed Only process drops when the block is actually going to be removed
diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
index 305803d54058c0bd48808d3b2dec8b474d9c2591..4bce895268542531598a01a1bccd8ac1ed703b7d 100644 index d2c2adb0484985897db5f4fdc9b88f0e4b2c3235..d810f6bf9a8a354e5b8994e51ec3672428277dde 100644
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java --- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
@@ -124,7 +124,11 @@ public class SpongeBlock extends Block { @@ -127,7 +127,11 @@ public class SpongeBlock extends Block {
} else if (iblockdata.is(Blocks.KELP) || iblockdata.is(Blocks.KELP_PLANT) || iblockdata.is(Blocks.SEAGRASS) || iblockdata.is(Blocks.TALL_SEAGRASS)) { } else if (iblockdata.is(Blocks.KELP) || iblockdata.is(Blocks.KELP_PLANT) || iblockdata.is(Blocks.SEAGRASS) || iblockdata.is(Blocks.TALL_SEAGRASS)) {
BlockEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition1) : null; BlockEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition1) : null;

View File

@ -59,10 +59,10 @@ index 7adf7d1248680e591638298f13f5ae88788f5e4c..bdf11a98614c9c12d3112f437651be81
this.level.destroyBlockProgress(this.player.getId(), pos, -1); this.level.destroyBlockProgress(this.player.getId(), pos, -1);
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 585376aecc7329975a5d3e6b7c091f5b14daebd2..9f87d35fb20b63b01252dc844ca3a584c16c7129 100644 index a0e1010066b34650f5c554bfa8324ed0621f77f0..8b26ce9c8d1003ef611cdc14aee3f5d4cfd6a6fb 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
@@ -1664,6 +1664,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1554,6 +1554,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
case START_DESTROY_BLOCK: case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK: case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK: case STOP_DESTROY_BLOCK:

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index 0dd48e4098191c8b6e29945d62bc473e9f3a1e77..ae51993e0de706cb62c96795ca9de7663893a5bf 100644 index de0e1ad2c78e5132651494f198703533847c84bd..830978f3409888302ab857161628cee5869efa8f 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java --- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java +++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -75,7 +75,7 @@ public final class PaperCommand extends Command { @@ -74,7 +74,7 @@ public final class PaperCommand extends Command {
if (sender.hasPermission(BASE_PERM + permission) || sender.hasPermission("bukkit.command.paper")) { if (sender.hasPermission(BASE_PERM + permission) || sender.hasPermission("bukkit.command.paper")) {
return true; return true;
} }
@ -18,10 +18,10 @@ index 0dd48e4098191c8b6e29945d62bc473e9f3a1e77..ae51993e0de706cb62c96795ca9de766
} }
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 2e64d43cdc25135fadb759ea503b26104b881968..4926f9f5eaf13b339ce2c2385faf9f4afba3d029 100644 index 7afc77aa2b9959689d18b0a93c9d87e663b0f034..223e43758a009a9f5d97e9e89745bb12f2d72d2f 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
@@ -2705,6 +2705,16 @@ public final class CraftServer implements Server { @@ -2708,6 +2708,16 @@ public final class CraftServer implements Server {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
} }

View File

@ -7,19 +7,23 @@ If a players inventory is too big to send in a single packet,
split the inventory set into multiple packets instead. split the inventory set into multiple packets instead.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 7065d8e2b0782f1dbaf9932db9201b94ae455a31..f5106ed464d496420ac575b09d6c9a7dfeb87bec 100644 index 2d7f332910328cef616609dc4c89facafcbe66cc..ff97e47cb248ade6530e52583b0b3865d77ace15 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -158,6 +158,18 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -144,6 +144,22 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
} }
public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) { public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) {
+ // Paper start + // Paper start
+ if (throwable instanceof io.netty.handler.codec.EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException packetTooLargeException) { + if (throwable instanceof io.netty.handler.codec.EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException packetTooLargeException) {
+ if (packetTooLargeException.getPacket().packetTooLarge(this)) { + final Packet<?> packet = packetTooLargeException.getPacket();
+ final io.netty.util.Attribute<ConnectionProtocol.CodecData<?>> codecDataAttribute = channelhandlercontext.channel().attr(packetTooLargeException.codecKey);
+ if (packet.packetTooLarge(this)) {
+ ProtocolSwapHandler.swapProtocolIfNeeded(codecDataAttribute, packet);
+ return; + return;
+ } else if (packetTooLargeException.getPacket().isSkippable()) { + } else if (packet.isSkippable()) {
+ Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause()); + Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause());
+ ProtocolSwapHandler.swapProtocolIfNeeded(codecDataAttribute, packet);
+ return; + return;
+ } else { + } else {
+ throwable = throwable.getCause(); + throwable = throwable.getCause();
@ -30,29 +34,31 @@ index 7065d8e2b0782f1dbaf9932db9201b94ae455a31..f5106ed464d496420ac575b09d6c9a7d
Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause()); Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause());
} else { } else {
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
index 42828edf81bd475b673a9d143f79c0d0711f14f5..fbfadeb83719b81f42724e79c59e92ed88fdece7 100644 index 3d359f80f52bff6f19fcb484f491a874f9dcff27..45b4f1c295eda2fcc5067a4b21de247218ef117f 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java --- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java
@@ -40,7 +40,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -41,7 +41,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
int j = friendlyByteBuf.writerIndex(); int j = friendlyByteBuf.writerIndex();
packet.write(friendlyByteBuf); packet.write(friendlyByteBuf);
int k = friendlyByteBuf.writerIndex() - j; int k = friendlyByteBuf.writerIndex() - j;
- if (k > 8388608) { - if (k > 8388608) {
+ if (false && k > 8388608) { // Paper - disable + if (false && k > 8388608) { // Paper - disable
throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet); throw new IllegalArgumentException("Packet too big (is " + k + ", should be less than 8388608): " + packet);
} else {
int l = channelHandlerContext.channel().attr(Connection.ATTRIBUTE_PROTOCOL).get().getId();
@@ -54,7 +54,31 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
throw var10;
} }
@@ -54,10 +54,35 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
throw var13;
} finally {
+ // Paper start
+ int packetLength = friendlyByteBuf.readableBytes();
+ if (packetLength > MAX_PACKET_SIZE) {
+ throw new PacketTooLargeException(packet, this.codecKey, packetLength);
+ }
+ // Paper end
ProtocolSwapHandler.swapProtocolIfNeeded(attribute, packet);
} }
+
+ // Paper start
+ int packetLength = friendlyByteBuf.readableBytes();
+ if (packetLength > MAX_PACKET_SIZE) {
+ throw new PacketTooLargeException(packet, packetLength);
+ }
+ // Paper end
} }
} }
} }
@ -62,23 +68,25 @@ index 42828edf81bd475b673a9d143f79c0d0711f14f5..fbfadeb83719b81f42724e79c59e92ed
+ +
+ public static class PacketTooLargeException extends RuntimeException { + public static class PacketTooLargeException extends RuntimeException {
+ private final Packet<?> packet; + private final Packet<?> packet;
+ public final AttributeKey<ConnectionProtocol.CodecData<?>> codecKey;
+ +
+ PacketTooLargeException(Packet<?> packet, int packetLength) { + PacketTooLargeException(Packet<?> packet, AttributeKey<ConnectionProtocol.CodecData<?>> codecKey, int packetLength) {
+ super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength + ". Max is " + MAX_PACKET_SIZE); + super("PacketTooLarge - " + packet.getClass().getSimpleName() + " is " + packetLength + ". Max is " + MAX_PACKET_SIZE);
+ this.packet = packet; + this.packet = packet;
+ this.codecKey = codecKey;
+ } + }
+ +
+ public Packet<?> getPacket() { + public Packet<?> getPacket() {
+ return packet; + return this.packet;
+ } + }
+ } + }
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/network/protocol/Packet.java b/src/main/java/net/minecraft/network/protocol/Packet.java diff --git a/src/main/java/net/minecraft/network/protocol/Packet.java b/src/main/java/net/minecraft/network/protocol/Packet.java
index 10c1f2d8a92f848c3f2be9d1d06fd254978e6dcc..74bfe0d3942259c45702b099efdc4e101a4e3022 100644 index 700418bb0c9fbed3f161611881b1e222248ca4eb..cc658a61065d5c0021a4b88fa58b40211b94f8ec 100644
--- a/src/main/java/net/minecraft/network/protocol/Packet.java --- a/src/main/java/net/minecraft/network/protocol/Packet.java
+++ b/src/main/java/net/minecraft/network/protocol/Packet.java +++ b/src/main/java/net/minecraft/network/protocol/Packet.java
@@ -8,6 +8,12 @@ public interface Packet<T extends PacketListener> { @@ -10,6 +10,12 @@ public interface Packet<T extends PacketListener> {
void handle(T listener); void handle(T listener);

View File

@ -20,10 +20,10 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome! Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a42f9892b9 100644 index 72c5fde2220524f66a2608ecfa96c7b56f8b198c..d0779d38c56ca1c01abd154720d2865d14479a30 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2564,11 +2564,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2524,11 +2524,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public void removeVehicle() { public void removeVehicle() {
@ -41,7 +41,7 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4
} }
} }
@@ -2599,7 +2604,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2559,7 +2564,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
} }
@ -53,7 +53,7 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4
if (entity.getVehicle() == this) { if (entity.getVehicle() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
@@ -2609,7 +2617,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2569,7 +2577,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
VehicleExitEvent event = new VehicleExitEvent( VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) this.getBukkitEntity(), (Vehicle) this.getBukkitEntity(),
@ -62,7 +62,7 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4
); );
// Suppress during worldgen // Suppress during worldgen
if (this.valid) { if (this.valid) {
@@ -2623,7 +2631,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2583,7 +2591,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
// CraftBukkit end // CraftBukkit end
// Spigot start // Spigot start
@ -72,10 +72,10 @@ index 7ca89b1a5bbeefd8622cb0f93e0235abcefbc033..dee47ff97e4f08154866d7628c3588a4
if (this.valid) { if (this.valid) {
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
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 f800b3e4debcd141a75de9e6025a87e81cee083c..965c5724eb4927f017123c791c4a721c59b6db15 100644 index ffed90c0fc1240fc10b4cdd8df8377647b75beda..0f7f90a6b358402c7a05217f59768448eabfce53 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
@@ -3438,9 +3438,15 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3472,9 +3472,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
@Override @Override
public void stopRiding() { public void stopRiding() {
@ -93,10 +93,10 @@ index f800b3e4debcd141a75de9e6025a87e81cee083c..965c5724eb4927f017123c791c4a721c
this.dismountVehicle(entity); this.dismountVehicle(entity);
} }
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 c7bcbc3f0542a74c30e29bded3bfc0e94daeab25..078986fb32eeecacc954ad6719e981ed8b3a2350 100644 index ddd43b5e9ab77c1baaa7c777dc0b3e89789d7626..9d252aea2c372f9a6b46319564dc6dc5e94d9a91 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
@@ -1148,7 +1148,13 @@ public abstract class Player extends LivingEntity { @@ -1154,7 +1154,13 @@ public abstract class Player extends LivingEntity {
@Override @Override
public void removeVehicle() { public void removeVehicle() {

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Add more Zombie API
public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d72c9653a 100644 index 61ecf5c51fbdf38ec5513453c2de037489fd8c7e..2be074ecbc131b68574cf77ba9cab96424715522 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -95,6 +95,7 @@ public class Zombie extends Monster { @@ -96,6 +96,7 @@ public class Zombie extends Monster {
private int inWaterTime; private int inWaterTime;
public int conversionTime; public int conversionTime;
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
@ -18,7 +18,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d
public Zombie(EntityType<? extends Zombie> type, Level world) { public Zombie(EntityType<? extends Zombie> type, Level world) {
super(type, world); super(type, world);
@@ -263,6 +264,12 @@ public class Zombie extends Monster { @@ -264,6 +265,12 @@ public class Zombie extends Monster {
super.aiStep(); super.aiStep();
} }
@ -31,7 +31,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d
public void startUnderWaterConversion(int ticksUntilWaterConversion) { public void startUnderWaterConversion(int ticksUntilWaterConversion) {
this.lastTick = MinecraftServer.currentTick; // CraftBukkit this.lastTick = MinecraftServer.currentTick; // CraftBukkit
this.conversionTime = ticksUntilWaterConversion; this.conversionTime = ticksUntilWaterConversion;
@@ -292,9 +299,15 @@ public class Zombie extends Monster { @@ -293,9 +300,15 @@ public class Zombie extends Monster {
} }
public boolean isSunSensitive() { public boolean isSunSensitive() {
@ -48,7 +48,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d
@Override @Override
public boolean hurt(DamageSource source, float amount) { public boolean hurt(DamageSource source, float amount) {
if (!super.hurt(source, amount)) { if (!super.hurt(source, amount)) {
@@ -414,6 +427,7 @@ public class Zombie extends Monster { @@ -415,6 +428,7 @@ public class Zombie extends Monster {
nbt.putBoolean("CanBreakDoors", this.canBreakDoors()); nbt.putBoolean("CanBreakDoors", this.canBreakDoors());
nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1); nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1); nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
@ -56,7 +56,7 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d
} }
@Override @Override
@@ -425,6 +439,11 @@ public class Zombie extends Monster { @@ -426,6 +440,11 @@ public class Zombie extends Monster {
if (nbt.contains("DrownedConversionTime", 99) && nbt.getInt("DrownedConversionTime") > -1) { if (nbt.contains("DrownedConversionTime", 99) && nbt.getInt("DrownedConversionTime") > -1) {
this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime")); this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime"));
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits
Puts some limits on the size of books. Puts some limits on the size of books.
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 9f87d35fb20b63b01252dc844ca3a584c16c7129..c5b682d08ab270d153eb600afe9a21bfa1305072 100644 index 8b26ce9c8d1003ef611cdc14aee3f5d4cfd6a6fb..08af9c32f8cb40e1e94cfb5c42ee113e8765db86 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
@@ -1126,6 +1126,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1016,6 +1016,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleEditBook(ServerboundEditBookPacket packet) { public void handleEditBook(ServerboundEditBookPacket packet) {

View File

@ -39,13 +39,13 @@ public net.minecraft.server.network.ServerLoginPacketListenerImpl state
public net.minecraft.server.network.ServerLoginPacketListenerImpl gameProfile public net.minecraft.server.network.ServerLoginPacketListenerImpl gameProfile
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index f5106ed464d496420ac575b09d6c9a7dfeb87bec..b293ac99e436b02c9ef30994a394bcc53ebbf2f9 100644 index ff97e47cb248ade6530e52583b0b3865d77ace15..ed89f2f96088c5c05fd42a6795e6e6e342a0ab54 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -509,6 +509,26 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -632,6 +632,27 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
this.getPacketListener().onDisconnect(Component.translatable("multiplayer.disconnect.generic")); packetlistener1.onDisconnect(ichatbasecomponent);
} }
this.queue.clear(); // Free up packet queue. this.pendingActions.clear(); // Free up packet queue.
+ // Paper start - Add PlayerConnectionCloseEvent + // Paper start - Add PlayerConnectionCloseEvent
+ final PacketListener packetListener = this.getPacketListener(); + final PacketListener packetListener = this.getPacketListener();
+ if (packetListener instanceof net.minecraft.server.network.ServerGamePacketListenerImpl) { + if (packetListener instanceof net.minecraft.server.network.ServerGamePacketListenerImpl) {
@ -66,6 +66,7 @@ index f5106ed464d496420ac575b09d6c9a7dfeb87bec..b293ac99e436b02c9ef30994a394bcc5
+ } + }
+ } + }
+ // Paper end + // Paper end
} + }
}
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent Enderman from loading chunks
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 06a0a06f3f4ed20f151ddac35ae7d56852e191ae..f7ad34f38d26ab08bb5dd788bc70ba01b53fc1a1 100644 index bf5b7b996c9141c7cef9c281323115bd593dc777..5b3da07def02830e4332d7d3a7f7b968e5663c7b 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
@@ -510,7 +510,8 @@ public class EnderMan extends Monster implements NeutralMob { @@ -517,7 +517,8 @@ public class EnderMan extends Monster implements NeutralMob {
int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 2.0D); int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 2.0D);
int k = Mth.floor(this.enderman.getZ() - 1.0D + randomsource.nextDouble() * 2.0D); int k = Mth.floor(this.enderman.getZ() - 1.0D + randomsource.nextDouble() * 2.0D);
BlockPos blockposition = new BlockPos(i, j, k); BlockPos blockposition = new BlockPos(i, j, k);
@ -18,7 +18,7 @@ index 06a0a06f3f4ed20f151ddac35ae7d56852e191ae..f7ad34f38d26ab08bb5dd788bc70ba01
BlockPos blockposition1 = blockposition.below(); BlockPos blockposition1 = blockposition.below();
BlockState iblockdata1 = world.getBlockState(blockposition1); BlockState iblockdata1 = world.getBlockState(blockposition1);
BlockState iblockdata2 = this.enderman.getCarriedBlock(); BlockState iblockdata2 = this.enderman.getCarriedBlock();
@@ -554,7 +555,8 @@ public class EnderMan extends Monster implements NeutralMob { @@ -561,7 +562,8 @@ public class EnderMan extends Monster implements NeutralMob {
int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 3.0D); int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 3.0D);
int k = Mth.floor(this.enderman.getZ() - 2.0D + randomsource.nextDouble() * 4.0D); int k = Mth.floor(this.enderman.getZ() - 2.0D + randomsource.nextDouble() * 4.0D);
BlockPos blockposition = new BlockPos(i, j, k); BlockPos blockposition = new BlockPos(i, j, k);

View File

@ -16,11 +16,11 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose. documented as to their purpose.
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 715314de7a92a8e06f82c6bff5fe74e3b23044f8..b59ad5f0cc12082db0c885b29d88c526a4029e22 100644 index 10044e1d596665b8f8b88f0baf1c61c8d3af0c4e..78405a80e16f44231c0d4ee10d283c521aead686 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
@@ -243,6 +243,7 @@ public class ServerPlayer extends Player { @@ -241,6 +241,7 @@ public class ServerPlayer extends Player {
public int latency; private int containerCounter;
public boolean wonGame; public boolean wonGame;
private int containerUpdateDelay; // Paper private int containerUpdateDelay; // Paper
+ public long loginTime; // Paper + public long loginTime; // Paper
@ -28,12 +28,12 @@ index 715314de7a92a8e06f82c6bff5fe74e3b23044f8..b59ad5f0cc12082db0c885b29d88c526
public boolean queueHealthUpdatePacket = false; public boolean queueHealthUpdatePacket = false;
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 2bccba03bb12cf17a82c1e54c2bb10535b7c8964..5657493e215a17f3132f9d411424875160fda6d9 100644 index 68b6956fc1866fc5b78544cfd348db864b3042e9..7b094b859fe4c865cd369108700d5b0d6573c019 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
@@ -189,6 +189,7 @@ public abstract class PlayerList { @@ -181,6 +181,7 @@ public abstract class PlayerList {
public void placeNewPlayer(Connection connection, ServerPlayer player) { public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
player.isRealPlayer = true; // Paper player.isRealPlayer = true; // Paper
+ player.loginTime = System.currentTimeMillis(); // Paper + player.loginTime = System.currentTimeMillis(); // Paper
GameProfile gameprofile = player.getGameProfile(); GameProfile gameprofile = player.getGameProfile();
@ -106,10 +106,10 @@ index aac78c13361b19efa7b43a0c95458390f1ba8340..f572a74b85df36a6da76b78ec29d8072
public Location getLastDeathLocation() { public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) { if (this.getData().contains("LastDeathLocation", 10)) {
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 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59748ae867 100644 index 874f515eb8cf7bc3fa2e37f09993fd4454ec089e..574186529adc6d780efb1f9644703d6c472f16d4 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
@@ -193,6 +193,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -195,6 +195,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash; private String resourcePackHash;
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
@ -117,7 +117,7 @@ index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59
// Paper end // Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1950,6 +1951,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1910,6 +1911,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed; this.firstPlayed = firstPlayed;
} }
@ -136,7 +136,7 @@ index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59
public void readExtraData(CompoundTag nbttagcompound) { public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true; this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) { if (nbttagcompound.contains("bukkit")) {
@@ -1972,6 +1985,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1932,6 +1945,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setExtraData(CompoundTag nbttagcompound) { public void setExtraData(CompoundTag nbttagcompound) {
@ -145,7 +145,7 @@ index 1c09e955e34380b99572cc5950806417ac10bfc8..a9f80c019f5a127d9273833608917c59
if (!nbttagcompound.contains("bukkit")) { if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag()); nbttagcompound.put("bukkit", new CompoundTag());
} }
@@ -1986,6 +2001,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1946,6 +1961,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("firstPlayed", this.getFirstPlayed());
data.putLong("lastPlayed", System.currentTimeMillis()); data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName()); data.putString("lastKnownName", handle.getScoreboardName());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
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 b59ad5f0cc12082db0c885b29d88c526a4029e22..d29e13aa7bbfbab54f8a3d73279891d65e957d7e 100644 index 78405a80e16f44231c0d4ee10d283c521aead686..9ad2e953a3b4a7a2f4ce375a1b209820cdef2d47 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
@@ -1644,6 +1644,13 @@ public class ServerPlayer extends Player { @@ -1603,6 +1603,13 @@ public class ServerPlayer extends Player {
public void disconnect() { public void disconnect() {
this.disconnected = true; this.disconnected = true;
this.ejectPassengers(); this.ejectPassengers();

View File

@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
be unintentional in the few cases we've seen so far. be unintentional in the few cases we've seen so far.
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 a9f80c019f5a127d9273833608917c59748ae867..08404472a89192fb0cbae0192793c4c4ae63a9bb 100644 index 574186529adc6d780efb1f9644703d6c472f16d4..ffac201e99efcc1527956df18cce5aab986332e9 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
@@ -2874,6 +2874,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2848,6 +2848,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() { public void resetCooldown() {
getHandle().resetAttackStrengthTicker(); getHandle().resetAttackStrengthTicker();
} }

View File

@ -11,7 +11,7 @@ floating in the air.
This can replace many uses of BlockPhysicsEvent This can replace many uses of BlockPhysicsEvent
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 18234d71eba7d2a2874f3e5c9628d82970acc033..b3a0f4dd651dda29d2064b629da67378c00a6a78 100644 index e66e35b25dfce6f071173de87c452a9dd38fcf4d..9fa7dd67ebe5d7d4125e970dbe2e3b201b01f6aa 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
@@ -30,6 +30,7 @@ import net.minecraft.nbt.CompoundTag; @@ -30,6 +30,7 @@ import net.minecraft.nbt.CompoundTag;
@ -22,7 +22,7 @@ index 18234d71eba7d2a2874f3e5c9628d82970acc033..b3a0f4dd651dda29d2064b629da67378
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.FullChunkStatus; import net.minecraft.server.level.FullChunkStatus;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@@ -666,8 +667,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -661,8 +662,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return false; return false;
} else { } else {
FluidState fluid = this.getFluidState(pos); FluidState fluid = this.getFluidState(pos);

View File

@ -9,10 +9,10 @@ commands if the server is restarting. Using the default async pool caused issues
due to the shutdown logic generally being much later. due to the shutdown logic generally being much later.
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index e3394864e29357fec036f9e616472aeab95d035e..b7f1569c662df13f278fc704cabec0400ba7c382 100644 index e63632f09d608371aaeaf09a6dac57c1d8a719d4..bbf4db5faf4694e78e01f4e74e277b46a02f7afd 100644
--- a/src/main/java/net/minecraft/commands/Commands.java --- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -398,6 +398,24 @@ public class Commands { @@ -404,6 +404,24 @@ public class Commands {
if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot
// CraftBukkit start // CraftBukkit start
// Register Vanilla commands into builtRoot as before // Register Vanilla commands into builtRoot as before
@ -37,7 +37,7 @@ index e3394864e29357fec036f9e616472aeab95d035e..b7f1569c662df13f278fc704cabec040
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
RootCommandNode vanillaRoot = new RootCommandNode(); RootCommandNode vanillaRoot = new RootCommandNode();
@@ -415,7 +433,14 @@ public class Commands { @@ -421,7 +439,14 @@ public class Commands {
for (CommandNode node : rootcommandnode.getChildren()) { for (CommandNode node : rootcommandnode.getChildren()) {
bukkit.add(node.getName()); bukkit.add(node.getName());
} }
@ -53,10 +53,10 @@ index e3394864e29357fec036f9e616472aeab95d035e..b7f1569c662df13f278fc704cabec040
event.getPlayer().getServer().getPluginManager().callEvent(event); event.getPlayer().getServer().getPluginManager().callEvent(event);
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 1a74b7c252d16e5ab2c303e6e96c62e78ef9311c..d84ed437e91a620c294533ddcb098cc11bc16c1f 100644 index 0f50236866984efd7b8cb95373215b240117be0d..bace1ff9e64bd8bec334c5e1d1fd1c621a63cd92 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
@@ -895,6 +895,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -870,6 +870,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Stopping server"); MinecraftServer.LOGGER.info("Stopping server");