From aca9b5cf3466cff388c51055900a2a781550198f Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 21 Sep 2023 19:17:21 -0700 Subject: [PATCH] even more work --- .../server/Add-Heightmap-API.patch | 0 .../Add-PlayerConnectionCloseEvent.patch | 1 - ...d-option-to-disable-pillager-patrols.patch | 0 .../Allow-Saving-of-Oversized-Chunks.patch | 27 ++++++------------- ...oggleEvent-when-whitelist-is-toggled.patch | 0 ...le-Keep-Spawn-Loaded-range-per-world.patch | 2 +- ...gurable-projectile-relative-velocity.patch | 0 ...Chunks-from-Hoppers-and-other-things.patch | 0 .../Dont-send-unnecessary-sign-update.patch | 0 .../Duplicate-UUID-Resolve-Option.patch | 6 ++--- .../server/Entity-getEntitySpawnReason.patch | 2 +- .../Expose-the-internal-current-tick.patch | 0 .../server/Fire-event-on-GS4-query.patch | 0 ...l-to-changed-postToMainThread-method.patch | 10 +++---- .../server/Fix-MC-158900.patch | 0 .../Fix-World-isChunkGenerated-calls.patch | 12 ++++----- .../Fix-items-not-falling-correctly.patch | 0 ...n-item-frames-are-modified-MC-123450.patch | 0 .../Flat-bedrock-generator-settings.patch | 0 ...le-Oversized-Tile-Entities-in-chunks.patch | 0 .../Implement-Brigadier-Mojang-API.patch | 4 +-- .../Implement-CraftBlockSoundGroup.patch | 0 .../Implement-PlayerPostRespawnEvent.patch | 0 ...rove-exact-choice-recipe-ingredients.patch | 26 +++++++++--------- .../Limit-Client-Sign-length-more.patch | 10 +++---- ...5656-Fix-Follow-Range-Initial-Target.patch | 0 patches/server/MC-Utils.patch | 2 -- .../server/Mob-Spawner-API-Enhancements.patch | 0 ...al-Spawned-mobs-towards-natural-spaw.patch | 0 ...ptimise-EntityGetter-getPlayerByUUID.patch | 2 +- .../Optimize-Captured-TileEntity-Lookup.patch | 2 +- .../PlayerDeathEvent-getItemsToKeep.patch | 0 ...layerDeathEvent-shouldDropExperience.patch | 0 ...oading-chunks-checking-hive-position.patch | 0 ...revent-consuming-the-wrong-itemstack.patch | 0 ...nk-loads-when-villagers-try-to-find-.patch | 0 .../server/Server-Tick-Events.patch | 0 ...ate-location-if-we-failed-to-read-it.patch | 0 ...-for-pickupDelay-breaks-picking-up-i.patch | 0 .../server/offset-item-frame-ticking.patch | 0 ...-Manager-and-add-advanced-packet-sup.patch | 0 41 files changed, 45 insertions(+), 61 deletions(-) rename patches/{unapplied => }/server/Add-Heightmap-API.patch (100%) rename patches/{unapplied => }/server/Add-option-to-disable-pillager-patrols.patch (100%) rename patches/{unapplied => }/server/Allow-Saving-of-Oversized-Chunks.patch (91%) rename patches/{unapplied => }/server/Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch (100%) rename patches/{unapplied => }/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch (99%) rename patches/{unapplied => }/server/Configurable-projectile-relative-velocity.patch (100%) rename patches/{unapplied => }/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch (100%) rename patches/{unapplied => }/server/Dont-send-unnecessary-sign-update.patch (100%) rename patches/{unapplied => }/server/Duplicate-UUID-Resolve-Option.patch (97%) rename patches/{unapplied => }/server/Entity-getEntitySpawnReason.patch (99%) rename patches/{unapplied => }/server/Expose-the-internal-current-tick.patch (100%) rename patches/{unapplied => }/server/Fire-event-on-GS4-query.patch (100%) rename patches/{unapplied => }/server/Fix-CB-call-to-changed-postToMainThread-method.patch (50%) rename patches/{unapplied => }/server/Fix-MC-158900.patch (100%) rename patches/{unapplied => }/server/Fix-World-isChunkGenerated-calls.patch (97%) rename patches/{unapplied => }/server/Fix-items-not-falling-correctly.patch (100%) rename patches/{unapplied => }/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch (100%) rename patches/{unapplied => }/server/Flat-bedrock-generator-settings.patch (100%) rename patches/{unapplied => }/server/Handle-Oversized-Tile-Entities-in-chunks.patch (100%) rename patches/{unapplied => }/server/Implement-Brigadier-Mojang-API.patch (98%) rename patches/{unapplied => }/server/Implement-CraftBlockSoundGroup.patch (100%) rename patches/{unapplied => }/server/Implement-PlayerPostRespawnEvent.patch (100%) rename patches/{unapplied => }/server/Improve-exact-choice-recipe-ingredients.patch (96%) rename patches/{unapplied => }/server/Limit-Client-Sign-length-more.patch (85%) rename patches/{unapplied => }/server/MC-145656-Fix-Follow-Range-Initial-Target.patch (100%) rename patches/{unapplied => }/server/Mob-Spawner-API-Enhancements.patch (100%) rename patches/{unapplied => }/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch (100%) rename patches/{unapplied => }/server/Optimise-EntityGetter-getPlayerByUUID.patch (98%) rename patches/{unapplied => }/server/Optimize-Captured-TileEntity-Lookup.patch (87%) rename patches/{unapplied => }/server/PlayerDeathEvent-getItemsToKeep.patch (100%) rename patches/{unapplied => }/server/PlayerDeathEvent-shouldDropExperience.patch (100%) rename patches/{unapplied => }/server/Prevent-bees-loading-chunks-checking-hive-position.patch (100%) rename patches/{unapplied => }/server/Prevent-consuming-the-wrong-itemstack.patch (100%) rename patches/{unapplied => }/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch (100%) rename patches/{unapplied => }/server/Server-Tick-Events.patch (100%) rename patches/{unapplied => }/server/Show-blockstate-location-if-we-failed-to-read-it.patch (100%) rename patches/{unapplied => }/server/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch (100%) rename patches/{unapplied => }/server/offset-item-frame-ticking.patch (100%) rename patches/unapplied/{server => skipped}/Optimize-Network-Manager-and-add-advanced-packet-sup.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/server/Add-PlayerConnectionCloseEvent.patch b/patches/server/Add-PlayerConnectionCloseEvent.patch index 4e0dcd067a..ebb123aef5 100644 --- a/patches/server/Add-PlayerConnectionCloseEvent.patch +++ b/patches/server/Add-PlayerConnectionCloseEvent.patch @@ -66,7 +66,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + // Paper end -+ } } } diff --git a/patches/unapplied/server/Add-option-to-disable-pillager-patrols.patch b/patches/server/Add-option-to-disable-pillager-patrols.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-disable-pillager-patrols.patch rename to patches/server/Add-option-to-disable-pillager-patrols.patch diff --git a/patches/unapplied/server/Allow-Saving-of-Oversized-Chunks.patch b/patches/server/Allow-Saving-of-Oversized-Chunks.patch similarity index 91% rename from patches/unapplied/server/Allow-Saving-of-Oversized-Chunks.patch rename to patches/server/Allow-Saving-of-Oversized-Chunks.patch index 96aac53a4c..02bfb6688e 100644 --- a/patches/unapplied/server/Allow-Saving-of-Oversized-Chunks.patch +++ b/patches/server/Allow-Saving-of-Oversized-Chunks.patch @@ -50,9 +50,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.slf4j.Logger; @@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable { + private final IntBuffer timestamps; @VisibleForTesting protected final RegionBitmap usedSectors; - public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper + public final Path regionFile; // Paper public RegionFile(Path file, Path directory, boolean dsync) throws IOException { @@ -145,18 +145,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -0,0 +0,0 @@ import java.nio.file.Path; - import javax.annotation.Nullable; - import net.minecraft.FileUtil; - import net.minecraft.nbt.CompoundTag; -+import net.minecraft.nbt.ListTag; - import net.minecraft.nbt.NbtIo; - import net.minecraft.nbt.StreamTagVisitor; -+import net.minecraft.nbt.Tag; - import net.minecraft.util.ExceptionCollector; - import net.minecraft.world.level.ChunkPos; - -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { } } @@ -203,8 +192,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + private static void mergeChunkList(CompoundTag level, CompoundTag oversizedLevel, String key, String oversizedKey) { -+ ListTag levelList = level.getList(key, 10); -+ ListTag oversizedList = oversizedLevel.getList(oversizedKey, 10); ++ net.minecraft.nbt.ListTag levelList = level.getList(key, 10); ++ net.minecraft.nbt.ListTag oversizedList = oversizedLevel.getList(oversizedKey, 10); + + if (!oversizedList.isEmpty()) { + levelList.addAll(oversizedList); @@ -212,7 +201,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + -+ private static int getNBTSize(Tag nbtBase) { ++ private static int getNBTSize(net.minecraft.nbt.Tag nbtBase) { + DataOutputStream test = new DataOutputStream(new org.apache.commons.io.output.NullOutputStream()); + try { + nbtBase.write(test); @@ -228,8 +217,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Nullable public CompoundTag read(ChunkPos pos) throws IOException { // CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { - try { // Paper +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { + // CraftBukkit end DataInputStream datainputstream = regionfile.getChunkDataInputStream(pos); + // Paper start @@ -241,7 +230,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 CompoundTag nbttagcompound; label43: { -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { try { NbtIo.write(nbt, (DataOutput) dataoutputstream); 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/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 99% rename from patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch index 2bceb97e74..f288f46579 100644 --- a/patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex::load, MapIndex::new, "idcounts")).getFreeAuxValueForMap(); + return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex.factory(), "idcounts")).getFreeAuxValueForMap(); } + // Paper start - helper function for configurable spawn radius diff --git a/patches/unapplied/server/Configurable-projectile-relative-velocity.patch b/patches/server/Configurable-projectile-relative-velocity.patch similarity index 100% rename from patches/unapplied/server/Configurable-projectile-relative-velocity.patch rename to patches/server/Configurable-projectile-relative-velocity.patch diff --git a/patches/unapplied/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/patches/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 100% rename from patches/unapplied/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to patches/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch diff --git a/patches/unapplied/server/Dont-send-unnecessary-sign-update.patch b/patches/server/Dont-send-unnecessary-sign-update.patch similarity index 100% rename from patches/unapplied/server/Dont-send-unnecessary-sign-update.patch rename to patches/server/Dont-send-unnecessary-sign-update.patch diff --git a/patches/unapplied/server/Duplicate-UUID-Resolve-Option.patch b/patches/server/Duplicate-UUID-Resolve-Option.patch similarity index 97% rename from patches/unapplied/server/Duplicate-UUID-Resolve-Option.patch rename to patches/server/Duplicate-UUID-Resolve-Option.patch index 6326e57870..4706d45d62 100644 --- a/patches/unapplied/server/Duplicate-UUID-Resolve-Option.patch +++ b/patches/server/Duplicate-UUID-Resolve-Option.patch @@ -68,7 +68,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 })); // CraftBukkit end @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - throw new UnsupportedOperationException(); // Paper - rewrite chunk system + }); } + // Paper start @@ -115,5 +115,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end public CompletableFuture> prepareTickingChunk(ChunkHolder holder) { - throw new UnsupportedOperationException(); // Paper - rewrite chunk system - } + CompletableFuture, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkRangeFuture(holder, 1, (i) -> { + return ChunkStatus.FULL; diff --git a/patches/unapplied/server/Entity-getEntitySpawnReason.patch b/patches/server/Entity-getEntitySpawnReason.patch similarity index 99% rename from patches/unapplied/server/Entity-getEntitySpawnReason.patch rename to patches/server/Entity-getEntitySpawnReason.patch index b4ca07974c..cc89e2da11 100644 --- a/patches/unapplied/server/Entity-getEntitySpawnReason.patch +++ b/patches/server/Entity-getEntitySpawnReason.patch @@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end player.setServerLevel(worldserver1); - String s1 = "local"; + String s1 = connection.getLoggableAddress(this.server.logIPs()); @@ -0,0 +0,0 @@ public abstract class PlayerList { // CraftBukkit start diff --git a/patches/unapplied/server/Expose-the-internal-current-tick.patch b/patches/server/Expose-the-internal-current-tick.patch similarity index 100% rename from patches/unapplied/server/Expose-the-internal-current-tick.patch rename to patches/server/Expose-the-internal-current-tick.patch 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 50% 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 index 124b8e0420..b588e7cbcf 100644 --- a/patches/unapplied/server/Fix-CB-call-to-changed-postToMainThread-method.patch +++ b/patches/server/Fix-CB-call-to-changed-postToMainThread-method.patch @@ -4,11 +4,11 @@ Date: Fri, 10 May 2019 18:38:19 +0100 Subject: [PATCH] Fix CB call to changed postToMainThread method -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack Objects.requireNonNull(this.connection); // CraftBukkit - Don't wait @@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + minecraftserver.scheduleOnMain(networkmanager::handleDisconnection); // Paper } - private CompletableFuture filterTextPacket(T text, BiFunction> filterer) { + protected boolean isSingleplayerOwner() { diff --git a/patches/unapplied/server/Fix-MC-158900.patch b/patches/server/Fix-MC-158900.patch similarity index 100% rename from patches/unapplied/server/Fix-MC-158900.patch rename to patches/server/Fix-MC-158900.patch diff --git a/patches/unapplied/server/Fix-World-isChunkGenerated-calls.patch b/patches/server/Fix-World-isChunkGenerated-calls.patch similarity index 97% rename from patches/unapplied/server/Fix-World-isChunkGenerated-calls.patch rename to patches/server/Fix-World-isChunkGenerated-calls.patch index 87217f196a..aa3f269a75 100644 --- a/patches/unapplied/server/Fix-World-isChunkGenerated-calls.patch +++ b/patches/server/Fix-World-isChunkGenerated-calls.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - // Paper end + } private CompletableFuture> readChunk(ChunkPos chunkPos) { - return this.read(chunkPos).thenApplyAsync((optional) -> { @@ -97,7 +97,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java @@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable { - public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper + protected final RegionBitmap usedSectors; public final Path regionFile; // Paper + // Paper start - Cache chunk status @@ -135,10 +135,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private static int getOffsetIndex(ChunkPos pos) { return pos.getRegionLocalX() + pos.getRegionLocalZ() * 32; } -@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable { - synchronized (this) { - try { - // Paper end + + public void close() throws IOException { + this.closed = true; // Paper try { this.padToFullSector(); @@ -147,7 +145,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { try { NbtIo.write(nbt, (DataOutput) dataoutputstream); diff --git a/patches/unapplied/server/Fix-items-not-falling-correctly.patch b/patches/server/Fix-items-not-falling-correctly.patch similarity index 100% rename from patches/unapplied/server/Fix-items-not-falling-correctly.patch rename to patches/server/Fix-items-not-falling-correctly.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/Flat-bedrock-generator-settings.patch b/patches/server/Flat-bedrock-generator-settings.patch similarity index 100% rename from patches/unapplied/server/Flat-bedrock-generator-settings.patch rename to patches/server/Flat-bedrock-generator-settings.patch diff --git a/patches/unapplied/server/Handle-Oversized-Tile-Entities-in-chunks.patch b/patches/server/Handle-Oversized-Tile-Entities-in-chunks.patch similarity index 100% rename from patches/unapplied/server/Handle-Oversized-Tile-Entities-in-chunks.patch rename to patches/server/Handle-Oversized-Tile-Entities-in-chunks.patch diff --git a/patches/unapplied/server/Implement-Brigadier-Mojang-API.patch b/patches/server/Implement-Brigadier-Mojang-API.patch similarity index 98% rename from patches/unapplied/server/Implement-Brigadier-Mojang-API.patch rename to patches/server/Implement-Brigadier-Mojang-API.patch index a28c905285..36ae063d72 100644 --- a/patches/unapplied/server/Implement-Brigadier-Mojang-API.patch +++ b/patches/server/Implement-Brigadier-Mojang-API.patch @@ -134,7 +134,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { @@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 }); }); } -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); } }); 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-PlayerPostRespawnEvent.patch b/patches/server/Implement-PlayerPostRespawnEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-PlayerPostRespawnEvent.patch rename to patches/server/Implement-PlayerPostRespawnEvent.patch diff --git a/patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch b/patches/server/Improve-exact-choice-recipe-ingredients.patch similarity index 96% rename from patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch rename to patches/server/Improve-exact-choice-recipe-ingredients.patch index 85cabd7374..e7ee8a225b 100644 --- a/patches/unapplied/server/Improve-exact-choice-recipe-ingredients.patch +++ b/patches/server/Improve-exact-choice-recipe-ingredients.patch @@ -153,7 +153,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.stackedContents.initialize(recipe); // Paper - better exact choice recipes entity.getInventory().fillStackedContents(this.stackedContents); this.menu.fillCraftSlotsStackedContents(this.stackedContents); - if (this.stackedContents.canCraft(recipe, (IntList)null)) { + if (this.stackedContents.canCraft(recipe.value(), (IntList)null)) { @@ -0,0 +0,0 @@ public class ServerPlaceRecipe implements PlaceRecipe { +public abstract class AbstractCookingRecipe extends io.papermc.paper.inventory.recipe.RecipeBookExactChoiceRecipe implements Recipe { // Paper - improve exact recipe choices protected final RecipeType type; - protected final ResourceLocation id; - private final CookingBookCategory category; + protected final CookingBookCategory category; + protected final String group; @@ -0,0 +0,0 @@ public abstract class AbstractCookingRecipe implements Recipe { - this.result = output; + this.result = result; this.experience = experience; - this.cookingTime = cookTime; + this.cookingTime = cookingTime; + this.checkExactIngredients(); // Paper - improve exact recipe choices } @@ -323,7 +323,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public interface Recipe { } - org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit + org.bukkit.inventory.Recipe toBukkitRecipe(org.bukkit.NamespacedKey id); // CraftBukkit + + // Paper start - improved exact choice recipes + default boolean hasExactIngredients() { @@ -345,13 +345,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 final int width; final int height; @@ -0,0 +0,0 @@ public class ShapedRecipe implements CraftingRecipe { - this.recipeItems = input; - this.result = output; + this.recipeItems = ingredients; + this.result = result; this.showNotification = showNotification; + this.checkExactIngredients(); // Paper - improve exact recipe choices } - public ShapedRecipe(ResourceLocation id, String group, CraftingBookCategory category, int width, int height, NonNullList input, ItemStack output) { + public ShapedRecipe(String group, CraftingBookCategory category, int width, int height, NonNullList ingredients, ItemStack result) { diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java @@ -363,12 +363,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 -public class ShapelessRecipe implements CraftingRecipe { +public class ShapelessRecipe extends io.papermc.paper.inventory.recipe.RecipeBookExactChoiceRecipe implements CraftingRecipe { // Paper - improve exact recipe choices - private final ResourceLocation id; final String group; + final CraftingBookCategory category; @@ -0,0 +0,0 @@ public class ShapelessRecipe implements CraftingRecipe { this.category = category; - this.result = output; - this.ingredients = input; + this.result = result; + this.ingredients = ingredients; + this.checkExactIngredients(); // Paper - improve exact recipe choices } diff --git a/patches/unapplied/server/Limit-Client-Sign-length-more.patch b/patches/server/Limit-Client-Sign-length-more.patch similarity index 85% rename from patches/unapplied/server/Limit-Client-Sign-length-more.patch rename to patches/server/Limit-Client-Sign-length-more.patch index 696bc3bbcc..d16fc9a632 100644 --- a/patches/unapplied/server/Limit-Client-Sign-length-more.patch +++ b/patches/server/Limit-Client-Sign-length-more.patch @@ -25,15 +25,15 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private final MessageSignatureCache messageSignatureCache; private final FutureChain chatMessageChain; - private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit + private boolean waitingForSwitchToConfig; + private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper - public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { - this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) { + super(server, connection, clientData, player); // CraftBukkit +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSignUpdate(ServerboundSignUpdatePacket packet) { diff --git a/patches/unapplied/server/MC-145656-Fix-Follow-Range-Initial-Target.patch b/patches/server/MC-145656-Fix-Follow-Range-Initial-Target.patch similarity index 100% rename from patches/unapplied/server/MC-145656-Fix-Follow-Range-Initial-Target.patch rename to patches/server/MC-145656-Fix-Follow-Range-Initial-Target.patch diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 08d9a75e80..81f8a8291f 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -6061,8 +6061,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + this.removePlayerFromDistanceMaps(player); // Paper - distance maps -+ } -+ this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY); } diff --git a/patches/unapplied/server/Mob-Spawner-API-Enhancements.patch b/patches/server/Mob-Spawner-API-Enhancements.patch similarity index 100% rename from patches/unapplied/server/Mob-Spawner-API-Enhancements.patch rename to patches/server/Mob-Spawner-API-Enhancements.patch diff --git a/patches/unapplied/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/patches/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch similarity index 100% rename from patches/unapplied/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch rename to patches/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch diff --git a/patches/unapplied/server/Optimise-EntityGetter-getPlayerByUUID.patch b/patches/server/Optimise-EntityGetter-getPlayerByUUID.patch similarity index 98% rename from patches/unapplied/server/Optimise-EntityGetter-getPlayerByUUID.patch rename to patches/server/Optimise-EntityGetter-getPlayerByUUID.patch index 027d132cef..e7b96b515b 100644 --- a/patches/unapplied/server/Optimise-EntityGetter-getPlayerByUUID.patch +++ b/patches/server/Optimise-EntityGetter-getPlayerByUUID.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - }); } + // Paper end + // Paper start - optimise getPlayerByUUID + @Nullable diff --git a/patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch b/patches/server/Optimize-Captured-TileEntity-Lookup.patch similarity index 87% rename from patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch rename to patches/server/Optimize-Captured-TileEntity-Lookup.patch index d169847e04..1925711d6f 100644 --- a/patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch +++ b/patches/server/Optimize-Captured-TileEntity-Lookup.patch @@ -26,5 +26,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + // Paper end // CraftBukkit end - return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && !io.papermc.paper.util.TickThread.isTickThread() ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE)); // Paper - rewrite chunk system + return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE)); } 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/PlayerDeathEvent-shouldDropExperience.patch b/patches/server/PlayerDeathEvent-shouldDropExperience.patch similarity index 100% rename from patches/unapplied/server/PlayerDeathEvent-shouldDropExperience.patch rename to patches/server/PlayerDeathEvent-shouldDropExperience.patch diff --git a/patches/unapplied/server/Prevent-bees-loading-chunks-checking-hive-position.patch b/patches/server/Prevent-bees-loading-chunks-checking-hive-position.patch similarity index 100% rename from patches/unapplied/server/Prevent-bees-loading-chunks-checking-hive-position.patch rename to patches/server/Prevent-bees-loading-chunks-checking-hive-position.patch diff --git a/patches/unapplied/server/Prevent-consuming-the-wrong-itemstack.patch b/patches/server/Prevent-consuming-the-wrong-itemstack.patch similarity index 100% rename from patches/unapplied/server/Prevent-consuming-the-wrong-itemstack.patch rename to patches/server/Prevent-consuming-the-wrong-itemstack.patch diff --git a/patches/unapplied/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch b/patches/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch similarity index 100% rename from patches/unapplied/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch rename to patches/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch 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/Show-blockstate-location-if-we-failed-to-read-it.patch b/patches/server/Show-blockstate-location-if-we-failed-to-read-it.patch similarity index 100% rename from patches/unapplied/server/Show-blockstate-location-if-we-failed-to-read-it.patch rename to patches/server/Show-blockstate-location-if-we-failed-to-read-it.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/offset-item-frame-ticking.patch b/patches/server/offset-item-frame-ticking.patch similarity index 100% rename from patches/unapplied/server/offset-item-frame-ticking.patch rename to patches/server/offset-item-frame-ticking.patch diff --git a/patches/unapplied/server/Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/unapplied/skipped/Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 100% rename from patches/unapplied/server/Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to patches/unapplied/skipped/Optimize-Network-Manager-and-add-advanced-packet-sup.patch