From 9e63e24f0b04756a3c079e9a274a63449602e1aa Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Fri, 22 Sep 2023 17:35:51 +0200 Subject: [PATCH] more more more more more more more more more more work --- .../server/Add-EntityPortalReadyEvent.patch | 0 .../Add-NamespacedKey-biome-methods.patch | 0 .../server/Add-Player-getFishHook.patch | 0 .../Add-Velocity-IP-Forwarding-Support.patch | 22 +++++++++---------- ...arameter-to-ProjectileSource-launchP.patch | 2 +- .../Add-and-fix-missing-BlockFadeEvents.patch | 0 ...-debug-information-to-chat-packet-er.patch | 2 +- ...us-missing-EntityDropItemEvent-calls.patch | 0 ...-serialization-deserialization-for-P.patch | 0 .../server/Block-Ticking-API.patch | 0 .../Call-BlockPhysicsEvent-more-often.patch | 4 ++-- .../server/Collision-API.patch | 0 .../Configurable-chat-thread-limit.patch | 0 ...stom-Chat-Completion-Suggestions-API.patch | 0 ...-chunk-for-dynamic-game-event-listen.patch | 0 ...broadcast-messages-to-command-blocks.patch | 0 ...-level-random-in-entity-constructors.patch | 0 ...ntityChangeBlockEvent-in-more-places.patch | 2 +- .../server/Fix-Bee-flower-NPE.patch | 0 ...shPotion-and-LingeringPotion-spawnin.patch | 0 ...g-not-using-commands.spam-exclusions.patch | 2 +- ...ix-plugin-loggers-on-server-shutdown.patch | 0 ...and-message-for-brigadier-syntax-exc.patch | 0 .../server/Missing-eating-regain-reason.patch | 2 +- .../server/Missing-effect-cause.patch | 8 +++---- .../server/More-Teleport-API.patch | 2 +- ...mpty-items-from-being-added-to-world.patch | 0 ...ck-entities-after-destroy-prediction.patch | 2 +- ...ook-changes-from-crashing-the-server.patch | 0 ...random-in-ServerLoginPacketListenerI.patch | 3 +-- ...-on-plugins-accessing-faraway-chunks.patch | 0 ...onent-in-resource-pack-rejection-mes.patch | 19 ---------------- 32 files changed, 25 insertions(+), 45 deletions(-) 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-Velocity-IP-Forwarding-Support.patch (94%) rename patches/{unapplied => }/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch (94%) rename patches/{unapplied => }/server/Add-and-fix-missing-BlockFadeEvents.patch (100%) rename patches/{unapplied => }/server/Add-some-minimal-debug-information-to-chat-packet-er.patch (94%) rename patches/{unapplied => }/server/Add-various-missing-EntityDropItemEvent-calls.patch (100%) rename patches/{unapplied => }/server/Added-byte-array-serialization-deserialization-for-P.patch (100%) rename patches/{unapplied => }/server/Block-Ticking-API.patch (100%) rename patches/{unapplied => }/server/Call-BlockPhysicsEvent-more-often.patch (90%) rename patches/{unapplied => }/server/Collision-API.patch (100%) rename patches/{unapplied => }/server/Configurable-chat-thread-limit.patch (100%) rename patches/{unapplied => }/server/Custom-Chat-Completion-Suggestions-API.patch (100%) rename patches/{unapplied => }/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch (100%) rename patches/{unapplied => }/server/Don-t-broadcast-messages-to-command-blocks.patch (100%) rename patches/{unapplied => }/server/Don-t-use-level-random-in-entity-constructors.patch (100%) rename patches/{unapplied => }/server/Fire-EntityChangeBlockEvent-in-more-places.patch (99%) 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-Spigot-Config-not-using-commands.spam-exclusions.patch (92%) 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/Missing-eating-regain-reason.patch (98%) rename patches/{unapplied => }/server/Missing-effect-cause.patch (90%) rename patches/{unapplied => }/server/More-Teleport-API.patch (99%) rename patches/{unapplied => }/server/Prevent-empty-items-from-being-added-to-world.patch (100%) rename patches/{unapplied => }/server/Send-block-entities-after-destroy-prediction.patch (98%) rename patches/{unapplied => }/server/Stop-large-look-changes-from-crashing-the-server.patch (100%) rename patches/{unapplied => }/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch (88%) rename patches/{unapplied => }/server/Warn-on-plugins-accessing-faraway-chunks.patch (100%) delete mode 100644 patches/unapplied/server/Don-t-print-component-in-resource-pack-rejection-mes.patch 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-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch similarity index 94% rename from patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/Add-Velocity-IP-Forwarding-Support.patch index 870060835f..7a12b0b129 100644 --- a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/Add-Velocity-IP-Forwarding-Support.patch @@ -127,8 +127,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 ServerLoginPacketListener, - @Nullable - private ServerPlayer delayedAcceptPlayer; + private final String serverId; + private ServerPlayer player; // CraftBukkit public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding + private int velocityLoginMessageId = -1; // Paper - Velocity support @@ -154,20 +154,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, public class LoginHandler { - public void fireEvents() throws Exception { + public void fireEvents(GameProfile gameprofile) throws Exception { + // Paper start - Velocity support + if (ServerLoginPacketListenerImpl.this.velocityLoginMessageId == -1 && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) { + disconnect("This server requires you to connect with Velocity."); + return; + } + // Paper end - String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); + String playerName = gameprofile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); - java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.channel.remoteAddress()).getAddress(); // Paper @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - // Spigot end - public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) { + @Override + public void handleCustomQueryPacket(ServerboundCustomQueryAnswerPacket packet) { + // Paper start - Velocity support + if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled && packet.getTransactionId() == this.velocityLoginMessageId) { + net.minecraft.network.FriendlyByteBuf buf = packet.getData(); @@ -193,23 +193,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + this.connection.address = new java.net.InetSocketAddress(com.destroystokyo.paper.proxy.VelocityProxy.readAddress(buf), port); + -+ this.gameProfile = com.destroystokyo.paper.proxy.VelocityProxy.createProfile(buf); ++ this.authenticatedProfile = com.destroystokyo.paper.proxy.VelocityProxy.createProfile(buf); + + //TODO Update handling for lazy sessions, might not even have to do anything? + + // Proceed with login + authenticatorPool.execute(() -> { + try { -+ new LoginHandler().fireEvents(); ++ new LoginHandler().fireEvents(this.authenticatedProfile); + } catch (Exception ex) { + disconnect("Failed to verify username!"); -+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + gameProfile.getName(), ex); ++ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + this.authenticatedProfile.getName(), ex); + } + }); + return; + } + // Paper end - this.disconnect(Component.translatable("multiplayer.disconnect.unexpected_query_response")); + this.disconnect(ServerLoginPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch similarity index 94% rename from patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch rename to patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch index 36e4a3cc13..617082a2d0 100644 --- a/patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch +++ b/patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - launchProjectile consumer Preconditions.checkArgument(this.getBlock().getType() == Material.DISPENSER, "Block is no longer dispenser"); // Copied from BlockDispenser.dispense() - BlockSourceImpl isourceblock = new BlockSourceImpl((ServerLevel) this.dispenserBlock.getLevel(), this.dispenserBlock.getBlockPos()); + BlockSource sourceblock = new BlockSource((ServerLevel) this.dispenserBlock.getLevel(), this.dispenserBlock.getBlockPos(), this.dispenserBlock.getBlockState(), this.dispenserBlock); @@ -0,0 +0,0 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { if (velocity != null) { ((T) launch.getBukkitEntity()).setVelocity(velocity); diff --git a/patches/unapplied/server/Add-and-fix-missing-BlockFadeEvents.patch b/patches/server/Add-and-fix-missing-BlockFadeEvents.patch similarity index 100% rename from patches/unapplied/server/Add-and-fix-missing-BlockFadeEvents.patch rename to patches/server/Add-and-fix-missing-BlockFadeEvents.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 94% 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 586111a963..61799f4c4a 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 @@ -9,7 +9,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 private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { diff --git a/patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch similarity index 100% rename from patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch rename to patches/server/Add-various-missing-EntityDropItemEvent-calls.patch diff --git a/patches/unapplied/server/Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/Added-byte-array-serialization-deserialization-for-P.patch similarity index 100% rename from patches/unapplied/server/Added-byte-array-serialization-deserialization-for-P.patch rename to patches/server/Added-byte-array-serialization-deserialization-for-P.patch 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/Call-BlockPhysicsEvent-more-often.patch b/patches/server/Call-BlockPhysicsEvent-more-often.patch similarity index 90% rename from patches/unapplied/server/Call-BlockPhysicsEvent-more-often.patch rename to patches/server/Call-BlockPhysicsEvent-more-often.patch index 5f6184f77f..9ddf222308 100644 --- a/patches/unapplied/server/Call-BlockPhysicsEvent-more-often.patch +++ b/patches/server/Call-BlockPhysicsEvent-more-often.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public boolean runNext(Level world) { BlockPos blockPos = this.sourcePos.relative(NeighborUpdater.UPDATE_ORDER[this.idx++]); BlockState blockState = world.getBlockState(blockPos); -- blockState.neighborChanged(world, blockPos, this.sourceBlock, this.sourcePos, false); +- NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, this.sourcePos, false); + // Paper start + try { + boolean cancelled = false; @@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + if (!cancelled) { // continue to check for adjacent block (increase idx) -+ blockState.neighborChanged(world, blockPos, this.sourceBlock, this.sourcePos, false); ++ NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, this.sourcePos, false); + } + } catch (StackOverflowError ex) { + world.lastPhysicsProblem = new BlockPos(blockPos); 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/Configurable-chat-thread-limit.patch b/patches/server/Configurable-chat-thread-limit.patch similarity index 100% rename from patches/unapplied/server/Configurable-chat-thread-limit.patch rename to patches/server/Configurable-chat-thread-limit.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/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 100% 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 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-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/Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch similarity index 99% rename from patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch rename to patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch index 56232f75bd..df95a33601 100644 --- a/patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch @@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - Optional optional = LightningBolt.randomStepCleaningCopper(world, mutablePos); + Optional optional = LightningBolt.randomStepCleaningCopper(world, mutablePos, lightning); // Paper - transmit LightningBolt instance to call EntityChangeBlockEvent - if (!optional.isPresent()) { + if (optional.isEmpty()) { break; @@ -0,0 +0,0 @@ public class LightningBolt extends Entity { 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-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch similarity index 92% 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 index c139de5427..013093e461 100644 --- 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 @@ -8,7 +8,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 } // Spigot end // this.chatSpamTickCount += 20; 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/Missing-eating-regain-reason.patch b/patches/server/Missing-eating-regain-reason.patch similarity index 98% rename from patches/unapplied/server/Missing-eating-regain-reason.patch rename to patches/server/Missing-eating-regain-reason.patch index e74080555b..8bba6326db 100644 --- a/patches/unapplied/server/Missing-eating-regain-reason.patch +++ b/patches/server/Missing-eating-regain-reason.patch @@ -21,7 +21,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider +@@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl } else { boolean bl = this.getHealth() < this.getMaxHealth(); if (bl) { diff --git a/patches/unapplied/server/Missing-effect-cause.patch b/patches/server/Missing-effect-cause.patch similarity index 90% rename from patches/unapplied/server/Missing-effect-cause.patch rename to patches/server/Missing-effect-cause.patch index a45525fe62..deddc32cb7 100644 --- a/patches/unapplied/server/Missing-effect-cause.patch +++ b/patches/server/Missing-effect-cause.patch @@ -35,11 +35,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java +++ b/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java @@ -0,0 +0,0 @@ public class SuspiciousStewItem extends Item { - @Override public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity user) { ItemStack itemStack = super.finishUsingItem(stack, world, user); -- listPotionEffects(itemStack, user::addEffect); -+ listPotionEffects(itemStack, effect -> user.addEffect(effect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD)); // Paper + listPotionEffects(itemStack, (effect) -> { +- user.addEffect(effect.createEffectInstance()); ++ user.addEffect(effect.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper + }); return user instanceof Player && ((Player)user).getAbilities().instabuild ? itemStack : new ItemStack(Items.BOWL); } - } diff --git a/patches/unapplied/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch similarity index 99% rename from patches/unapplied/server/More-Teleport-API.patch rename to patches/server/More-Teleport-API.patch index 1ddd441001..9afafe0dca 100644 --- a/patches/unapplied/server/More-Teleport-API.patch +++ b/patches/server/More-Teleport-API.patch @@ -10,7 +10,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 return false; // CraftBukkit - Return event status } 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/Send-block-entities-after-destroy-prediction.patch b/patches/server/Send-block-entities-after-destroy-prediction.patch similarity index 98% rename from patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch rename to patches/server/Send-block-entities-after-destroy-prediction.patch index ca707eac8c..003929d2e0 100644 --- a/patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch +++ b/patches/server/Send-block-entities-after-destroy-prediction.patch @@ -60,7 +60,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 return; } // Paper end - Don't allow digging in unloaded chunks 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/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch b/patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch similarity index 88% rename from patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch rename to patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch index 19f983fad2..283d116f94 100644 --- a/patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch +++ b/patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch @@ -9,10 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 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 Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response"); + 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[] challenge; final MinecraftServer server; 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/Don-t-print-component-in-resource-pack-rejection-mes.patch b/patches/unapplied/server/Don-t-print-component-in-resource-pack-rejection-mes.patch deleted file mode 100644 index 4f8e2f296c..0000000000 --- a/patches/unapplied/server/Don-t-print-component-in-resource-pack-rejection-mes.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: pop4959 -Date: Fri, 1 Jul 2022 22:00:06 -0700 -Subject: [PATCH] Don't print component in resource pack rejection message - - -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 - public void handleResourcePackResponse(ServerboundResourcePackPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); - if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { -- ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); -+ ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getGameProfile().getName()); // Paper - Don't print component in resource pack rejection message - this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - add cause - } - // Paper start