From 580e157417c520b02036d66df95c4c32da5fcd38 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 7 Dec 2022 22:57:15 +0100 Subject: [PATCH] More patchidy patched patch patches --- ...nate-Current-redstone-implementation.patch | 2 +- .../server/Add-EntityPortalReadyEvent.patch | 0 .../Add-NamespacedKey-biome-methods.patch | 0 .../server/Add-Player-getFishHook.patch | 0 .../server/Add-PlayerStopUsingItemEvent.patch | 0 .../Add-Velocity-IP-Forwarding-Support.patch | 12 ++--- .../server/Add-WardenAngerChangeEvent.patch | 0 ...r-to-PlayerConnection-internalTelepo.patch | 0 ...destroyerIdentity-to-sendBlockDamage.patch | 0 .../server/Add-missing-BlockFadeEvents.patch | 0 ...rtant-BlockStateListPopulator-method.patch | 0 .../server/Add-missing-spawn-eggs.patch | 0 ...-strict-advancement-dimension-checks.patch | 0 ...-debug-information-to-chat-packet-er.patch | 13 +---- .../Add-support-for-Proxy-Protocol.patch | 10 ++-- ...us-missing-EntityDropItemEvent-calls.patch | 2 +- .../server/Block-Ticking-API.patch | 0 .../server/Collision-API.patch | 0 ...stom-Chat-Completion-Suggestions-API.patch | 0 ...t-selector-resolving-in-books-by-def.patch | 0 ...o-not-accept-invalid-client-settings.patch | 0 ...-chunk-for-dynamic-game-event-listen.patch | 4 +- ...broadcast-messages-to-command-blocks.patch | 0 ...onent-in-resource-pack-rejection-mes.patch | 0 .../server/Don-t-tick-markers.patch | 0 ...-level-random-in-entity-constructors.patch | 0 .../Dont-resent-entity-on-art-update.patch | 0 .../FallingBlock-auto-expire-setting.patch | 0 .../server/Fix-Bee-flower-NPE.patch | 0 ...shPotion-and-LingeringPotion-spawnin.patch | 0 ...ht-killed-statuses-should-be-false-f.patch | 0 ...ntory-for-smokers-and-blast-furnaces.patch | 0 ...ix-OfflinePlayer-getBedSpawnLocation.patch | 0 ...g-not-using-commands.spam-exclusions.patch | 0 ...ix-plugin-loggers-on-server-shutdown.patch | 0 ...and-message-for-brigadier-syntax-exc.patch | 0 .../server/More-Teleport-API.patch | 0 .../server/Nameable-Banner-API.patch | 0 .../server/Player.setPlayerProfile-API.patch | 2 +- ...mpty-items-from-being-added-to-world.patch | 0 ...entity-loading-causing-async-lookups.patch | 0 ...e-invalid-signature-login-stacktrace.patch | 19 ++++++++ .../Sanitize-Sent-BlockEntity-NBT.patch | 0 ...ck-entities-after-destroy-prediction.patch | 0 ...ook-changes-from-crashing-the-server.patch | 0 ...n-on-world-create-while-being-ticked.patch | 0 ...random-in-ServerLoginPacketListenerI.patch | 4 +- ...-on-plugins-accessing-faraway-chunks.patch | 0 ...ound-for-client-lag-spikes-MC-162253.patch | 0 ...rocess-cancelling-and-command-changi.patch | 48 ------------------- ...and-additions-to-the-SpawnReason-API.patch | 48 ------------------- ...e-invalid-signature-login-stacktrace.patch | 19 -------- 52 files changed, 39 insertions(+), 144 deletions(-) rename patches/{unapplied => }/server/Add-Alternate-Current-redstone-implementation.patch (99%) rename patches/{unapplied => }/server/Add-EntityPortalReadyEvent.patch (100%) rename patches/{unapplied => }/server/Add-NamespacedKey-biome-methods.patch (100%) rename patches/{unapplied => }/server/Add-Player-getFishHook.patch (100%) rename patches/{unapplied => }/server/Add-PlayerStopUsingItemEvent.patch (100%) rename patches/{unapplied => }/server/Add-Velocity-IP-Forwarding-Support.patch (97%) rename patches/{unapplied => }/server/Add-WardenAngerChangeEvent.patch (100%) rename patches/{unapplied => }/server/Add-async-catcher-to-PlayerConnection-internalTelepo.patch (100%) rename patches/{unapplied => }/server/Add-custom-destroyerIdentity-to-sendBlockDamage.patch (100%) rename patches/{unapplied => }/server/Add-missing-BlockFadeEvents.patch (100%) rename patches/{unapplied => }/server/Add-missing-important-BlockStateListPopulator-method.patch (100%) rename patches/{unapplied => }/server/Add-missing-spawn-eggs.patch (100%) rename patches/{unapplied => }/server/Add-option-for-strict-advancement-dimension-checks.patch (100%) rename patches/{unapplied => }/server/Add-some-minimal-debug-information-to-chat-packet-er.patch (62%) rename patches/{unapplied => }/server/Add-support-for-Proxy-Protocol.patch (94%) rename patches/{unapplied => }/server/Add-various-missing-EntityDropItemEvent-calls.patch (98%) rename patches/{unapplied => }/server/Block-Ticking-API.patch (100%) rename patches/{unapplied => }/server/Collision-API.patch (100%) rename patches/{unapplied => }/server/Custom-Chat-Completion-Suggestions-API.patch (100%) rename patches/{unapplied => }/server/Disable-component-selector-resolving-in-books-by-def.patch (100%) rename patches/{unapplied => }/server/Do-not-accept-invalid-client-settings.patch (100%) rename patches/{unapplied => }/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch (90%) rename patches/{unapplied => }/server/Don-t-broadcast-messages-to-command-blocks.patch (100%) rename patches/{unapplied => }/server/Don-t-print-component-in-resource-pack-rejection-mes.patch (100%) rename patches/{unapplied => }/server/Don-t-tick-markers.patch (100%) rename patches/{unapplied => }/server/Don-t-use-level-random-in-entity-constructors.patch (100%) rename patches/{unapplied => }/server/Dont-resent-entity-on-art-update.patch (100%) rename patches/{unapplied => }/server/FallingBlock-auto-expire-setting.patch (100%) rename patches/{unapplied => }/server/Fix-Bee-flower-NPE.patch (100%) rename patches/{unapplied => }/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch (100%) rename patches/{unapplied => }/server/Fix-EndDragonFight-killed-statuses-should-be-false-f.patch (100%) rename patches/{unapplied => }/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch (100%) rename patches/{unapplied => }/server/Fix-OfflinePlayer-getBedSpawnLocation.patch (100%) rename patches/{unapplied => }/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch (100%) rename patches/{unapplied => }/server/Fix-plugin-loggers-on-server-shutdown.patch (100%) rename patches/{unapplied => }/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch (100%) rename patches/{unapplied => }/server/More-Teleport-API.patch (100%) rename patches/{unapplied => }/server/Nameable-Banner-API.patch (100%) rename patches/{unapplied => }/server/Prevent-empty-items-from-being-added-to-world.patch (100%) rename patches/{unapplied => }/server/Prevent-entity-loading-causing-async-lookups.patch (100%) create mode 100644 patches/server/Remove-invalid-signature-login-stacktrace.patch rename patches/{unapplied => }/server/Sanitize-Sent-BlockEntity-NBT.patch (100%) rename patches/{unapplied => }/server/Send-block-entities-after-destroy-prediction.patch (100%) rename patches/{unapplied => }/server/Stop-large-look-changes-from-crashing-the-server.patch (100%) rename patches/{unapplied => }/server/Throw-exception-on-world-create-while-being-ticked.patch (100%) rename patches/{unapplied => }/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch (94%) rename patches/{unapplied => }/server/Warn-on-plugins-accessing-faraway-chunks.patch (100%) rename patches/{unapplied => }/server/Workaround-for-client-lag-spikes-MC-162253.patch (100%) delete mode 100644 patches/unapplied/server/Fix-command-preprocess-cancelling-and-command-changi.patch delete mode 100644 patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch delete mode 100644 patches/unapplied/server/Remove-invalid-signature-login-stacktrace.patch diff --git a/patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch b/patches/server/Add-Alternate-Current-redstone-implementation.patch similarity index 99% rename from patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch rename to patches/server/Add-Alternate-Current-redstone-implementation.patch index 067e84470e..adbdd6eab1 100644 --- a/patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/Add-Alternate-Current-redstone-implementation.patch @@ -2020,7 +2020,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - // Paper end - rewrite chunk system + return this.server.getWorldData().enabledFeatures(); } + // Paper start - optimize redstone (Alternate Current) diff --git a/patches/unapplied/server/Add-EntityPortalReadyEvent.patch b/patches/server/Add-EntityPortalReadyEvent.patch similarity index 100% rename from patches/unapplied/server/Add-EntityPortalReadyEvent.patch rename to patches/server/Add-EntityPortalReadyEvent.patch diff --git a/patches/unapplied/server/Add-NamespacedKey-biome-methods.patch b/patches/server/Add-NamespacedKey-biome-methods.patch similarity index 100% rename from patches/unapplied/server/Add-NamespacedKey-biome-methods.patch rename to patches/server/Add-NamespacedKey-biome-methods.patch diff --git a/patches/unapplied/server/Add-Player-getFishHook.patch b/patches/server/Add-Player-getFishHook.patch similarity index 100% rename from patches/unapplied/server/Add-Player-getFishHook.patch rename to patches/server/Add-Player-getFishHook.patch diff --git a/patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch b/patches/server/Add-PlayerStopUsingItemEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch rename to patches/server/Add-PlayerStopUsingItemEvent.patch diff --git a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch similarity index 97% rename from patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/Add-Velocity-IP-Forwarding-Support.patch index 975d55a587..19eba3627d 100644 --- a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/Add-Velocity-IP-Forwarding-Support.patch @@ -97,17 +97,17 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @Nullable - private ProfilePublicKey.Data profilePublicKeyData; + private ServerPlayer delayedAcceptPlayer; public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding + private int velocityLoginMessageId = -1; // Paper - Velocity support public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { this.state = ServerLoginPacketListenerImpl.State.HELLO; -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, this.state = ServerLoginPacketListenerImpl.State.KEY; - this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce)); + this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge)); } else { + // Paper start - Velocity support + if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) { @@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Spigot start // Paper start - Cache authenticator threads authenticatorPool.execute(new Runnable() { -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, public class LoginHandler { public void fireEvents() throws Exception { @@ -135,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, // Spigot end public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) { diff --git a/patches/unapplied/server/Add-WardenAngerChangeEvent.patch b/patches/server/Add-WardenAngerChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-WardenAngerChangeEvent.patch rename to patches/server/Add-WardenAngerChangeEvent.patch diff --git a/patches/unapplied/server/Add-async-catcher-to-PlayerConnection-internalTelepo.patch b/patches/server/Add-async-catcher-to-PlayerConnection-internalTelepo.patch similarity index 100% rename from patches/unapplied/server/Add-async-catcher-to-PlayerConnection-internalTelepo.patch rename to patches/server/Add-async-catcher-to-PlayerConnection-internalTelepo.patch diff --git a/patches/unapplied/server/Add-custom-destroyerIdentity-to-sendBlockDamage.patch b/patches/server/Add-custom-destroyerIdentity-to-sendBlockDamage.patch similarity index 100% rename from patches/unapplied/server/Add-custom-destroyerIdentity-to-sendBlockDamage.patch rename to patches/server/Add-custom-destroyerIdentity-to-sendBlockDamage.patch diff --git a/patches/unapplied/server/Add-missing-BlockFadeEvents.patch b/patches/server/Add-missing-BlockFadeEvents.patch similarity index 100% rename from patches/unapplied/server/Add-missing-BlockFadeEvents.patch rename to patches/server/Add-missing-BlockFadeEvents.patch diff --git a/patches/unapplied/server/Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/Add-missing-important-BlockStateListPopulator-method.patch similarity index 100% rename from patches/unapplied/server/Add-missing-important-BlockStateListPopulator-method.patch rename to patches/server/Add-missing-important-BlockStateListPopulator-method.patch diff --git a/patches/unapplied/server/Add-missing-spawn-eggs.patch b/patches/server/Add-missing-spawn-eggs.patch similarity index 100% rename from patches/unapplied/server/Add-missing-spawn-eggs.patch rename to patches/server/Add-missing-spawn-eggs.patch diff --git a/patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/Add-option-for-strict-advancement-dimension-checks.patch similarity index 100% rename from patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch rename to patches/server/Add-option-for-strict-advancement-dimension-checks.patch diff --git a/patches/unapplied/server/Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch similarity index 62% rename from patches/unapplied/server/Add-some-minimal-debug-information-to-chat-packet-er.patch rename to patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch index 19bf483165..e3de2081cf 100644 --- a/patches/unapplied/server/Add-some-minimal-debug-information-to-chat-packet-er.patch +++ b/patches/server/Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -11,19 +11,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { + private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { - ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); + ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper this.server.scheduleOnMain(() -> { // Paper - push to main - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause + this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca }); // Paper - push to main -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } - - if (message.hasExpiredServer(Instant.now())) { -- ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), message.signedContent().plain()); -+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper - } - - return true; diff --git a/patches/unapplied/server/Add-support-for-Proxy-Protocol.patch b/patches/server/Add-support-for-Proxy-Protocol.patch similarity index 94% rename from patches/unapplied/server/Add-support-for-Proxy-Protocol.patch rename to patches/server/Add-support-for-Proxy-Protocol.patch index 019d2f7fdc..f35a53516c 100644 --- a/patches/unapplied/server/Add-support-for-Proxy-Protocol.patch +++ b/patches/server/Add-support-for-Proxy-Protocol.patch @@ -10,12 +10,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { */ - implementation("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - implementation - annotationProcessor("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - Needed to generate meta for our Log4j plugins -+ implementation("io.netty:netty-codec-haproxy:4.1.77.Final") + implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation + annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins ++ implementation("io.netty:netty-codec-haproxy:4.1.77.Final") // Paper - Add support for proxy protocol // Paper end - implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper - implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1") // Paper + implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion + implementation("org.ow2.asm:asm:9.3") diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java diff --git a/patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch similarity index 98% rename from patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch rename to patches/server/Add-various-missing-EntityDropItemEvent-calls.patch index f7d42232b8..2c4fcdb35c 100644 --- a/patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch @@ -40,7 +40,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -0,0 +0,0 @@ public class Fox extends Animal { +@@ -0,0 +0,0 @@ public class Fox extends Animal implements VariantHolder { entityitem.setPickUpDelay(40); entityitem.setThrower(this.getUUID()); this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F); diff --git a/patches/unapplied/server/Block-Ticking-API.patch b/patches/server/Block-Ticking-API.patch similarity index 100% rename from patches/unapplied/server/Block-Ticking-API.patch rename to patches/server/Block-Ticking-API.patch diff --git a/patches/unapplied/server/Collision-API.patch b/patches/server/Collision-API.patch similarity index 100% rename from patches/unapplied/server/Collision-API.patch rename to patches/server/Collision-API.patch diff --git a/patches/unapplied/server/Custom-Chat-Completion-Suggestions-API.patch b/patches/server/Custom-Chat-Completion-Suggestions-API.patch similarity index 100% rename from patches/unapplied/server/Custom-Chat-Completion-Suggestions-API.patch rename to patches/server/Custom-Chat-Completion-Suggestions-API.patch diff --git a/patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/Disable-component-selector-resolving-in-books-by-def.patch similarity index 100% rename from patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch rename to patches/server/Disable-component-selector-resolving-in-books-by-def.patch diff --git a/patches/unapplied/server/Do-not-accept-invalid-client-settings.patch b/patches/server/Do-not-accept-invalid-client-settings.patch similarity index 100% rename from patches/unapplied/server/Do-not-accept-invalid-client-settings.patch rename to patches/server/Do-not-accept-invalid-client-settings.patch diff --git a/patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch similarity index 90% rename from patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch rename to patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch index eeebb36a15..cb95e3ee62 100644 --- a/patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch +++ b/patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch @@ -20,10 +20,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/gameevent/DynamicGameEventListener.java @@ -0,0 +0,0 @@ public class DynamicGameEventListener { - private static void ifChunkExists(LevelReader world, @Nullable SectionPos sectionPos, Consumer dispatcherConsumer) { + private static void ifChunkExists(LevelReader world, @Nullable SectionPos sectionPos, Consumer dispatcherConsumer) { if (sectionPos != null) { - ChunkAccess chunkAccess = world.getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.FULL, false); + ChunkAccess chunkAccess = world.getChunkIfLoadedImmediately(sectionPos.getX(), sectionPos.getZ()); // Paper - can cause sync loads while completing a chunk, resulting in deadlock if (chunkAccess != null) { - dispatcherConsumer.accept(chunkAccess.getEventDispatcher(sectionPos.y())); + dispatcherConsumer.accept(chunkAccess.getListenerRegistry(sectionPos.y())); } diff --git a/patches/unapplied/server/Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/Don-t-broadcast-messages-to-command-blocks.patch similarity index 100% rename from patches/unapplied/server/Don-t-broadcast-messages-to-command-blocks.patch rename to patches/server/Don-t-broadcast-messages-to-command-blocks.patch diff --git a/patches/unapplied/server/Don-t-print-component-in-resource-pack-rejection-mes.patch b/patches/server/Don-t-print-component-in-resource-pack-rejection-mes.patch similarity index 100% rename from patches/unapplied/server/Don-t-print-component-in-resource-pack-rejection-mes.patch rename to patches/server/Don-t-print-component-in-resource-pack-rejection-mes.patch diff --git a/patches/unapplied/server/Don-t-tick-markers.patch b/patches/server/Don-t-tick-markers.patch similarity index 100% rename from patches/unapplied/server/Don-t-tick-markers.patch rename to patches/server/Don-t-tick-markers.patch diff --git a/patches/unapplied/server/Don-t-use-level-random-in-entity-constructors.patch b/patches/server/Don-t-use-level-random-in-entity-constructors.patch similarity index 100% rename from patches/unapplied/server/Don-t-use-level-random-in-entity-constructors.patch rename to patches/server/Don-t-use-level-random-in-entity-constructors.patch diff --git a/patches/unapplied/server/Dont-resent-entity-on-art-update.patch b/patches/server/Dont-resent-entity-on-art-update.patch similarity index 100% rename from patches/unapplied/server/Dont-resent-entity-on-art-update.patch rename to patches/server/Dont-resent-entity-on-art-update.patch diff --git a/patches/unapplied/server/FallingBlock-auto-expire-setting.patch b/patches/server/FallingBlock-auto-expire-setting.patch similarity index 100% rename from patches/unapplied/server/FallingBlock-auto-expire-setting.patch rename to patches/server/FallingBlock-auto-expire-setting.patch diff --git a/patches/unapplied/server/Fix-Bee-flower-NPE.patch b/patches/server/Fix-Bee-flower-NPE.patch similarity index 100% rename from patches/unapplied/server/Fix-Bee-flower-NPE.patch rename to patches/server/Fix-Bee-flower-NPE.patch diff --git a/patches/unapplied/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch similarity index 100% rename from patches/unapplied/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch rename to patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch diff --git a/patches/unapplied/server/Fix-EndDragonFight-killed-statuses-should-be-false-f.patch b/patches/server/Fix-EndDragonFight-killed-statuses-should-be-false-f.patch similarity index 100% rename from patches/unapplied/server/Fix-EndDragonFight-killed-statuses-should-be-false-f.patch rename to patches/server/Fix-EndDragonFight-killed-statuses-should-be-false-f.patch diff --git a/patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch similarity index 100% rename from patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch rename to patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch diff --git a/patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch similarity index 100% rename from patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch rename to patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch diff --git a/patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch similarity index 100% rename from patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch rename to patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch diff --git a/patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/Fix-plugin-loggers-on-server-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch rename to patches/server/Fix-plugin-loggers-on-server-shutdown.patch diff --git a/patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch similarity index 100% rename from patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch rename to patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch diff --git a/patches/unapplied/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch similarity index 100% rename from patches/unapplied/server/More-Teleport-API.patch rename to patches/server/More-Teleport-API.patch diff --git a/patches/unapplied/server/Nameable-Banner-API.patch b/patches/server/Nameable-Banner-API.patch similarity index 100% rename from patches/unapplied/server/Nameable-Banner-API.patch rename to patches/server/Nameable-Banner-API.patch diff --git a/patches/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch index 4f4e19db8d..1353844fe6 100644 --- a/patches/server/Player.setPlayerProfile-API.patch +++ b/patches/server/Player.setPlayerProfile-API.patch @@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + //Respawn the player then update their position and selected slot + ServerLevel worldserver = handle.getLevel(); -+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), (byte) 1, this.getHandle().getLastDeathLocation())); ++ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), net.minecraft.network.protocol.game.ClientboundRespawnPacket.KEEP_ALL_DATA, this.getHandle().getLastDeathLocation())); + handle.onUpdateAbilities(); + connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle); diff --git a/patches/unapplied/server/Prevent-empty-items-from-being-added-to-world.patch b/patches/server/Prevent-empty-items-from-being-added-to-world.patch similarity index 100% rename from patches/unapplied/server/Prevent-empty-items-from-being-added-to-world.patch rename to patches/server/Prevent-empty-items-from-being-added-to-world.patch diff --git a/patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch b/patches/server/Prevent-entity-loading-causing-async-lookups.patch similarity index 100% rename from patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch rename to patches/server/Prevent-entity-loading-causing-async-lookups.patch diff --git a/patches/server/Remove-invalid-signature-login-stacktrace.patch b/patches/server/Remove-invalid-signature-login-stacktrace.patch new file mode 100644 index 0000000000..4b424f6d40 --- /dev/null +++ b/patches/server/Remove-invalid-signature-login-stacktrace.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke +Date: Fri, 10 Jun 2022 16:02:35 +0200 +Subject: [PATCH] Remove invalid signature login stacktrace + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.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 + + this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator, Duration.ZERO)); + } catch (ProfilePublicKey.ValidationException profilepublickey_b) { +- ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); ++ //ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log + this.disconnect(profilepublickey_b.getComponent()); + } + diff --git a/patches/unapplied/server/Sanitize-Sent-BlockEntity-NBT.patch b/patches/server/Sanitize-Sent-BlockEntity-NBT.patch similarity index 100% rename from patches/unapplied/server/Sanitize-Sent-BlockEntity-NBT.patch rename to patches/server/Sanitize-Sent-BlockEntity-NBT.patch diff --git a/patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch b/patches/server/Send-block-entities-after-destroy-prediction.patch similarity index 100% rename from patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch rename to patches/server/Send-block-entities-after-destroy-prediction.patch diff --git a/patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/Stop-large-look-changes-from-crashing-the-server.patch similarity index 100% rename from patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch rename to patches/server/Stop-large-look-changes-from-crashing-the-server.patch diff --git a/patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch similarity index 100% rename from patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch rename to patches/server/Throw-exception-on-world-create-while-being-ticked.patch diff --git a/patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch b/patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch similarity index 94% rename from patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch rename to patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch index a803196ba8..19f983fad2 100644 --- a/patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch +++ b/patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch @@ -8,12 +8,12 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListene index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0); static final Logger LOGGER = LogUtils.getLogger(); private static final int MAX_TICKS_BEFORE_LOGIN = 600; - private static final RandomSource RANDOM = RandomSource.create(); + private static final RandomSource RANDOM = new org.bukkit.craftbukkit.util.RandomSourceWrapper(new java.util.Random()); // Paper - This is called across threads, make safe - private final byte[] nonce; + private final byte[] challenge; final MinecraftServer server; public final Connection connection; diff --git a/patches/unapplied/server/Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/Warn-on-plugins-accessing-faraway-chunks.patch similarity index 100% rename from patches/unapplied/server/Warn-on-plugins-accessing-faraway-chunks.patch rename to patches/server/Warn-on-plugins-accessing-faraway-chunks.patch diff --git a/patches/unapplied/server/Workaround-for-client-lag-spikes-MC-162253.patch b/patches/server/Workaround-for-client-lag-spikes-MC-162253.patch similarity index 100% rename from patches/unapplied/server/Workaround-for-client-lag-spikes-MC-162253.patch rename to patches/server/Workaround-for-client-lag-spikes-MC-162253.patch diff --git a/patches/unapplied/server/Fix-command-preprocess-cancelling-and-command-changi.patch b/patches/unapplied/server/Fix-command-preprocess-cancelling-and-command-changi.patch deleted file mode 100644 index fcb7557ddb..0000000000 --- a/patches/unapplied/server/Fix-command-preprocess-cancelling-and-command-changi.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke -Date: Tue, 2 Aug 2022 19:16:23 +0200 -Subject: [PATCH] Fix command preprocess cancelling and command changing - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.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 - PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getCraftPlayer(), command, new LazyPlayerSet(this.server)); - this.cserver.getPluginManager().callEvent(event); - -- if (event.isCancelled()) { -- return; -- } - command = event.getMessage().substring(1); - -- ParseResults parseresults = this.parseCommand(command); -- Map map = (packet.command().equals(command)) ? this.collectSignedArguments(packet, PreviewableCommand.of(parseresults)) : Collections.emptyMap(); -+ // Paper start - send message headers for cancelled or changed commands -+ ParseResults parseresults = this.parseCommand(packet.command()); -+ Map map = this.collectSignedArguments(packet, PreviewableCommand.of(parseresults)); -+ if (event.isCancelled() || !packet.command().equals(command)) { -+ for (final PlayerChatMessage message : map.values()) { -+ player.server.getPlayerList().broadcastMessageHeader(message, Set.of()); -+ } -+ if (event.isCancelled()) { -+ return; -+ } -+ -+ // Remove signatures if the command was changed and use the changed command source stack -+ map.clear(); -+ parseresults = this.parseCommand(command); -+ } -+ // Paper end - // CraftBukkit end - Iterator iterator = map.values().iterator(); - -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } - }); - } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check -+ this.server.getPlayerList().broadcastMessageHeader(message, Set.of()); // Paper - this.send(new ClientboundSystemChatPacket(Component.translatable("chat.cannotSend").withStyle(ChatFormatting.RED), false)); - } else { - this.chat(s, message, true); diff --git a/patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch deleted file mode 100644 index ab87e0ba64..0000000000 --- a/patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Sun, 25 Sep 2022 11:21:01 -0700 -Subject: [PATCH] Fixes and additions to the SpawnReason API - -Fixes some wrong reasons, and adds missing spawn reasons for entities. - -Co-authored-by: Doc - -diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/EntityType.java -+++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -0,0 +0,0 @@ public class EntityType implements EntityTypeTest { - @Nullable - public T spawn(ServerLevel world, @Nullable CompoundTag itemNbt, @Nullable Component name, @Nullable Player player, BlockPos pos, MobSpawnType spawnReason, boolean alignPosition, boolean invertY) { - // CraftBukkit start -- return this.spawn(world, itemNbt, name, player, pos, spawnReason, alignPosition, invertY, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); -+ return this.spawn(world, itemNbt, name, player, pos, spawnReason, alignPosition, invertY, spawnReason == MobSpawnType.DISPENSER ? org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DISPENSE_EGG : org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // Paper - use correct spawn reason for dispenser spawn eggs - } - - @Nullable -diff --git a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java -+++ b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java -@@ -0,0 +0,0 @@ public class DragonFireball extends AbstractHurtingProjectile { - - if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper - this.level.levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1); -- this.level.addFreshEntity(areaEffectCloud); -+ this.level.addFreshEntity(areaEffectCloud, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EXPLOSION); // Paper - } else areaEffectCloud.discard(); // Paper - this.discard(); - } -diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java -@@ -0,0 +0,0 @@ public class FrogspawnBlock extends Block { - int k = random.nextInt(1, 361); - tadpole.moveTo(d, (double)pos.getY() - 0.5D, e, (float)k, 0.0F); - tadpole.setPersistenceRequired(); -- world.addFreshEntity(tadpole); -+ world.addFreshEntity(tadpole, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG); // Paper - } - - } diff --git a/patches/unapplied/server/Remove-invalid-signature-login-stacktrace.patch b/patches/unapplied/server/Remove-invalid-signature-login-stacktrace.patch deleted file mode 100644 index 4bb30846eb..0000000000 --- a/patches/unapplied/server/Remove-invalid-signature-login-stacktrace.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke -Date: Fri, 10 Jun 2022 16:02:35 +0200 -Subject: [PATCH] Remove invalid signature login stacktrace - - -diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se - - profilepublickey = ServerLoginPacketListenerImpl.validatePublicKey(this.profilePublicKeyData, this.gameProfile.getId(), signaturevalidator, this.server.enforceSecureProfile()); - } catch (ProfilePublicKey.ValidationException profilepublickey_b) { -- ServerLoginPacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); -+ // ServerLoginPacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log - if (!this.connection.isMemoryConnection()) { - this.disconnect(profilepublickey_b.getComponent()); - return;