Updated Upstream (CraftBukkit/Spigot)

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

CraftBukkit Changes:
65247583f SPIGOT-7857: Improve ItemMeta block data deserialization
05d80500d SPIGOT-7857: Fix spurious internal NBT tag when deserializing BlockStateMeta
cebb58e9a SPIGOT-7804: Fix written book serialization
efcdd5d38 SPIGOT-7794: Cancelling InventoryItemMoveEvent destroys items
b568ba572 SPIGOT-7789: Fix NPE in CraftMetaFirework applyToItem
f057cf449 Remove outdated build delay

Spigot Changes:
f6a48054 SPIGOT-7835: Fix issue with custom hopper settings
bb63b137 Rebuild patches
e1142b4d Rebuild patches
This commit is contained in:
Nassim Jahnke 2024-08-24 11:07:12 +02:00
parent 20f51650a9
commit 6e71f41536
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
517 changed files with 474 additions and 510 deletions

View File

@ -23,10 +23,10 @@ index 0000000000000000000000000000000000000000..f309961e0e96b6baacc4fe6d80dabd6c
+}
diff --git a/src/main/java/io/papermc/paper/event/block/BlockLockCheckEvent.java b/src/main/java/io/papermc/paper/event/block/BlockLockCheckEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0974c0572
index 0000000000000000000000000000000000000000..5e2c8ad26dea2c8a84ae10f7da8cb836e78d7b68
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/BlockLockCheckEvent.java
@@ -0,0 +1,186 @@
@@ -0,0 +1,187 @@
+package io.papermc.paper.event.block;
+
+import com.google.common.base.Preconditions;
@ -34,6 +34,7 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+import net.kyori.adventure.sound.Sound;
+import net.kyori.adventure.text.Component;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockState;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
@ -53,7 +54,6 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final LockableTileState state;
+ private final Player player;
+ private Component lockedMessage;
+ private Sound lockedSound;
@ -61,9 +61,8 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+ private Result result = Result.DEFAULT;
+
+ @ApiStatus.Internal
+ public BlockLockCheckEvent(final @NotNull Block block, final @NotNull LockableTileState state, final @NotNull Player player, final @NotNull Component lockedMessage, final @NotNull Sound lockedSound) {
+ public BlockLockCheckEvent(final @NotNull Block block, final @NotNull Player player, final @NotNull Component lockedMessage, final @NotNull Sound lockedSound) {
+ super(block);
+ this.state = state;
+ this.player = player;
+ this.lockedMessage = lockedMessage;
+ this.lockedSound = lockedSound;
@ -76,7 +75,9 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+ * @return the snapshot block state.
+ */
+ public @NotNull LockableTileState getBlockState() {
+ return this.state;
+ final BlockState blockState = this.getBlock().getState();
+ Preconditions.checkState(blockState instanceof LockableTileState, "Block state of lock-checked block is no longer a lockable tile state!");
+ return (LockableTileState) blockState;
+ }
+
+ /**

View File

@ -131,14 +131,16 @@ index a5e8713bc0fefae455b666ebf13c9529e7ba94e6..1a528e1aa7b12f8b8cffce6c7bc4b5d5
public static PackRepository createPackRepository(Path dataPacksPath, DirectoryValidator symlinkFinder) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 029783f07da0a8d91c2e443f76359b89869bc4cc..bebc3bcffa6dc12d4caf613f05b1e2a28a26f316 100644
index d1442420f4f0ace1f6dab126785ef030a364a48c..d409bf8f4d3dcd9cb28d7493406404101b18aee8 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -210,7 +210,7 @@ public class Main {
@@ -209,8 +209,8 @@ public class Main {
Main.useConsole = false;
}
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
- if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
- Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
+ if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Paper
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance();

View File

@ -3585,7 +3585,7 @@ index bd32f4e6ab8c41404ebcc8ef3b448c71db7b0650..ee5b61c476abc1f9a2babf350ac9dfa4
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index e5f070de12b63487b71c54d8020a895e5eda862c..73c44f94aac069fa3ea9e82be6b95e77a2421c63 100644
index 27ff661ded7c7241de8967a44739654887f69473..16c0d9956a1fe7081ddd07fe9cfeb05eb1820d0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -20,6 +20,12 @@ public class Main {
@ -4844,7 +4844,7 @@ index 9e05a8515c5f6f340182e91150fcad8bbf80a22b..adf22ce4f0bcd3bd57dc2030c6c92d3d
@Override
public CraftMerchant getCraftMerchant() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
index 61ad00c38cfef8a1de61b4597ec1042428feccf4..4da38ebb7fdbdb0f8fa422ebcd2e3eec2b2be846 100644
index 3ab6b212001c2b92cac42c0ff97e59c3d08b3e49..552ebe67f87b48734adf0da8ef78dcac9dd670a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
@@ -2,8 +2,9 @@ package org.bukkit.craftbukkit.inventory;
@ -4999,19 +4999,18 @@ index 61ad00c38cfef8a1de61b4597ec1042428feccf4..4da38ebb7fdbdb0f8fa422ebcd2e3eec
if (this.pages != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd63892f439 100644
index c71a4971f127fdfc753306019313ce1a31201120..af15a8758ff40f64787f17be40d48b3419d424f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
@@ -2,7 +2,7 @@ package org.bukkit.craftbukkit.inventory;
import com.google.common.base.Preconditions;
@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.Lists;
+import com.google.common.collect.ImmutableMap; // Paper
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -346,7 +346,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
@@ -346,7 +347,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
}
@Override
@ -5020,7 +5019,7 @@ index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd6
super.serialize(builder);
if (this.hasTitle()) {
@@ -459,4 +459,113 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
@@ -459,4 +460,113 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
return this.spigot;
}
// Spigot end
@ -5135,10 +5134,10 @@ index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd6
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index c33161090f6f746c04a87ca5b71f4df80f4fd246..41ba64593bd548131d1cdbecc79b2f38406aa78b 100644
index 3ce5ebf4ee022d8c769736d503ad80642aa6b389..d1246f67abc5c2927b75a99bba6b9e9d56af4d7c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -883,6 +883,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -890,6 +890,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return !(this.hasDisplayName() || this.hasItemName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.build().isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isHideTooltip() || this.isUnbreakable() || this.hasEnchantmentGlintOverride() || this.isFireResistant() || this.hasMaxStackSize() || this.hasRarity() || this.hasFood() || this.hasTool() || this.hasDamage() || this.hasMaxDamage() || this.hasAttributeModifiers() || this.customTag != null);
}
@ -5157,7 +5156,7 @@ index c33161090f6f746c04a87ca5b71f4df80f4fd246..41ba64593bd548131d1cdbecc79b2f38
@Override
public String getDisplayName() {
return CraftChatMessage.fromComponent(this.displayName);
@@ -913,6 +925,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -920,6 +932,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.itemName != null;
}
@ -5176,7 +5175,7 @@ index c33161090f6f746c04a87ca5b71f4df80f4fd246..41ba64593bd548131d1cdbecc79b2f38
@Override
public String getLocalizedName() {
return this.getDisplayName();
@@ -932,6 +956,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -939,6 +963,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore != null && !this.lore.isEmpty();
}
@ -5547,10 +5546,10 @@ index 4d586e1375ed8782939c9d480479e0dd981f8cbc..7900adb0b158bc17dd792dd082c33854
+
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
index 28038c3a531680201dcc8f2716b8f46f3886e769..5a9ddf71dc186c537a23083ac59434fb446a2140 100644
index ff040613083c015d9c52c0995591b64305fd5018..1b552b3f05ac7fc44450de4b1ec78907a0f62424 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
@@ -308,6 +308,7 @@ public final class CraftChatMessage {
@@ -264,6 +264,7 @@ public final class CraftChatMessage {
public static String fromComponent(Component component) {
if (component == null) return "";

View File

@ -423,7 +423,7 @@ index beff0bfe2502a17fd297524c51f96b33f889db93..749a4f1e8e46e0b072832056186d709a
@Override
public PluginCommand getPluginCommand(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 73c44f94aac069fa3ea9e82be6b95e77a2421c63..2ef6386ea4b95211e26c8759cae849cbe68e3f40 100644
index 16c0d9956a1fe7081ddd07fe9cfeb05eb1820d0d..ac450dfcbf3e0f9792b4e073ee768b466729bca2 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -13,7 +13,6 @@ import java.util.logging.Logger;
@ -461,7 +461,7 @@ index 73c44f94aac069fa3ea9e82be6b95e77a2421c63..2ef6386ea4b95211e26c8759cae849cb
+ System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
}
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Paper
@@ -242,6 +252,7 @@ public class Main {
}
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61666cde01 100644
index d1246f67abc5c2927b75a99bba6b9e9d56af4d7c..9541ecd3554e5c9de02ba0fff55d0e334faeba73 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -900,11 +900,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -907,11 +907,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftChatMessage.fromComponent(this.displayName);
}
@ -32,7 +32,7 @@ index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61
@Override
public boolean hasDisplayName() {
return this.displayName != null;
@@ -1078,6 +1090,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1085,6 +1097,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromComponent));
}
@ -47,7 +47,7 @@ index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61
@Override
public void setLore(List<String> lore) {
if (lore == null || lore.isEmpty()) {
@@ -1092,6 +1112,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1099,6 +1119,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -69,7 +69,7 @@ index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61
@Override
public boolean hasCustomModelData() {
return this.customModelData != null;
@@ -1763,6 +1798,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1770,6 +1805,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
for (Object object : addFrom) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Check online mode before converting and renaming player data
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 79222a04ef104bf2eed85684479384b7c350ea19..e11c8523e633d2a8e3cea7ecd54978b2958b9684 100644
index 79222a04ef104bf2eed85684479384b7c350ea19..cd013567dd6224c86c0f1813d8a3d5fb7b8cabb5 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -78,7 +78,7 @@ public class PlayerDataStorage {
@ -13,7 +13,7 @@ index 79222a04ef104bf2eed85684479384b7c350ea19..e11c8523e633d2a8e3cea7ecd54978b2
// Spigot Start
boolean usingWrongFile = false;
- if ( !file1.exists() )
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file1.exists() ) // Paper - Check online mode first
{
file1 = new File( file, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + name ).getBytes( java.nio.charset.StandardCharsets.UTF_8 ) ).toString() + s );
if ( file1.exists() )

View File

@ -151,7 +151,7 @@ index f44502a51c9fb393746e866e1a93ae9cedc2b656..dac1ff1387462b0125140a37d134d51c
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index c7eed6b642c69fb08bc6e50d4890ea61666cde01..f5689a447bb990d5e2acbb35ce3d02419f4a00e8 100644
index 9541ecd3554e5c9de02ba0fff55d0e334faeba73..fffd4e86f3bbb6ca356ab6436b26555d80f42d34 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -199,7 +199,7 @@ index c7eed6b642c69fb08bc6e50d4890ea61666cde01..f5689a447bb990d5e2acbb35ce3d0241
tag.entrySet().forEach((entry) -> {
Holder<net.minecraft.world.item.enchantment.Enchantment> id = entry.getKey();
@@ -678,13 +680,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -685,13 +687,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return modifiers;
}
@ -215,7 +215,7 @@ index c7eed6b642c69fb08bc6e50d4890ea61666cde01..f5689a447bb990d5e2acbb35ce3d0241
for (Map.Entry<?, ?> entry : ench.entrySet()) {
Enchantment enchantment = CraftEnchantment.stringToBukkit(entry.getKey().toString());
if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
@@ -1003,14 +1005,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1010,14 +1012,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public Map<Enchantment, Integer> getEnchants() {
@ -232,7 +232,7 @@ index c7eed6b642c69fb08bc6e50d4890ea61666cde01..f5689a447bb990d5e2acbb35ce3d0241
}
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
@@ -1591,7 +1593,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1598,7 +1600,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.customModelData = this.customModelData;
clone.blockData = this.blockData;
if (this.enchantments != null) {
@ -241,7 +241,7 @@ index c7eed6b642c69fb08bc6e50d4890ea61666cde01..f5689a447bb990d5e2acbb35ce3d0241
}
if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1918,4 +1920,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1925,4 +1927,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return (result != null) ? result : Optional.empty();
}

View File

@ -5,49 +5,63 @@ Subject: [PATCH] Book Size Limits
Puts some limits on the size of books.
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java
index ed61767a64cdce37dc7c226ebd0d693a60de24a9..f634a830a2b58a419e84f969bd53eeae4f4513bb 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java
@@ -16,9 +16,9 @@ public record ServerboundEditBookPacket(int slot, List<String> pages, Optional<S
public static final StreamCodec<FriendlyByteBuf, ServerboundEditBookPacket> STREAM_CODEC = StreamCodec.composite(
ByteBufCodecs.VAR_INT,
ServerboundEditBookPacket::slot,
- ByteBufCodecs.stringUtf8(8192).apply(ByteBufCodecs.list(200)),
+ ByteBufCodecs.stringUtf8(net.minecraft.world.item.component.WritableBookContent.PAGE_EDIT_LENGTH).apply(ByteBufCodecs.list(net.minecraft.world.item.component.WritableBookContent.MAX_PAGES)), // Paper - limit books
ServerboundEditBookPacket::pages,
- ByteBufCodecs.stringUtf8(128).apply(ByteBufCodecs::optional),
+ ByteBufCodecs.stringUtf8(net.minecraft.world.item.component.WrittenBookContent.TITLE_MAX_LENGTH).apply(ByteBufCodecs::optional), // Paper - limit books
ServerboundEditBookPacket::title,
ServerboundEditBookPacket::new
);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e880b41e1824f986d04a0a32cc735d77f25cf987..3b3384fcbcb66a87dd50dece6bdac558491f66f0 100644
index e880b41e1824f986d04a0a32cc735d77f25cf987..987bb9caa952a09615b0a819fc682b354be2b07c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1040,6 +1040,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1040,6 +1040,43 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
+ // Paper start - Book size limits
+ if (!this.cserver.isPrimaryThread()) {
+ List<String> pageList = packet.pages();
+ final List<String> pageList = packet.pages();
+ long byteTotal = 0;
+ int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
+ double multiplier = Math.max(0.3D, Math.min(1D, io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier));
+ final int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
+ final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
+ long byteAllowed = maxBookPageSize;
+ for (String testString : pageList) {
+ int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
+ if (byteLength > 256 * 4) {
+ ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
+ server.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ return;
+ }
+ for (final String page : pageList) {
+ final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
+ byteTotal += byteLength;
+ int length = testString.length();
+ int multibytes = 0;
+ final int length = page.length();
+ int multiByteCharacters = 0;
+ if (byteLength != length) {
+ for (char c : testString.toCharArray()) {
+ // Count the number of multi byte characters
+ for (final char c : page.toCharArray()) {
+ if (c > 127) {
+ multibytes++;
+ multiByteCharacters++;
+ }
+ }
+ }
+ byteAllowed += (maxBookPageSize * Math.min(1, Math.max(0.1D, (double) length / 255D))) * multiplier;
+
+ if (multibytes > 1) {
+ // penalize MB
+ byteAllowed -= multibytes;
+ // Allow pages with fewer characters to consume less of the allowed byte quota
+ byteAllowed += maxBookPageSize * Math.clamp((double) length / 255D, 0.1D, 1) * multiplier;
+
+ if (multiByteCharacters > 1) {
+ // Penalize multibyte characters
+ byteAllowed -= multiByteCharacters;
+ }
+ }
+
+ if (byteTotal > byteAllowed) {
+ ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
+ server.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
+ this.disconnect(Component.literal("Book too large!"));
+ return;
+ }
+ }

View File

@ -22,7 +22,7 @@ it only impacts data sent from the client.
Set -DPaper.maxSignLength=XX to change limit or -1 to disable
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 04a9c48b9a9895ffe6ec0721bdfafb1b524bf386..e728b9f317d12c3c452db70ba7d1e930c84e345d 100644
index e597a9d637a23b9fe307032a09d560ad0ebc2c4a..31f97b258ce4c80ef47596e93f7ccdece7b8dc9e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -299,6 +299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -33,7 +33,7 @@ index 04a9c48b9a9895ffe6ec0721bdfafb1b524bf386..e728b9f317d12c3c452db70ba7d1e930
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
super(server, connection, clientData, player); // CraftBukkit
@@ -3134,7 +3135,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3132,7 +3133,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent teleporting dead entities
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7277c9b82c127cd38db2daec3df4d33e8376b8dc..d0ce184da22352b591f4783918104a4c473cc873 100644
index 165ff42656c863dbddd4072da8b6227243a64a95..c6051fd059ca48ced72e9dbddf9f2f89b6862bfc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1540,6 +1540,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1538,6 +1538,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper

View File

@ -13,10 +13,10 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d0ce184da22352b591f4783918104a4c473cc873..7fab3281116aa917c96223c1a1caf6280293df65 100644
index c6051fd059ca48ced72e9dbddf9f2f89b6862bfc..669ac3cb6ab7f350fcf3e12982436a4cad7a1cc3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1355,6 +1355,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1353,6 +1353,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7fab3281116aa917c96223c1a1caf6280293df65..591f4f43dd023facf0a8990682069190c388d64b 100644
index 669ac3cb6ab7f350fcf3e12982436a4cad7a1cc3..808207eac07368e32f77032bc3c04694c56749a7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3041,16 +3041,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3039,16 +3039,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!this.player.containerMenu.stillValid(this.player)) {
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
} else {

View File

@ -63,7 +63,7 @@ index 997a96a21440ae72696d68f8031ece4ba487d3ef..3d8584929cee000ae7df10c5bd94f358
return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
}, true);
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 3d33504eac6af17c8833de11226968d52f96232f..4d7c2832a9cd9a88b99c837a02df7fa91e572658 100644
index 539a8ddfcf660bf824325516c88cf91f4a32a746..1bc8217cf1df95edadd57e18a91885808d31cb93 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -346,7 +346,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -89,10 +89,10 @@ index bf6c81300d29c445a1012d1159866547c202d135..e6a24484ef11a1d815a85126aec22154
playerlist.sendPlayerPermissionLevel(this);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 299a2e78f4a83d224038c80287636a5d6b9b7450..95d20facdc43a356fd2e82f5d597f52ee61791dc 100644
index c265889aa577c87706d658145954e95e0dc2a713..856f91450e746ff4d8b1105db6e87c8d8aa8168a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3244,7 +3244,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3242,7 +3242,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockStateMeta#clearBlockState
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
index a72a3ea995a874150325189e11dc2bd338bd3bbf..9034905aabf057f387b65957a254d056b12e0519 100644
index 70fb5ce3cf57f8f55715f5aa18885756a7a512e7..a433e41ee3728310c63180d8c80190f9f0454fa1 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java
@@ -292,6 +292,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
@@ -294,6 +294,13 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
return this.blockEntityTag != null;
}

View File

@ -30,10 +30,10 @@ index de40e522960469b98f987bd688489740446d9f85..5678d2007d5adf45dec0638c5dd848b6
public CraftAttributeMap(AttributeMap handle) {
this.handle = handle;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index f5689a447bb990d5e2acbb35ce3d02419f4a00e8..ce6767537bd0f8eb5c28eef9d50e042c5a9b4b4b 100644
index fffd4e86f3bbb6ca356ab6436b26555d80f42d34..40093f20f9c9e332caf197d9b626ba2105ed4098 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -644,7 +644,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -651,7 +651,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Do not accept invalid client settings
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 95d20facdc43a356fd2e82f5d597f52ee61791dc..bc9c68c4df11ece9a9cba9b8cff1182c1d21551f 100644
index 856f91450e746ff4d8b1105db6e87c8d8aa8168a..1e4146a200617dda795fdf4922d61d09526b4f8b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3236,6 +3236,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3234,6 +3234,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -9,7 +9,7 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index bc9c68c4df11ece9a9cba9b8cff1182c1d21551f..5d8b1fb9ee96ca397b8f3a0629bc4273ee21f41c 100644
index 1e4146a200617dda795fdf4922d61d09526b4f8b..965e4843e4f7ef013420669f67a85f0a46c3d4c9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -676,7 +676,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -21,7 +21,7 @@ index bc9c68c4df11ece9a9cba9b8cff1182c1d21551f..5d8b1fb9ee96ca397b8f3a0629bc4273
this.lastGoodX = this.awaitingPositionFromClient.x;
this.lastGoodY = this.awaitingPositionFromClient.y;
this.lastGoodZ = this.awaitingPositionFromClient.z;
@@ -1583,7 +1583,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1581,7 +1581,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.awaitingTeleportTime = this.tickCount;
this.player.resetCurrentImpulseContext();
@ -31,7 +31,7 @@ index bc9c68c4df11ece9a9cba9b8cff1182c1d21551f..5d8b1fb9ee96ca397b8f3a0629bc4273
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 184d8bdca8aa06b6a1f00bab03e8c2688a391663..0b98618cb0b0e9c4b13415ab0e535cdfbd55b224 100644
index 084824335dc4c83d331cac2da8fdd5604d650b5d..f66c382a1365f559c833cbfd70f8b6db34e8133a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -165,6 +165,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server
Check movement distance also based on current position.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5d8b1fb9ee96ca397b8f3a0629bc4273ee21f41c..a1f17d1044d6ecb05c98af45e77f92229e377114 100644
index 965e4843e4f7ef013420669f67a85f0a46c3d4c9..b0b48b9156ce3289f69b90e60b5aac6be6125303 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -492,9 +492,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -53,7 +53,7 @@ index 5d8b1fb9ee96ca397b8f3a0629bc4273ee21f41c..a1f17d1044d6ecb05c98af45e77f9222
boolean flag1 = entity.verticalCollisionBelow;
if (entity instanceof LivingEntity) {
@@ -1259,7 +1268,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1257,7 +1266,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d7 = d1 - this.firstGoodY;
double d8 = d2 - this.firstGoodZ;
double d9 = this.player.getDeltaMovement().lengthSqr();
@ -71,7 +71,7 @@ index 5d8b1fb9ee96ca397b8f3a0629bc4273ee21f41c..a1f17d1044d6ecb05c98af45e77f9222
if (this.player.isSleeping()) {
if (d10 > 1.0D) {
@@ -1315,9 +1333,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1313,9 +1331,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
AABB axisalignedbb = this.player.getBoundingBox();

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a1f17d1044d6ecb05c98af45e77f92229e377114..35c8aa3971de05be66acd49b6a0b76cba59f93ac 100644
index b0b48b9156ce3289f69b90e60b5aac6be6125303..b69292473c2c7dc87d11e01cbbd6c9efe6654544 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -24,7 +24,7 @@ index a1f17d1044d6ecb05c98af45e77f92229e377114..35c8aa3971de05be66acd49b6a0b76cb
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
@@ -3053,6 +3055,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3051,6 +3053,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {

View File

@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes
Co-authored-by: Moulberry <james.jenour@protonmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 35c8aa3971de05be66acd49b6a0b76cba59f93ac..362bd15dc359762095bdc5120a25460227a0175e 100644
index b69292473c2c7dc87d11e01cbbd6c9efe6654544..fb3acbce31d59b9d7e17cd529e438d7479824142 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1759,7 +1759,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1757,7 +1757,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED);
this.player.sendSystemMessage(ichatmutablecomponent, true);
@ -23,7 +23,7 @@ index 35c8aa3971de05be66acd49b6a0b76cba59f93ac..362bd15dc359762095bdc5120a254602
this.player.swing(enumhand, true);
}
}
@@ -2375,13 +2375,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2373,13 +2373,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d3 = this.player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D;
// SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time
// SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 362bd15dc359762095bdc5120a25460227a0175e..55c311ddc8add7d5838d112bc3a71baeb52356a8 100644
index fb3acbce31d59b9d7e17cd529e438d7479824142..878244184f626650a8ea65ea9a0f5aeb7183862d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1747,8 +1747,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1745,8 +1745,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int i = this.player.level().getMaxBuildHeight();
if (blockposition.getY() < i) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 55c311ddc8add7d5838d112bc3a71baeb52356a8..cf53e6270ef3cdd3baa251e813eeb3526919bbcc 100644
index 878244184f626650a8ea65ea9a0f5aeb7183862d..2046b98a16eaef61a3fb4e0a43bc485b1d76d7cd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1152,7 +1152,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1150,7 +1150,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
List<Filterable<String>> list1 = pages.stream().map(this::filterableFromOutgoing).toList();
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));

View File

@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cf53e6270ef3cdd3baa251e813eeb3526919bbcc..22da7f7c4b033d31b7a71878e34562a4370a4bd4 100644
index 2046b98a16eaef61a3fb4e0a43bc485b1d76d7cd..243e06053e18410fbae2a76b2f8585394ebd02f3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1917,6 +1917,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1915,6 +1915,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.isImmobile()) return; // CraftBukkit
if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 22da7f7c4b033d31b7a71878e34562a4370a4bd4..c8124bf451f5d03374f32a04b9b28fc9d97897ae 100644
index 243e06053e18410fbae2a76b2f8585394ebd02f3..1cf451689cc2e197ebf89f799f986dc2db53f6c3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2706,7 +2706,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2704,7 +2704,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
case PERFORM_RESPAWN:
if (this.player.wonGame) {
this.player.wonGame = false;

View File

@ -132,10 +132,10 @@ index de3ec353ea32d5d71e2f1b4b369b79b85d7ce5e8..c55d944a70300bf77dbde918c91815ca
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c8124bf451f5d03374f32a04b9b28fc9d97897ae..4a5553335cd6bbad8d3a05694710d95c96f62b9d 100644
index 1cf451689cc2e197ebf89f799f986dc2db53f6c3..2aeff021e37e0105e602310cb0bc4a7f4c68017c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2715,7 +2715,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2713,7 +2713,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH);
if (this.server.isHardcore()) {
@ -145,7 +145,7 @@ index c8124bf451f5d03374f32a04b9b28fc9d97897ae..4a5553335cd6bbad8d3a05694710d95c
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 330e9c37c889b1573520090173401a0615d19592..8d78d5ecd17dcd56056f5bade6f047e30187ee2f 100644
index 2d6de1734cb715554ca732d850b8df9591a3efb7..9a3ba0011f306a3cd1e3c60fcc329ab93011ebd8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1640,7 +1640,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

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

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add Unix domain socket support
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 5d62639b18d0bf8f5f7c8adc3470a6087980241b..4bc7b3d7c5214b3272614fe3fce8e4d8d2264867 100644
index c0261c3cd6de850edbd197272c2d1c52f76e6ebe..b8043b7e778792153620923ea228c1a211c27969 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -232,6 +232,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -87,10 +87,10 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a04c7677ded862890e6e809db610817b4cfff56a..f4c6e815253f3e49577c554bf632e5c9f4f578ff 100644
index 886bb4ea3fca0b4c815b21a025d48b1e3363bf00..eeb30a6e015dc16553248701e12db2820a70a1aa 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2534,6 +2534,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2532,6 +2532,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
public SocketAddress getRawAddress()
{

View File

@ -43,7 +43,7 @@ index dbcf183483766f39334d7f7e8336033906625f3f..300929a406905f5ff1ede664d5b99fb0
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7353beeea3f1e02d62a4d2456124edcf723371f3..2986dc458ddbd642669c6c2c104df2a2446e5b11 100644
index 5c47573843c25b0d15037a28e55b616c829f694d..cdbdacee826c424177096ee78427eaf80131b5fd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2266,7 +2266,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -222,7 +222,7 @@ index 661765a9fe1c2e49299262190501ee3b3294a2f1..7659a3f50f5a90814dc7331ea00d6251
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9dd60bdca 100644
index eeb30a6e015dc16553248701e12db2820a70a1aa..eb13c0e8feb4a6933ae6063a2208b694cf29a342 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -288,21 +288,12 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return;
}
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
@@ -1085,7 +1085,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
- server.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
return;
}
byteTotal += byteLength;
@@ -1108,14 +1108,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1106,14 +1106,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
- server.scheduleOnMain(() -> this.disconnect("Book too large!"));
+ server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
- this.disconnect(Component.literal("Book too large!"));
+ this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
}
}
@ -314,7 +305,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return;
}
this.lastBookTick = MinecraftServer.currentTick;
@@ -1227,7 +1227,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1225,7 +1225,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
@ -323,7 +314,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} else {
ServerLevel worldserver = this.player.serverLevel();
@@ -1656,7 +1656,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1654,7 +1654,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
@ -332,7 +323,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return;
}
}
@@ -1939,7 +1939,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1937,7 +1937,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime();
} else {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -341,7 +332,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
}
}
@@ -2137,7 +2137,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2135,7 +2135,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit
if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) {
@ -350,7 +341,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
} else {
@@ -2160,7 +2160,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2158,7 +2158,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (optional.isEmpty()) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -359,7 +350,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
}
return optional;
@@ -2346,7 +2346,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2344,7 +2344,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
// CraftBukkit end
@ -368,7 +359,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
}
}
@@ -2358,7 +2358,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2356,7 +2356,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -377,7 +368,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
}
}
@@ -2506,7 +2506,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2504,7 +2504,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
if (i > 4096) {
@ -386,7 +377,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
}
}
@@ -2564,7 +2564,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2562,7 +2562,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@ -395,7 +386,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return;
}
// Spigot End
@@ -2678,7 +2678,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2676,7 +2676,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
@ -404,7 +395,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
});
@@ -3075,7 +3075,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3073,7 +3073,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - auto recipe limit
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -413,7 +404,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
return;
}
}
@@ -3317,7 +3317,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3315,7 +3315,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) {
if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) {
@ -422,7 +413,7 @@ index f4c6e815253f3e49577c554bf632e5c9f4f578ff..1f6e123fbd146129e5460631fdd88de9
} else {
try {
SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator();
@@ -3330,7 +3330,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3328,7 +3328,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
} catch (ProfilePublicKey.ValidationException profilepublickey_b) {
ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage());
@ -486,7 +477,7 @@ index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66c
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8d78d5ecd17dcd56056f5bade6f047e30187ee2f..6c759f6860c7eccb634c1c0cda6d8e24196023d1 100644
index 9a3ba0011f306a3cd1e3c60fcc329ab93011ebd8..eee0c49bbf9bc768fcf7275c29536b4f16b1d421 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -633,7 +633,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 22 Jun 2021 19:58:53 +0100
Subject: [PATCH] Ensure disconnect for book edit is called on main
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1f6e123fbd146129e5460631fdd88de9dd60bdca..66d6bd361edfb04eeed4076feb20cb8861d48874 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1115,7 +1115,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper end - Book size limits
// CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
- this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
+ server.scheduleOnMain(() -> this.disconnect("Book edited too quickly!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause // Paper - Also ensure this is called on main
return;
}
this.lastBookTick = MinecraftServer.currentTick;

View File

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

View File

@ -50,10 +50,10 @@ index 7659a3f50f5a90814dc7331ea00d6251dcf32600..308aef9c4933b2bcdd622a34b68efab4
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dd3767f482929d7d8105a4164c27651099935a89..5ba7340d3860975b826dc878385e0879a9f07957 100644
index 5544ba7a5f61f24d081373f56f82e4ef0ef1f3f0..2722d22a9204554c1b52aa853b50f1ce285f3833 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1878,6 +1878,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1876,6 +1876,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void onDisconnect(Component reason) {
@ -66,7 +66,7 @@ index dd3767f482929d7d8105a4164c27651099935a89..5ba7340d3860975b826dc878385e0879
// CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) {
return;
@@ -1886,11 +1892,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1884,11 +1890,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString());
@ -86,7 +86,7 @@ index dd3767f482929d7d8105a4164c27651099935a89..5ba7340d3860975b826dc878385e0879
this.chatMessageChain.close();
// CraftBukkit start - Replace vanilla quit message handling with our own.
/*
@@ -1900,7 +1912,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1898,7 +1910,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.disconnect();
// Paper start - Adventure

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent AFK kick while watching end credits
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5ba7340d3860975b826dc878385e0879a9f07957..40d2c7bfc8ba8b8b366f23e53cf37f331e19ccf7 100644
index 2722d22a9204554c1b52aa853b50f1ce285f3833..2da768a99617379a0f74c61303e1ca0bd4b12f6f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -397,7 +397,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -187,7 +187,7 @@ index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6c759f6860c7eccb634c1c0cda6d8e24196023d1..bb75c965266fefa58919823e5fcc9f56f11b04d0 100644
index eee0c49bbf9bc768fcf7275c29536b4f16b1d421..634da85870b31a9fc09d53f5670239e18bcb3d47 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1399,9 +1399,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Make hoppers respect inventory max stack size
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index dfb57192105d5e05e4c2e32da5eadb7c701a763a..92086ca118d55ec49cefa5bf18977f8706e3e4b4 100644
index 1c8a08e317591413426285874de74f4de54efa07..542a5501ac94f57810d34e0f769a9a7855604f91 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -485,15 +485,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
@@ -495,15 +495,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
if (itemstack1.isEmpty()) {
// Spigot start - SPIGOT-6693, InventorySubcontainer#setItem

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityDamageItemEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index b4cb9ff5553995dddfb99b6b3ac1250b92a65d9d..2947a43a1d9e49273ed0242691273e50c657cd05 100644
index e5fbb6dac3b1869797f2141e82993374a9f18e94..1b062edcc04af4c500f38c1664b5cee25e265f3c 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -647,7 +647,7 @@ public final class ItemStack implements DataComponentHolder {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Optimize indirect passenger iteration
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 318d0f557d50b74c44b2fd1ac84e12bf30e75c24..325d8551d4f6c1d24525fab607769a75320cf436 100644
index b4670fc653721283f95bb61ac57c306b224b7fb7..56de24f923571aff124ae64b737cbdf482d4b847 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3875,20 +3875,34 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add back EntityPortalExitEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 325d8551d4f6c1d24525fab607769a75320cf436..2d98bdae7e8686d8a15e8938a16d8d63f0575bef 100644
index 56de24f923571aff124ae64b737cbdf482d4b847..5d4fa3823a6dbb6150e4b97cf3973eb254018e38 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3312,6 +3312,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@ -59,7 +59,7 @@ index 56f7a753d2167504b6d91219093097323a9081c5..07afb966626d86b065e138959e9ffcac
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 49dc01532f9b60b3f594abca56b7d807fe6716d5..427e889f58c86f7649fc1b661d55277599b320c0 100644
index 9ebde3788437ba830973ad619bb549dfac1103e4..723ea3c0a9b69157362f229891567c37b1dd6f3b 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -392,6 +392,7 @@ public abstract class AbstractArrow extends Projectile {

View File

@ -33,7 +33,7 @@ index 899008b2980d13f1be6280cd8cb959c53a29bebf..d5f7da3502575f6847f3c22ab0e94284
private RedirectModifier<S> modifier = null;
private boolean forks;
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 3728b051b9eb9e9e06bc765a9a2fae7f45daf6ff..779fee2f9b819124a01b9f8d2b7ed0d5f2accf6c 100644
index 47792f65cb70a12fca3688900b93011a0ace6ba2..1b5797dc9b94952faa4cef885207e60b5216eb45 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -258,6 +258,13 @@ public class Commands {

View File

@ -51,7 +51,7 @@ index b90b525faa5bba684c783a56f136532a8195de84..5a13975fc9a472308ee74401f7b1f84f
@Override
public void doCloseContainer() {
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 f18e370399fb36040cec64dd7bee4915e3cb56d7..461129261d93ca9831f347c9612c6f38cbbd8ac9 100644
index 07afb966626d86b065e138959e9ffcac27a0d5d2..9f3d1a5407635d740adb6722930c94781a021015 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -509,6 +509,11 @@ public abstract class Player extends LivingEntity {

View File

@ -17,10 +17,10 @@ Async catch modifications to critical entity state
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 40d2c7bfc8ba8b8b366f23e53cf37f331e19ccf7..795e65c7c98d50ff67953ccb1ff68dac0088116e 100644
index 2da768a99617379a0f74c61303e1ca0bd4b12f6f..d3a5b273d5251a685a76c6168dc34df64f611fd7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1565,6 +1565,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1563,6 +1563,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper

View File

@ -10,7 +10,7 @@ Also has a hover text on each mob category listing what entity types are
in said category
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index 27775df10a490ff75ca377e8373931738f1b817c..c9bb2df0d884227576ed8d2e72219bbbd7ba827e 100644
index cdad0fd5257ae842f83b9c1c98b4565b468d4f54..fd4f37711989431f997d77fb0917f8a9232ce53f 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -40,6 +40,7 @@ public final class PaperCommand extends Command {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 795e65c7c98d50ff67953ccb1ff68dac0088116e..4ac3e9cacc3c54a67da1547a319fd501ff375354 100644
index d3a5b273d5251a685a76c6168dc34df64f611fd7..3567ddb66adc5abac67a41208fe55931ea56742a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -745,6 +745,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -8,7 +8,7 @@ This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 96c9feb545c02014c324852344a1d86156c32237..df7741ca931d7d1eb1b0cbdcc2b2bb15875c750c 100644
index ebacae6f39fea052f4fb7c60f7164763b49f8148..0034e06a3caa89dfbb24a75d377d799ca0e8aed0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1813,6 +1813,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@ -13,7 +13,7 @@ the material type of the block at that location.
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 6e24673a793017ee857cf75bf9a74105ce76b773..e3c5f99b3ad91a9bb454f9ab95b1ccff0bb7b34c 100644
index 7147484eefad44ba67db03b6ef2090a596e278de..6f6693456cf518b7bd9eb21ba681540a40c588ef 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -371,7 +371,7 @@ public abstract class BlockEntity {

View File

@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..68098dfe716e93aafcca4d8d5b5a81d8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 4bc7b3d7c5214b3272614fe3fce8e4d8d2264867..784788d8d3d1a07efbd406b6c463e046699081e2 100644
index b8043b7e778792153620923ea228c1a211c27969..bbbadf5284907531eef761a738c3adf5305bd08f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -192,6 +192,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

View File

@ -5,7 +5,7 @@ Subject: [PATCH] don't attempt to teleport dead entities
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index df7741ca931d7d1eb1b0cbdcc2b2bb15875c750c..50aca89516dea3f4c4d668b994f4afdea69b4cc9 100644
index 0034e06a3caa89dfbb24a75d377d799ca0e8aed0..7966d45adcbc239a506ab4aa2923a6df0dc36c03 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -730,7 +730,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

Some files were not shown because too many files have changed in this diff Show More