From ebedfa4da72e79c2126cd19b13c10015da87f6b7 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 23 Apr 2024 22:43:09 -0700 Subject: [PATCH] 301 --- .../server/Add-Heightmap-API.patch | 0 .../Add-LivingEntity-getTargetEntity.patch | 0 .../Add-PlayerConnectionCloseEvent.patch | 2 +- .../server/Add-PlayerPostRespawnEvent.patch | 0 .../server/Add-more-Witch-API.patch | 10 +-- .../server/Add-more-Zombie-API.patch | 0 ...event-players-from-moving-into-unloa.patch | 4 +- .../server/Add-sun-related-API.patch | 0 .../server/Async-command-map-building.patch | 0 .../server/BlockDestroyEvent.patch | 2 +- .../server/Book-Size-Limits.patch | 0 .../server/Brigadier-Mojang-API.patch | 16 +++-- ...oggleEvent-when-whitelist-is-toggled.patch | 0 ...tator-target-events-and-improve-impl.patch | 0 ...xception-in-entity-and-block-entity-.patch | 63 +++++++++++-------- ...owned-for-Villager-Aggression-Config.patch | 0 ...ble-connection-throttle-kick-message.patch | 14 ++--- ...t-allow-digging-into-unloaded-chunks.patch | 2 +- ...-after-profile-lookups-if-not-needed.patch | 0 ...r-remove-if-the-handle-is-a-custom-p.patch | 0 .../server/Entity-getEntitySpawnReason.patch | 18 +++--- .../server/Fire-event-on-GS4-query.patch | 0 ...l-to-changed-postToMainThread-method.patch | 0 .../Fix-SpongeAbsortEvent-handling.patch | 0 ...n-item-frames-are-modified-MC-123450.patch | 0 .../server/Honor-EntityAgeable.ageLock.patch | 24 +++---- .../Implement-CraftBlockSoundGroup.patch | 0 ...nt-furnace-cook-speed-multiplier-API.patch | 12 ++-- ...er-Thread-Pool-and-Thread-Priorities.patch | 0 ...rove-exact-choice-recipe-ingredients.patch | 24 +++---- .../Limit-Client-Sign-length-more.patch | 0 ...ault-permission-message-configurable.patch | 0 .../server/Mob-Spawner-API-Enhancements.patch | 4 +- ...Optimize-Captured-BlockEntity-Lookup.patch | 0 .../server/Optimize-World-Time-Updates.patch | 0 .../PlayerDeathEvent-getItemsToKeep.patch | 0 .../server/PreSpawnerSpawnEvent.patch | 0 ...ent-chunk-loading-from-Fluid-Flowing.patch | 0 ...wning-from-loading-generating-chunks.patch | 0 ...interactions-from-causing-chunk-load.patch | 24 +++---- .../Replace-OfflinePlayer-getLastPlayed.patch | 2 +- .../Reset-players-airTicks-on-respawn.patch | 0 ...store-custom-InventoryHolder-support.patch | 6 +- .../server/Server-Tick-Events.patch | 0 .../{unapplied => }/server/Turtle-API.patch | 2 +- ...vehicle-tracking-issue-on-disconnect.patch | 0 ...-for-pickupDelay-breaks-picking-up-i.patch | 0 ...entity-dismount-during-teleportation.patch | 8 +-- ...CanPlaceOn-and-CanDestroy-NBT-values.patch | 0 ...e-Large-Packets-disconnecting-client.patch | 0 ...le-Keep-Spawn-Loaded-range-per-world.patch | 0 51 files changed, 130 insertions(+), 107 deletions(-) rename patches/{unapplied => }/server/Add-Heightmap-API.patch (100%) rename patches/{unapplied => }/server/Add-LivingEntity-getTargetEntity.patch (100%) rename patches/{unapplied => }/server/Add-PlayerConnectionCloseEvent.patch (99%) rename patches/{unapplied => }/server/Add-PlayerPostRespawnEvent.patch (100%) rename patches/{unapplied => }/server/Add-more-Witch-API.patch (91%) rename patches/{unapplied => }/server/Add-more-Zombie-API.patch (100%) rename patches/{unapplied => }/server/Add-option-to-prevent-players-from-moving-into-unloa.patch (96%) rename patches/{unapplied => }/server/Add-sun-related-API.patch (100%) rename patches/{unapplied => }/server/Async-command-map-building.patch (100%) rename patches/{unapplied => }/server/BlockDestroyEvent.patch (97%) rename patches/{unapplied => }/server/Book-Size-Limits.patch (100%) rename patches/{unapplied => }/server/Brigadier-Mojang-API.patch (93%) rename patches/{unapplied => }/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch (100%) rename patches/{unapplied => }/server/Call-player-spectator-target-events-and-improve-impl.patch (100%) rename patches/{unapplied => }/server/Catch-JsonParseException-in-entity-and-block-entity-.patch (65%) rename patches/{unapplied => }/server/Check-Drowned-for-Villager-Aggression-Config.patch (100%) rename patches/{unapplied => }/server/Configurable-connection-throttle-kick-message.patch (56%) rename patches/{unapplied => }/server/Don-t-allow-digging-into-unloaded-chunks.patch (97%) rename patches/{unapplied => }/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch (100%) rename patches/{unapplied => }/server/Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch (100%) rename patches/{unapplied => }/server/Entity-getEntitySpawnReason.patch (92%) rename patches/{unapplied => }/server/Fire-event-on-GS4-query.patch (100%) rename patches/{unapplied => }/server/Fix-CB-call-to-changed-postToMainThread-method.patch (100%) rename patches/{unapplied => }/server/Fix-SpongeAbsortEvent-handling.patch (100%) rename patches/{unapplied => }/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch (100%) rename patches/{unapplied => }/server/Honor-EntityAgeable.ageLock.patch (78%) rename patches/{unapplied => }/server/Implement-CraftBlockSoundGroup.patch (100%) rename patches/{unapplied => }/server/Implement-furnace-cook-speed-multiplier-API.patch (95%) rename patches/{unapplied => }/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch (100%) rename patches/{unapplied => }/server/Improve-exact-choice-recipe-ingredients.patch (94%) rename patches/{unapplied => }/server/Limit-Client-Sign-length-more.patch (100%) rename patches/{unapplied => }/server/Make-the-default-permission-message-configurable.patch (100%) rename patches/{unapplied => }/server/Mob-Spawner-API-Enhancements.patch (96%) rename patches/{unapplied => }/server/Optimize-Captured-BlockEntity-Lookup.patch (100%) rename patches/{unapplied => }/server/Optimize-World-Time-Updates.patch (100%) rename patches/{unapplied => }/server/PlayerDeathEvent-getItemsToKeep.patch (100%) rename patches/{unapplied => }/server/PreSpawnerSpawnEvent.patch (100%) rename patches/{unapplied => }/server/Prevent-chunk-loading-from-Fluid-Flowing.patch (100%) rename patches/{unapplied => }/server/Prevent-mob-spawning-from-loading-generating-chunks.patch (100%) rename patches/{unapplied => }/server/Prevent-various-interactions-from-causing-chunk-load.patch (85%) rename patches/{unapplied => }/server/Replace-OfflinePlayer-getLastPlayed.patch (99%) rename patches/{unapplied => }/server/Reset-players-airTicks-on-respawn.patch (100%) rename patches/{unapplied => }/server/Restore-custom-InventoryHolder-support.patch (97%) rename patches/{unapplied => }/server/Server-Tick-Events.patch (100%) rename patches/{unapplied => }/server/Turtle-API.patch (97%) rename patches/{unapplied => }/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch (100%) rename patches/{unapplied => }/server/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch (100%) rename patches/{unapplied => }/server/force-entity-dismount-during-teleportation.patch (93%) rename patches/unapplied/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch => removed-patches-1-20-5/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch (100%) rename patches/unapplied/server/Handle-Large-Packets-disconnecting-client.patch => removed-patches-1-20-5/0284-Handle-Large-Packets-disconnecting-client.patch (100%) rename patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch => removed-patches-1-20-5/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch (100%) diff --git a/patches/unapplied/server/Add-Heightmap-API.patch b/patches/server/Add-Heightmap-API.patch similarity index 100% rename from patches/unapplied/server/Add-Heightmap-API.patch rename to patches/server/Add-Heightmap-API.patch diff --git a/patches/unapplied/server/Add-LivingEntity-getTargetEntity.patch b/patches/server/Add-LivingEntity-getTargetEntity.patch similarity index 100% rename from patches/unapplied/server/Add-LivingEntity-getTargetEntity.patch rename to patches/server/Add-LivingEntity-getTargetEntity.patch diff --git a/patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch b/patches/server/Add-PlayerConnectionCloseEvent.patch similarity index 99% rename from patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch rename to patches/server/Add-PlayerConnectionCloseEvent.patch index 079953370a..10336132a2 100644 --- a/patches/unapplied/server/Add-PlayerConnectionCloseEvent.patch +++ b/patches/server/Add-PlayerConnectionCloseEvent.patch @@ -79,5 +79,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private GameProfile authenticatedProfile; + public GameProfile authenticatedProfile; // Paper - public private final String serverId; + private final boolean transferred; private ServerPlayer player; // CraftBukkit - diff --git a/patches/unapplied/server/Add-PlayerPostRespawnEvent.patch b/patches/server/Add-PlayerPostRespawnEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerPostRespawnEvent.patch rename to patches/server/Add-PlayerPostRespawnEvent.patch diff --git a/patches/unapplied/server/Add-more-Witch-API.patch b/patches/server/Add-more-Witch-API.patch similarity index 91% rename from patches/unapplied/server/Add-more-Witch-API.patch rename to patches/server/Add-more-Witch-API.patch index fc04dac012..718280d749 100644 --- a/patches/unapplied/server/Add-more-Witch-API.patch +++ b/patches/server/Add-more-Witch-API.patch @@ -13,9 +13,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class Witch extends Raider implements RangedAttackMob { } - if (potionregistry != null) { + if (holder != null) { - // Paper start -- ItemStack potion = PotionUtils.setPotion(new ItemStack(Items.POTION), potionregistry); +- ItemStack potion = PotionContents.createItemStack(Items.POTION, holder); - potion = org.bukkit.craftbukkit.event.CraftEventFactory.handleWitchReadyPotionEvent(this, potion); - this.setItemSlot(EquipmentSlot.MAINHAND, potion); - // Paper end @@ -27,9 +27,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); - -- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); +- attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.id()); - attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); -+ this.setDrinkingPotion(PotionUtils.setPotion(new ItemStack(Items.POTION), potionregistry)); // Paper - logic moved into setDrinkingPotion, copy exact impl into the method and then comment out ++ this.setDrinkingPotion(PotionContents.createItemStack(Items.POTION, holder)); // Paper - logic moved into setDrinkingPotion, copy exact impl into the method and then comment out } } @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + -+ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.getId()); ++ attributemodifiable.removeModifier(Witch.SPEED_MODIFIER_DRINKING.id()); + attributemodifiable.addTransientModifier(Witch.SPEED_MODIFIER_DRINKING); + } + // Paper end diff --git a/patches/unapplied/server/Add-more-Zombie-API.patch b/patches/server/Add-more-Zombie-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Zombie-API.patch rename to patches/server/Add-more-Zombie-API.patch diff --git a/patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 96% rename from patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch rename to patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch index c67a861eb6..b4260b34c1 100644 --- a/patches/unapplied/server/Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -63,5 +63,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - Prevent moving into unloaded chunks - if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) { - float f2 = this.player.isFallFlying() ? 300.0F : 100.0F; + if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !flag)) { + float f2 = flag ? 300.0F : 100.0F; diff --git a/patches/unapplied/server/Add-sun-related-API.patch b/patches/server/Add-sun-related-API.patch similarity index 100% rename from patches/unapplied/server/Add-sun-related-API.patch rename to patches/server/Add-sun-related-API.patch diff --git a/patches/unapplied/server/Async-command-map-building.patch b/patches/server/Async-command-map-building.patch similarity index 100% rename from patches/unapplied/server/Async-command-map-building.patch rename to patches/server/Async-command-map-building.patch diff --git a/patches/unapplied/server/BlockDestroyEvent.patch b/patches/server/BlockDestroyEvent.patch similarity index 97% rename from patches/unapplied/server/BlockDestroyEvent.patch rename to patches/server/BlockDestroyEvent.patch index 25b5a13cef..1ac393dd6e 100644 --- a/patches/unapplied/server/BlockDestroyEvent.patch +++ b/patches/server/BlockDestroyEvent.patch @@ -14,7 +14,7 @@ diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -0,0 +0,0 @@ import net.minecraft.nbt.CompoundTag; +@@ -0,0 +0,0 @@ import net.minecraft.core.registries.Registries; import net.minecraft.network.protocol.Packet; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; diff --git a/patches/unapplied/server/Book-Size-Limits.patch b/patches/server/Book-Size-Limits.patch similarity index 100% rename from patches/unapplied/server/Book-Size-Limits.patch rename to patches/server/Book-Size-Limits.patch diff --git a/patches/unapplied/server/Brigadier-Mojang-API.patch b/patches/server/Brigadier-Mojang-API.patch similarity index 93% rename from patches/unapplied/server/Brigadier-Mojang-API.patch rename to patches/server/Brigadier-Mojang-API.patch index e058995cd1..066ae5f6de 100644 --- a/patches/unapplied/server/Brigadier-Mojang-API.patch +++ b/patches/server/Brigadier-Mojang-API.patch @@ -144,23 +144,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, packet.getCommand()); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (suggestEvent.callEvent()) { -+ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); ++ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), limitTo(suggestEvent.getSuggestions(), ServerGamePacketListenerImpl.MAX_COMMAND_SUGGESTIONS))); + } + // Paper end - Brigadier API } } ++ // Paper start - brig API ++ private static Suggestions limitTo(final Suggestions suggestions, final int size) { ++ return suggestions.getList().size() <= size ? suggestions : new Suggestions(suggestions.getRange(), suggestions.getList().subList(0, size)); ++ } ++ // Paper end - brig API -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + private void sendServerSuggestions(final ServerboundCommandSuggestionPacket packet, final StringReader stringreader) { + // Paper end - AsyncTabCompleteEvent ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { - if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer -- this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); +- Suggestions suggestions1 = suggestions.getList().size() <= 1000 ? suggestions : new Suggestions(suggestions.getRange(), suggestions.getList().subList(0, 1000)); +- +- this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions1)); + // Paper start - Brigadier API + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, packet.getCommand()); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (suggestEvent.callEvent()) { -+ this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); ++ this.send(new ClientboundCommandSuggestionsPacket(packet.getId(), limitTo(suggestEvent.getSuggestions(), ServerGamePacketListenerImpl.MAX_COMMAND_SUGGESTIONS))); + } + // Paper end - Brigadier API }); diff --git a/patches/unapplied/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 100% rename from patches/unapplied/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to patches/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch diff --git a/patches/unapplied/server/Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/Call-player-spectator-target-events-and-improve-impl.patch similarity index 100% rename from patches/unapplied/server/Call-player-spectator-target-events-and-improve-impl.patch rename to patches/server/Call-player-spectator-target-events-and-improve-impl.patch diff --git a/patches/unapplied/server/Catch-JsonParseException-in-entity-and-block-entity-.patch b/patches/server/Catch-JsonParseException-in-entity-and-block-entity-.patch similarity index 65% rename from patches/unapplied/server/Catch-JsonParseException-in-entity-and-block-entity-.patch rename to patches/server/Catch-JsonParseException-in-entity-and-block-entity-.patch index ce67932c52..45916defee 100644 --- a/patches/unapplied/server/Catch-JsonParseException-in-entity-and-block-entity-.patch +++ b/patches/server/Catch-JsonParseException-in-entity-and-block-entity-.patch @@ -22,13 +22,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + + @Nullable -+ public static net.minecraft.network.chat.Component getBaseComponentFromNbt(String key, net.minecraft.nbt.CompoundTag compound) { ++ public static net.minecraft.network.chat.Component getBaseComponentFromNbt(final String key, final net.minecraft.nbt.CompoundTag compound, final net.minecraft.core.HolderLookup.Provider lookupProvider) { + if (!compound.contains(key)) { + return null; + } -+ String string = compound.getString(key); ++ final String string = compound.getString(key); + try { -+ return net.minecraft.network.chat.Component.Serializer.fromJson(string); ++ return net.minecraft.network.chat.Component.Serializer.fromJson(string, lookupProvider); + } catch (com.google.gson.JsonParseException e) { + org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); + } @@ -44,34 +44,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.command = nbt.getString("Command"); this.successCount = nbt.getInt("SuccessCount"); if (nbt.contains("CustomName", 8)) { -- this.setName(Component.Serializer.fromJson(nbt.getString("CustomName"))); -+ this.setName(io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt)); // Paper - Catch ParseException +- this.setCustomName(Component.Serializer.fromJson(nbt.getString("CustomName"), registries)); ++ this.setCustomName(io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registries)); // Paper - Catch ParseException + } else { + this.setCustomName((Component) null); } - - 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java @@ -0,0 +0,0 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { - public void load(CompoundTag nbt) { - super.load(nbt); + protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) { + super.loadAdditional(nbt, registryLookup); if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } - this.itemPatterns = nbt.getList("Patterns", 10); + if (nbt.contains("patterns")) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java @@ -0,0 +0,0 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co - super.load(nbt); + super.loadAdditional(nbt, registryLookup); this.lockKey = LockCode.fromTag(nbt); if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } } @@ -83,21 +83,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.secondaryPower = BeaconBlockEntity.loadEffect(nbt, "secondary_effect"); this.levels = nbt.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } this.lockKey = LockCode.fromTag(nbt); -diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java +diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java -@@ -0,0 +0,0 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable - public void load(CompoundTag nbt) { - super.load(nbt); +--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java +@@ -0,0 +0,0 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable + protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) { + super.loadAdditional(nbt, registryLookup); if (nbt.contains("CustomName", 8)) { -- this.name = Component.Serializer.fromJson(nbt.getString("CustomName")); -+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt); // Paper - Catch ParseException +- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup); ++ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException } } +diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +@@ -0,0 +0,0 @@ public class SkullBlockEntity extends BlockEntity { + } + + if (nbt.contains("custom_name", 8)) { +- this.customName = Component.Serializer.fromJson(nbt.getString("custom_name"), registryLookup); ++ this.customName = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("custom_name", nbt, registryLookup); // Paper - Catch ParseException + } else { + this.customName = null; + } diff --git a/patches/unapplied/server/Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch similarity index 100% rename from patches/unapplied/server/Check-Drowned-for-Villager-Aggression-Config.patch rename to patches/server/Check-Drowned-for-Villager-Aggression-Config.patch diff --git a/patches/unapplied/server/Configurable-connection-throttle-kick-message.patch b/patches/server/Configurable-connection-throttle-kick-message.patch similarity index 56% rename from patches/unapplied/server/Configurable-connection-throttle-kick-message.patch rename to patches/server/Configurable-connection-throttle-kick-message.patch index b4c4880dfd..730eab8425 100644 --- a/patches/unapplied/server/Configurable-connection-throttle-kick-message.patch +++ b/patches/server/Configurable-connection-throttle-kick-message.patch @@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { - if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { - ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); -- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting."); + synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { + if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { + ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); +- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting."); + Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message - this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); - this.connection.disconnect(chatmessage); - return; + this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); + this.connection.disconnect(chatmessage); + return; diff --git a/patches/unapplied/server/Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/Don-t-allow-digging-into-unloaded-chunks.patch similarity index 97% rename from patches/unapplied/server/Don-t-allow-digging-into-unloaded-chunks.patch rename to patches/server/Don-t-allow-digging-into-unloaded-chunks.patch index d4c79316ed..2a012aa56c 100644 --- a/patches/unapplied/server/Don-t-allow-digging-into-unloaded-chunks.patch +++ b/patches/server/Don-t-allow-digging-into-unloaded-chunks.patch @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerPlayerGameMode { public void handleBlockBreakAction(BlockPos pos, ServerboundPlayerActionPacket.Action action, Direction direction, int worldHeight, int sequence) { - if (this.player.getEyePosition().distanceToSqr(Vec3.atCenterOf(pos)) > ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) { + if (!this.player.canInteractWithBlock(pos, 1.0D)) { + if (true) return; // Paper - Don't allow digging into unloaded chunks; Don't notify if unreasonably far away this.debugLogging(pos, false, sequence, "too far"); } else if (pos.getY() >= worldHeight) { diff --git a/patches/unapplied/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch b/patches/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 100% rename from patches/unapplied/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to patches/server/Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/patches/unapplied/server/Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch b/patches/server/Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch similarity index 100% rename from patches/unapplied/server/Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch rename to patches/server/Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch diff --git a/patches/unapplied/server/Entity-getEntitySpawnReason.patch b/patches/server/Entity-getEntitySpawnReason.patch similarity index 92% rename from patches/unapplied/server/Entity-getEntitySpawnReason.patch rename to patches/server/Entity-getEntitySpawnReason.patch index 4565c39ac3..47e524dbe8 100644 --- a/patches/unapplied/server/Entity-getEntitySpawnReason.patch +++ b/patches/server/Entity-getEntitySpawnReason.patch @@ -50,19 +50,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 String s1 = connection.getLoggableAddress(this.server.logIPs()); @@ -0,0 +0,0 @@ public abstract class PlayerList { - // CraftBukkit start - ServerLevel finalWorldServer = worldserver1; - Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> { -- return !finalWorldServer.addWithUUID(entity1) ? null : entity1; -+ return !finalWorldServer.addWithUUID(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // Paper - Entity#getEntitySpawnReason - // CraftBukkit end + CompoundTag nbttagcompound = ((CompoundTag) optional.get()).getCompound("RootVehicle"); + ServerLevel finalWorldServer = worldserver1; // CraftBukkit - decompile error + Entity entity = EntityType.loadEntityRecursive(nbttagcompound.getCompound("Entity"), worldserver1, (entity1) -> { +- return !finalWorldServer.addWithUUID(entity1) ? null : entity1; // CraftBukkit - decompile error ++ return !finalWorldServer.addWithUUID(entity1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT) ? null : entity1; // CraftBukkit - decompile error // Paper - Entity#getEntitySpawnReason }); + if (entity != null) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } // Paper end - Share random for entities to make them more random @@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Save entity's from mob spawner status if (spawnedViaMobSpawner) { nbttagcompound.putBoolean("Paper.FromMobSpawner", true); -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/patches/unapplied/server/Fire-event-on-GS4-query.patch b/patches/server/Fire-event-on-GS4-query.patch similarity index 100% rename from patches/unapplied/server/Fire-event-on-GS4-query.patch rename to patches/server/Fire-event-on-GS4-query.patch diff --git a/patches/unapplied/server/Fix-CB-call-to-changed-postToMainThread-method.patch b/patches/server/Fix-CB-call-to-changed-postToMainThread-method.patch similarity index 100% rename from patches/unapplied/server/Fix-CB-call-to-changed-postToMainThread-method.patch rename to patches/server/Fix-CB-call-to-changed-postToMainThread-method.patch diff --git a/patches/unapplied/server/Fix-SpongeAbsortEvent-handling.patch b/patches/server/Fix-SpongeAbsortEvent-handling.patch similarity index 100% rename from patches/unapplied/server/Fix-SpongeAbsortEvent-handling.patch rename to patches/server/Fix-SpongeAbsortEvent-handling.patch diff --git a/patches/unapplied/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/patches/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch similarity index 100% rename from patches/unapplied/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch rename to patches/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch diff --git a/patches/unapplied/server/Honor-EntityAgeable.ageLock.patch b/patches/server/Honor-EntityAgeable.ageLock.patch similarity index 78% rename from patches/unapplied/server/Honor-EntityAgeable.ageLock.patch rename to patches/server/Honor-EntityAgeable.ageLock.patch index 1ffb76276b..e5bcd51faf 100644 --- a/patches/unapplied/server/Honor-EntityAgeable.ageLock.patch +++ b/patches/server/Honor-EntityAgeable.ageLock.patch @@ -21,18 +21,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java @@ -0,0 +0,0 @@ public class BeehiveBlockEntity extends BlockEntity { - } - - private static void setBeeReleaseData(int ticks, Bee bee) { -+ if (!bee.ageLocked) { // Paper - Honor ageLock - int j = bee.getAge(); - - if (j < 0) { -@@ -0,0 +0,0 @@ public class BeehiveBlockEntity extends BlockEntity { - } else if (j > 0) { - bee.setAge(Math.max(0, j - ticks)); } -+ } // Paper - Honor ageLock - bee.setInLoveTime(Math.max(0, bee.getInLoveTime() - ticks)); + private static void setBeeReleaseData(int ticksInHive, Bee beeEntity) { ++ if (!beeEntity.ageLocked) { // Paper - Honor ageLock + int j = beeEntity.getAge(); + + if (j < 0) { +@@ -0,0 +0,0 @@ public class BeehiveBlockEntity extends BlockEntity { + } + + beeEntity.setInLoveTime(Math.max(0, beeEntity.getInLoveTime() - ticksInHive)); ++ } // Paper - Honor ageLock + } } + diff --git a/patches/unapplied/server/Implement-CraftBlockSoundGroup.patch b/patches/server/Implement-CraftBlockSoundGroup.patch similarity index 100% rename from patches/unapplied/server/Implement-CraftBlockSoundGroup.patch rename to patches/server/Implement-CraftBlockSoundGroup.patch diff --git a/patches/unapplied/server/Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/Implement-furnace-cook-speed-multiplier-API.patch similarity index 95% rename from patches/unapplied/server/Implement-furnace-cook-speed-multiplier-API.patch rename to patches/server/Implement-furnace-cook-speed-multiplier-API.patch index 91d5c9576b..3a13e67e92 100644 --- a/patches/unapplied/server/Implement-furnace-cook-speed-multiplier-API.patch +++ b/patches/server/Implement-furnace-cook-speed-multiplier-API.patch @@ -19,6 +19,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public double cookSpeedMultiplier = 1.0; // Paper - cook speed multiplier API public int cookingProgress; public int cookingTotalTime; + @Nullable +@@ -0,0 +0,0 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit protected final ContainerData dataAccess; public final Object2IntOpenHashMap recipesUsed; private final RecipeManager.CachedCheck quickCheck; @@ -33,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.recipeType = recipeType; // Paper - cook speed multiplier API } - public static Map getFuel() { + public static void invalidateCache() { @@ -0,0 +0,0 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit this.recipesUsed.put(new ResourceLocation(s), nbttagcompound1.getInt(s)); } @@ -51,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 nbt.putShort("CookTime", (short) this.cookingProgress); nbt.putShort("CookTimeTotal", (short) this.cookingTotalTime); + nbt.putDouble("Paper.CookSpeedMultiplier", this.cookSpeedMultiplier); // Paper - cook speed multiplier API - ContainerHelper.saveAllItems(nbt, this.items); + ContainerHelper.saveAllItems(nbt, this.items, registryLookup); CompoundTag nbttagcompound1 = new CompoundTag(); @@ -0,0 +0,0 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -94,8 +96,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static boolean isFuel(ItemStack stack) { @@ -0,0 +0,0 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit - } - + this.items.set(slot, stack); + stack.limitSize(this.getMaxStackSize(stack)); if (slot == 0 && !flag) { - this.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.level, this); + this.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.level, this.recipeType, this, this.cookSpeedMultiplier); // Paper - cook speed multiplier API @@ -109,7 +111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class CraftFurnace extends @Override - public abstract CraftFurnace copy(); + public abstract CraftFurnace copy(Location location); + + // Paper start - cook speed multiplier API + @Override diff --git a/patches/unapplied/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 100% rename from patches/unapplied/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to patches/server/Improve-Server-Thread-Pool-and-Thread-Priorities.patch diff --git a/patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch b/patches/server/Improve-exact-choice-recipe-ingredients.patch similarity index 94% rename from patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch rename to patches/server/Improve-exact-choice-recipe-ingredients.patch index 7d1bc99bd9..ff13af1719 100644 --- a/patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch +++ b/patches/server/Improve-exact-choice-recipe-ingredients.patch @@ -93,7 +93,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final IntList idList = new IntArrayList(items.length); + for (final ItemStack item : items) { + idList.add(this.registerExact(item)); // I think not copying the stack here is safe because cb copies the stack when creating the ingredient -+ if (!item.hasTag()) { ++ if (item.getComponentsPatch().isEmpty()) { + // add regular index if it's a plain itemstack but still registered as exact + idList.add(StackedContents.getStackingIndex(item)); + } @@ -158,11 +158,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int l = k; for (int m : intList) { -- int n = StackedContents.fromStackingIndex(m).getMaxStackSize(); -+ int n = StackedContents.maxStackSizeFromStackingIndex(m, this.stackedContents); // Paper - Improve exact choice recipe ingredients - if (n < l) { - l = n; - } +- ItemStack itemStack2 = StackedContents.fromStackingIndex(m); ++ ItemStack itemStack2 = StackedContents.fromStackingIndexWithExtras(m, this.stackedContents); // Paper - Improve exact choice recipe ingredients + if (!itemStack2.isEmpty()) { + int n = itemStack2.getMaxStackSize(); + if (n < l) { @@ -0,0 +0,0 @@ public class ServerPlaceRecipe implements PlaceRecipe inputs, int slot, int amount, int gridX, int gridY) { @@ -214,15 +214,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Nullable public io.papermc.paper.inventory.recipe.StackedContentsExtraMap extrasMap = null; // Paper - Improve exact choice recipe ingredients public void accountSimpleStack(ItemStack stack) { -+ if (this.extrasMap != null && stack.hasTag() && this.extrasMap.accountStack(stack, Math.min(64, stack.getCount()))) return; // Paper - Improve exact choice recipe ingredients; max of 64 due to accountStack method below - if (!stack.isDamaged() && !stack.isEnchanted() && !stack.hasCustomHoverName()) { ++ if (this.extrasMap != null && !stack.getComponentsPatch().isEmpty() && this.extrasMap.accountStack(stack, Math.min(64, stack.getCount()))) return; // Paper - Improve exact choice recipe ingredients; max of 64 due to accountStack method below + if (!stack.isDamaged() && !stack.isEnchanted() && !stack.has(DataComponents.CUSTOM_NAME)) { this.accountStack(stack); } @@ -0,0 +0,0 @@ public class StackedContents { if (!stack.isEmpty()) { int i = getStackingIndex(stack); int j = Math.min(maxCount, stack.getCount()); -+ if (this.extrasMap != null && stack.hasTag() && this.extrasMap.accountStack(stack, j)) return; // Paper - Improve exact choice recipe ingredients; if an exact ingredient, don't include it ++ if (this.extrasMap != null && !stack.getComponentsPatch().isEmpty() && this.extrasMap.accountStack(stack, j)) return; // Paper - Improve exact choice recipe ingredients; if an exact ingredient, don't include it this.put(i, j); } } @@ -235,11 +235,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.extrasMap = new io.papermc.paper.inventory.recipe.StackedContentsExtraMap(this, recipe); + } + -+ public static int maxStackSizeFromStackingIndex(final int itemId, @Nullable final StackedContents contents) { ++ public static ItemStack fromStackingIndexWithExtras(final int itemId, @Nullable final StackedContents contents) { + if (contents != null && contents.extrasMap != null && itemId >= BuiltInRegistries.ITEM.size()) { -+ return fromStackingIndexExtras(itemId, contents.extrasMap).getMaxStackSize(); ++ return fromStackingIndexExtras(itemId, contents.extrasMap); + } -+ return fromStackingIndex(itemId).getMaxStackSize(); ++ return fromStackingIndex(itemId); + } + + public static ItemStack fromStackingIndexExtras(final int itemId, final io.papermc.paper.inventory.recipe.StackedContentsExtraMap extrasMap) { diff --git a/patches/unapplied/server/Limit-Client-Sign-length-more.patch b/patches/server/Limit-Client-Sign-length-more.patch similarity index 100% rename from patches/unapplied/server/Limit-Client-Sign-length-more.patch rename to patches/server/Limit-Client-Sign-length-more.patch diff --git a/patches/unapplied/server/Make-the-default-permission-message-configurable.patch b/patches/server/Make-the-default-permission-message-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-the-default-permission-message-configurable.patch rename to patches/server/Make-the-default-permission-message-configurable.patch diff --git a/patches/unapplied/server/Mob-Spawner-API-Enhancements.patch b/patches/server/Mob-Spawner-API-Enhancements.patch similarity index 96% rename from patches/unapplied/server/Mob-Spawner-API-Enhancements.patch rename to patches/server/Mob-Spawner-API-Enhancements.patch index cf3acc18cc..18a59b6ec8 100644 --- a/patches/unapplied/server/Mob-Spawner-API-Enhancements.patch +++ b/patches/server/Mob-Spawner-API-Enhancements.patch @@ -73,8 +73,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -0,0 +0,0 @@ public class CraftCreatureSpawner extends CraftBlockEntityState(nms.slotDropChances().entrySet().stream().collect(Collectors.toMap((entry) -> CraftEquipmentSlot.getSlot(entry.getKey()), Map.Entry::getValue))) + )).orElse(null); } + + // Paper start diff --git a/patches/unapplied/server/Optimize-Captured-BlockEntity-Lookup.patch b/patches/server/Optimize-Captured-BlockEntity-Lookup.patch similarity index 100% rename from patches/unapplied/server/Optimize-Captured-BlockEntity-Lookup.patch rename to patches/server/Optimize-Captured-BlockEntity-Lookup.patch diff --git a/patches/unapplied/server/Optimize-World-Time-Updates.patch b/patches/server/Optimize-World-Time-Updates.patch similarity index 100% rename from patches/unapplied/server/Optimize-World-Time-Updates.patch rename to patches/server/Optimize-World-Time-Updates.patch diff --git a/patches/unapplied/server/PlayerDeathEvent-getItemsToKeep.patch b/patches/server/PlayerDeathEvent-getItemsToKeep.patch similarity index 100% rename from patches/unapplied/server/PlayerDeathEvent-getItemsToKeep.patch rename to patches/server/PlayerDeathEvent-getItemsToKeep.patch diff --git a/patches/unapplied/server/PreSpawnerSpawnEvent.patch b/patches/server/PreSpawnerSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/PreSpawnerSpawnEvent.patch rename to patches/server/PreSpawnerSpawnEvent.patch diff --git a/patches/unapplied/server/Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 100% rename from patches/unapplied/server/Prevent-chunk-loading-from-Fluid-Flowing.patch rename to patches/server/Prevent-chunk-loading-from-Fluid-Flowing.patch diff --git a/patches/unapplied/server/Prevent-mob-spawning-from-loading-generating-chunks.patch b/patches/server/Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-mob-spawning-from-loading-generating-chunks.patch rename to patches/server/Prevent-mob-spawning-from-loading-generating-chunks.patch diff --git a/patches/unapplied/server/Prevent-various-interactions-from-causing-chunk-load.patch b/patches/server/Prevent-various-interactions-from-causing-chunk-load.patch similarity index 85% rename from patches/unapplied/server/Prevent-various-interactions-from-causing-chunk-load.patch rename to patches/server/Prevent-various-interactions-from-causing-chunk-load.patch index ab00c967ff..e39a522af9 100644 --- a/patches/unapplied/server/Prevent-various-interactions-from-causing-chunk-load.patch +++ b/patches/server/Prevent-various-interactions-from-causing-chunk-load.patch @@ -63,19 +63,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Vec3 vec3d = new Vec3((double) this.enderman.getBlockX() + 0.5D, (double) j + 0.5D, (double) this.enderman.getBlockZ() + 0.5D); Vec3 vec3d1 = new Vec3((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D); BlockHitResult movingobjectpositionblock = world.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.enderman)); -diff --git a/src/main/java/net/minecraft/world/item/CompassItem.java b/src/main/java/net/minecraft/world/item/CompassItem.java +diff --git a/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java b/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/CompassItem.java -+++ b/src/main/java/net/minecraft/world/item/CompassItem.java -@@ -0,0 +0,0 @@ public class CompassItem extends Item implements Vanishable { - Optional> optional = getLodestoneDimension(compoundTag); - if (optional.isPresent() && optional.get() == world.dimension() && compoundTag.contains("LodestonePos")) { - BlockPos blockPos = NbtUtils.readBlockPos(compoundTag.getCompound("LodestonePos")); -- if (!world.isInWorldBounds(blockPos) || !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos)) { -+ if (!world.isInWorldBounds(blockPos) || (world.hasChunkAt(blockPos) && !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos))) { // Paper - Prevent compass from loading chunks - compoundTag.remove("LodestonePos"); - } - } +--- a/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java ++++ b/src/main/java/net/minecraft/world/item/component/LodestoneTracker.java +@@ -0,0 +0,0 @@ public record LodestoneTracker(Optional target, boolean tracked) { + return this; + } else { + BlockPos blockPos = this.target.get().pos(); +- return world.isInWorldBounds(blockPos) && world.getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos) ++ return world.isInWorldBounds(blockPos) && (!world.hasChunkAt(blockPos) || world.getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos)) // Paper - Prevent compass from loading chunks + ? this + : new LodestoneTracker(Optional.empty(), true); + } diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/BlockGetter.java diff --git a/patches/unapplied/server/Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/Replace-OfflinePlayer-getLastPlayed.patch similarity index 99% rename from patches/unapplied/server/Replace-OfflinePlayer-getLastPlayed.patch rename to patches/server/Replace-OfflinePlayer-getLastPlayed.patch index 02ef4d5ecb..1d016ae6e5 100644 --- a/patches/unapplied/server/Replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/Replace-OfflinePlayer-getLastPlayed.patch @@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed GameProfile gameprofile = player.getGameProfile(); GameProfileCache usercache = this.server.getProfileCache(); - String s; + // Optional optional; // CraftBukkit - decompile error diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java diff --git a/patches/unapplied/server/Reset-players-airTicks-on-respawn.patch b/patches/server/Reset-players-airTicks-on-respawn.patch similarity index 100% rename from patches/unapplied/server/Reset-players-airTicks-on-respawn.patch rename to patches/server/Reset-players-airTicks-on-respawn.patch diff --git a/patches/unapplied/server/Restore-custom-InventoryHolder-support.patch b/patches/server/Restore-custom-InventoryHolder-support.patch similarity index 97% rename from patches/unapplied/server/Restore-custom-InventoryHolder-support.patch rename to patches/server/Restore-custom-InventoryHolder-support.patch index 921ffceb16..9537116016 100644 --- a/patches/unapplied/server/Restore-custom-InventoryHolder-support.patch +++ b/patches/server/Restore-custom-InventoryHolder-support.patch @@ -275,7 +275,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper end @@ -0,0 +0,0 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat - ((RandomizableContainerBlockEntity) te).setCustomName(CraftChatMessage.fromStringOrNull(title)); + ((RandomizableContainerBlockEntity) te).name = CraftChatMessage.fromStringOrNull(title); } - return this.getInventory(te); @@ -306,7 +306,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { Container tileEntity = this.getTileEntity(); - ((AbstractFurnaceBlockEntity) tileEntity).setCustomName(CraftChatMessage.fromStringOrNull(title)); + ((AbstractFurnaceBlockEntity) tileEntity).name = CraftChatMessage.fromStringOrNull(title); - return this.getInventory(tileEntity); + return this.getInventory(owner, type, tileEntity); // Paper } @@ -335,7 +335,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat if (tileEntity instanceof BrewingStandBlockEntity) { - ((BrewingStandBlockEntity) tileEntity).setCustomName(CraftChatMessage.fromStringOrNull(title)); + ((BrewingStandBlockEntity) tileEntity).name = CraftChatMessage.fromStringOrNull(title); } - return this.getInventory(tileEntity); + return this.getInventory(holder, type, tileEntity); // Paper diff --git a/patches/unapplied/server/Server-Tick-Events.patch b/patches/server/Server-Tick-Events.patch similarity index 100% rename from patches/unapplied/server/Server-Tick-Events.patch rename to patches/server/Server-Tick-Events.patch diff --git a/patches/unapplied/server/Turtle-API.patch b/patches/server/Turtle-API.patch similarity index 97% rename from patches/unapplied/server/Turtle-API.patch rename to patches/server/Turtle-API.patch index 38fd5b70f3..cbf6c97a09 100644 --- a/patches/unapplied/server/Turtle-API.patch +++ b/patches/server/Turtle-API.patch @@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + BlockState iblockdata = (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, layEggEvent.getEggCount()); // Paper world.setBlock(blockposition1, iblockdata, 3); - world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata)); + world.gameEvent((Holder) GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata)); @@ -0,0 +0,0 @@ public class Turtle extends Animal { @Override diff --git a/patches/unapplied/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 100% rename from patches/unapplied/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to patches/server/Workaround-for-vehicle-tracking-issue-on-disconnect.patch diff --git a/patches/unapplied/server/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/patches/server/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch similarity index 100% rename from patches/unapplied/server/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch rename to patches/server/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch diff --git a/patches/unapplied/server/force-entity-dismount-during-teleportation.patch b/patches/server/force-entity-dismount-during-teleportation.patch similarity index 93% rename from patches/unapplied/server/force-entity-dismount-during-teleportation.patch rename to patches/server/force-entity-dismount-during-teleportation.patch index 269ac1d6b1..9df720112b 100644 --- a/patches/unapplied/server/force-entity-dismount-during-teleportation.patch +++ b/patches/server/force-entity-dismount-during-teleportation.patch @@ -23,7 +23,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void removeVehicle() { @@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } @@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) this.getBukkitEntity(), @@ -62,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ); // Suppress during worldgen if (this.valid) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } diff --git a/patches/unapplied/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/removed-patches-1-20-5/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch rename to removed-patches-1-20-5/0259-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch diff --git a/patches/unapplied/server/Handle-Large-Packets-disconnecting-client.patch b/removed-patches-1-20-5/0284-Handle-Large-Packets-disconnecting-client.patch similarity index 100% rename from patches/unapplied/server/Handle-Large-Packets-disconnecting-client.patch rename to removed-patches-1-20-5/0284-Handle-Large-Packets-disconnecting-client.patch diff --git a/patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/removed-patches-1-20-5/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 100% rename from patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to removed-patches-1-20-5/0310-Configurable-Keep-Spawn-Loaded-range-per-world.patch