From c972a4898fd53f0325b289a623659029b265f2b6 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 7 Jun 2022 23:06:17 -0700 Subject: [PATCH] bundle o' patches --- .../server/Add-BellRingEvent.patch | 2 +- ...al-open-container-api-to-HumanEntity.patch | 0 .../Add-methods-to-get-translation-keys.patch | 0 ...keLighting-call-to-World-spigot-stri.patch | 0 .../server/Add-moon-phase-API.patch | 0 .../server/Add-more-Evoker-API.patch | 0 ...yPickupItemAnimation-to-LivingEntity.patch | 0 .../server/Add-setMaxPlayers-API.patch | 0 ...Add-zombie-targets-turtle-egg-config.patch | 0 .../server/Brand-support.patch | 14 +++------- .../server/Buffer-joins-to-world.patch | 0 ...taFixerUpper-Rewrite-Rules-on-demand.patch | 2 +- .../server/Cache-block-data-strings.patch | 2 +- ...ate-HoverEvent-from-ItemStack-Entity.patch | 0 ...erver-load-chunks-from-newer-version.patch | 0 ...rty-in-invalid-locations-SPIGOT-6086.patch | 0 .../server/Don-t-require-FACING-data.patch | 0 .../Eigencraft-redstone-implementation.patch | 2 +- .../server/Entity-isTicking.patch | 0 ...y-Counter-to-allow-plugins-to-use-va.patch | 0 ...p-capture-to-capture-all-items-added.patch | 0 ...ataPlayer-leak-due-from-quitting-ear.patch | 2 +- ...-Concurrency-issue-in-ShufflingList.patch} | 8 +++--- .../server/Fix-CraftTeam-null-check.patch | 0 ...ortation-and-cancel-velocity-if-tele.patch | 14 +++++----- ...-5885-Unable-to-disable-advancements.patch | 2 +- ...geEvent-not-firing-for-all-use-cases.patch | 0 ...-non-whitelisted-player-when-white-l.patch | 2 +- ...rs-not-working-in-some-kick-messages.patch | 27 +++++++------------ ...istake-in-CB-NBT-int-deserialization.patch | 0 ...Fix-some-rails-connecting-improperly.patch | 2 +- ...mprove-Chunk-Status-Transition-Speed.patch | 0 ...-track-plugin-scoreboards-by-default.patch | 0 ...CreateEvent-needs-to-know-its-entity.patch | 6 ++--- ...-headless-pistons-from-being-created.patch | 0 ...Reset-Ender-Crystals-on-Dragon-Spawn.patch | 0 36 files changed, 35 insertions(+), 50 deletions(-) rename patches/{unapplied => }/server/Add-BellRingEvent.patch (95%) rename patches/{unapplied => }/server/Add-additional-open-container-api-to-HumanEntity.patch (100%) rename patches/{unapplied => }/server/Add-methods-to-get-translation-keys.patch (100%) rename patches/{unapplied => }/server/Add-missing-strikeLighting-call-to-World-spigot-stri.patch (100%) rename patches/{unapplied => }/server/Add-moon-phase-API.patch (100%) rename patches/{unapplied => }/server/Add-more-Evoker-API.patch (100%) rename patches/{unapplied => }/server/Add-playPickupItemAnimation-to-LivingEntity.patch (100%) rename patches/{unapplied => }/server/Add-setMaxPlayers-API.patch (100%) rename patches/{unapplied => }/server/Add-zombie-targets-turtle-egg-config.patch (100%) rename patches/{unapplied => }/server/Brand-support.patch (87%) rename patches/{unapplied => }/server/Buffer-joins-to-world.patch (100%) rename patches/{unapplied => }/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch (96%) rename patches/{unapplied => }/server/Cache-block-data-strings.patch (96%) rename patches/{unapplied => }/server/Create-HoverEvent-from-ItemStack-Entity.patch (100%) rename patches/{unapplied => }/server/Do-not-let-the-server-load-chunks-from-newer-version.patch (100%) rename patches/{unapplied => }/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch (100%) rename patches/{unapplied => }/server/Don-t-require-FACING-data.patch (100%) rename patches/{unapplied => }/server/Eigencraft-redstone-implementation.patch (99%) rename patches/{unapplied => }/server/Entity-isTicking.patch (100%) rename patches/{unapplied => }/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch (100%) rename patches/{unapplied => }/server/Extend-block-drop-capture-to-capture-all-items-added.patch (100%) rename patches/{unapplied => }/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch (98%) rename patches/{unapplied/server/Fix-Concurrency-issue-in-WeightedList.patch => server/Fix-Concurrency-issue-in-ShufflingList.patch} (93%) rename patches/{unapplied => }/server/Fix-CraftTeam-null-check.patch (100%) rename patches/{unapplied => }/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch (90%) rename patches/{unapplied => }/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch (92%) rename patches/{unapplied => }/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch (100%) rename patches/{unapplied => }/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch (92%) rename patches/{unapplied => }/server/Fix-hex-colors-not-working-in-some-kick-messages.patch (56%) rename patches/{unapplied => }/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch (100%) rename patches/{unapplied => }/server/Fix-some-rails-connecting-improperly.patch (98%) rename patches/{unapplied => }/server/Improve-Chunk-Status-Transition-Speed.patch (100%) rename patches/{unapplied => }/server/Lazily-track-plugin-scoreboards-by-default.patch (100%) rename patches/{unapplied => }/server/PortalCreateEvent-needs-to-know-its-entity.patch (98%) rename patches/{unapplied => }/server/Prevent-headless-pistons-from-being-created.patch (100%) rename patches/{unapplied => }/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch (100%) diff --git a/patches/unapplied/server/Add-BellRingEvent.patch b/patches/server/Add-BellRingEvent.patch similarity index 95% rename from patches/unapplied/server/Add-BellRingEvent.patch rename to patches/server/Add-BellRingEvent.patch index 9ad0b5d8c5..ad51b0b6db 100644 --- a/patches/unapplied/server/Add-BellRingEvent.patch +++ b/patches/server/Add-BellRingEvent.patch @@ -25,4 +25,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!new io.papermc.paper.event.block.BellRingEvent(world.getWorld().getBlockAt(MCUtil.toLocation(world, pos)), entity == null ? null : entity.getBukkitEntity()).callEvent()) return false; // Paper - BellRingEvent ((BellBlockEntity)blockEntity).onHit(direction); world.playSound((Player)null, pos, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 2.0F, 1.0F); - world.gameEvent(entity, GameEvent.RING_BELL, pos); + world.gameEvent(entity, GameEvent.BLOCK_CHANGE, pos); diff --git a/patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/unapplied/server/Add-methods-to-get-translation-keys.patch b/patches/server/Add-methods-to-get-translation-keys.patch similarity index 100% rename from patches/unapplied/server/Add-methods-to-get-translation-keys.patch rename to patches/server/Add-methods-to-get-translation-keys.patch diff --git a/patches/unapplied/server/Add-missing-strikeLighting-call-to-World-spigot-stri.patch b/patches/server/Add-missing-strikeLighting-call-to-World-spigot-stri.patch similarity index 100% rename from patches/unapplied/server/Add-missing-strikeLighting-call-to-World-spigot-stri.patch rename to patches/server/Add-missing-strikeLighting-call-to-World-spigot-stri.patch diff --git a/patches/unapplied/server/Add-moon-phase-API.patch b/patches/server/Add-moon-phase-API.patch similarity index 100% rename from patches/unapplied/server/Add-moon-phase-API.patch rename to patches/server/Add-moon-phase-API.patch diff --git a/patches/unapplied/server/Add-more-Evoker-API.patch b/patches/server/Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Evoker-API.patch rename to patches/server/Add-more-Evoker-API.patch diff --git a/patches/unapplied/server/Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/Add-playPickupItemAnimation-to-LivingEntity.patch similarity index 100% rename from patches/unapplied/server/Add-playPickupItemAnimation-to-LivingEntity.patch rename to patches/server/Add-playPickupItemAnimation-to-LivingEntity.patch diff --git a/patches/unapplied/server/Add-setMaxPlayers-API.patch b/patches/server/Add-setMaxPlayers-API.patch similarity index 100% rename from patches/unapplied/server/Add-setMaxPlayers-API.patch rename to patches/server/Add-setMaxPlayers-API.patch diff --git a/patches/unapplied/server/Add-zombie-targets-turtle-egg-config.patch b/patches/server/Add-zombie-targets-turtle-egg-config.patch similarity index 100% rename from patches/unapplied/server/Add-zombie-targets-turtle-egg-config.patch rename to patches/server/Add-zombie-targets-turtle-egg-config.patch diff --git a/patches/unapplied/server/Brand-support.patch b/patches/server/Brand-support.patch similarity index 87% rename from patches/unapplied/server/Brand-support.patch rename to patches/server/Brand-support.patch index 1f69f7cb2a..e004797b17 100644 --- a/patches/unapplied/server/Brand-support.patch +++ b/patches/server/Brand-support.patch @@ -8,23 +8,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 @@ import net.minecraft.nbt.CompoundTag; - import net.minecraft.nbt.ListTag; - import net.minecraft.nbt.StringTag; - import net.minecraft.network.Connection; -+import net.minecraft.network.FriendlyByteBuf; - import net.minecraft.network.chat.ChatType; - import net.minecraft.network.chat.Component; - import net.minecraft.network.chat.MutableComponent; @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit + private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper + private String clientBrandName = null; // Paper - Brand name + public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { + this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); this.server = server; - this.connection = connection; @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); @@ -41,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Brand support + if (packet.identifier.equals(MINECRAFT_BRAND)) { + try { -+ this.clientBrandName = new FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256); ++ this.clientBrandName = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256); + } catch (StringIndexOutOfBoundsException ex) { + this.clientBrandName = "illegal"; + } diff --git a/patches/unapplied/server/Buffer-joins-to-world.patch b/patches/server/Buffer-joins-to-world.patch similarity index 100% rename from patches/unapplied/server/Buffer-joins-to-world.patch rename to patches/server/Buffer-joins-to-world.patch diff --git a/patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 96% rename from patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch index dbe2725dd3..1092489202 100644 --- a/patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch +++ b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch @@ -51,4 +51,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (versionKey < minDataFixPrecacheVersion) continue; // Paper final Schema schema = schemas.get(versionKey); for (final String typeName : schema.types()) { - CompletableFuture.runAsync(() -> { + final CompletableFuture future = CompletableFuture.runAsync(() -> { diff --git a/patches/unapplied/server/Cache-block-data-strings.patch b/patches/server/Cache-block-data-strings.patch similarity index 96% rename from patches/unapplied/server/Cache-block-data-strings.patch rename to patches/server/Cache-block-data-strings.patch index 839700cc8e..a817a2945b 100644 --- a/patches/unapplied/server/Cache-block-data-strings.patch +++ b/patches/server/Cache-block-data-strings.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop Date: Mon, 6 Jul 2020 18:36:41 -0400 -Subject: [PATCH] Fix Concurrency issue in WeightedList +Subject: [PATCH] Fix Concurrency issue in ShufflingList if multiple threads from worldgen sort at same time, it will crash. So make a copy of the list for sorting purposes. @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final GateBehavior.OrderPolicy orderPolicy; private final GateBehavior.RunningPolicy runningPolicy; - private final ShufflingList> behaviors = new ShufflingList<>(); -+ private final ShufflingList> behaviors = new ShufflingList<>(false); // Paper - don't use a clone ++ private final ShufflingList> behaviors = new ShufflingList<>(false); // Paper - don't use a clone public GateBehavior(Map, MemoryStatus> requiredMemoryState, Set> memoriesToForgetWhenStopped, GateBehavior.OrderPolicy order, GateBehavior.RunningPolicy runMode, List, Integer>> tasks) { super(requiredMemoryState); @@ -23,10 +23,10 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java -@@ -0,0 +0,0 @@ import java.util.stream.Stream; +@@ -0,0 +0,0 @@ import net.minecraft.util.RandomSource; public class ShufflingList { protected final List> entries; - private final Random random = new Random(); + private final RandomSource random = RandomSource.create(); + private final boolean isUnsafe; // Paper public ShufflingList() { diff --git a/patches/unapplied/server/Fix-CraftTeam-null-check.patch b/patches/server/Fix-CraftTeam-null-check.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftTeam-null-check.patch rename to patches/server/Fix-CraftTeam-null-check.patch diff --git a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch similarity index 90% rename from patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch rename to patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index d7ae05ea08..29afdccde6 100644 --- a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -13,11 +13,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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, Ser - public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); - if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit + return; + } + - this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); -+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper setPositionRotation for teleportation ++ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper moveTo for teleportation this.lastGoodX = this.awaitingPositionFromClient.x; this.lastGoodY = this.awaitingPositionFromClient.y; this.lastGoodZ = this.awaitingPositionFromClient.z; @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.awaitingTeleportTime = this.tickCount; - this.player.absMoveTo(d0, d1, d2, f, f1); -+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation ++ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper moveTo for teleportation this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag)); } @@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + entity.preserveMotion = true; // Paper - preserve entity motion from tag - entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), world.random.nextFloat() * 360.0F, 0.0F); + entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), randomsource.nextFloat() * 360.0F, 0.0F); if (entity instanceof Mob) { Mob entityinsentient = (Mob) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // entity.setLocation() throws no event, and so cannot be cancelled - this.entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); -+ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper setPosition, as per vanilla teleporting ++ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper moveTo, as per vanilla teleporting // SPIGOT-619: Force sync head rotation also this.entity.setYHeadRot(location.getYaw()); diff --git a/patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 92% rename from patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch index 32a6ebafe8..df7f1f719e 100644 --- a/patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch +++ b/patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch @@ -15,4 +15,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + org.spigotmc.SpigotConfig.disabledAdvancements = spigotConfiguration.getStringList("advancements.disabled"); // Paper - fix SPIGOT-5885, must be set early in init // Paper start - fix SPIGOT-5824 File file; - File userCacheFile = new File("usercache.json"); + File userCacheFile = new File(Services.USERID_CACHE_FILE); diff --git a/patches/unapplied/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch similarity index 100% rename from patches/unapplied/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch rename to patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch diff --git a/patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 92% rename from patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 1038fd6561..226f36d7c9 100644 --- a/patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -22,6 +22,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (!whitelist.isWhiteListed(entityplayer.getGameProfile())) { + if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) - entityplayer.connection.disconnect(new TranslatableComponent("multiplayer.disconnect.not_whitelisted")); + entityplayer.connection.disconnect(Component.translatable("multiplayer.disconnect.not_whitelisted")); } } diff --git a/patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 56% rename from patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch index c692c90f35..db4cbef1de 100644 --- a/patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch +++ b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); -- TranslatableComponent chatmessage = new TranslatableComponent(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message +- MutableComponent chatmessage = Component.literal(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message + Component chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage, true)[0]; // Paper - Configurable connection throttle kick message // Paper - Fix hex colors not working in some kick messages this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); this.connection.disconnect(chatmessage); @@ -21,18 +21,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // CraftBukkit end if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { -- TranslatableComponent chatmessage; -+ Component chatmessage; // Paper - Fix hex colors not working in some kick messages +- MutableComponent ichatmutablecomponent; ++ Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages if (packet.getProtocolVersion() < 754) { -- chatmessage = new TranslatableComponent( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot -+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages +- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot ++ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } else { -- chatmessage = new TranslatableComponent( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot -+ chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages +- ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot ++ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } - this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); + this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent)); 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 @@ -41,15 +41,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start @Deprecated public void disconnect(String s) { -- try { -- Component ichatbasecomponent = new TextComponent(s); -- ServerLoginPacketListenerImpl.LOGGER.info("Disconnecting {}: {}", this.getUserName(), s); -- this.connection.send(new ClientboundLoginDisconnectPacket(ichatbasecomponent)); -- this.connection.disconnect(ichatbasecomponent); -- } catch (Exception exception) { -- ServerLoginPacketListenerImpl.LOGGER.error("Error whilst disconnecting player", exception); -- } -+ disconnect(org.bukkit.craftbukkit.util.CraftChatMessage.fromString(s, true)[0]); // Paper - Fix hex colors not working in some kick messages +- this.disconnect(Component.literal(s)); ++ this.disconnect(org.bukkit.craftbukkit.util.CraftChatMessage.fromString(s, true)[0]); // Paper - Fix hex colors not working in some kick messages } // CraftBukkit end diff --git a/patches/unapplied/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch similarity index 100% rename from patches/unapplied/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch rename to patches/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch diff --git a/patches/unapplied/server/Fix-some-rails-connecting-improperly.patch b/patches/server/Fix-some-rails-connecting-improperly.patch similarity index 98% rename from patches/unapplied/server/Fix-some-rails-connecting-improperly.patch rename to patches/server/Fix-some-rails-connecting-improperly.patch index b020b21597..171206c08b 100644 --- a/patches/unapplied/server/Fix-some-rails-connecting-improperly.patch +++ b/patches/server/Fix-some-rails-connecting-improperly.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl state = this.updateDir(world, pos, state, true); if (this.isStraight) { - state.neighborChanged(world, pos, this, pos, notify); + world.neighborChanged(state, pos, this, pos, notify); + state = world.getBlockState(pos); // Paper - don't desync, update again } diff --git a/patches/unapplied/server/Improve-Chunk-Status-Transition-Speed.patch b/patches/server/Improve-Chunk-Status-Transition-Speed.patch similarity index 100% rename from patches/unapplied/server/Improve-Chunk-Status-Transition-Speed.patch rename to patches/server/Improve-Chunk-Status-Transition-Speed.patch diff --git a/patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/Lazily-track-plugin-scoreboards-by-default.patch similarity index 100% rename from patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/Lazily-track-plugin-scoreboards-by-default.patch diff --git a/patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/PortalCreateEvent-needs-to-know-its-entity.patch similarity index 98% rename from patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch rename to patches/server/PortalCreateEvent-needs-to-know-its-entity.patch index b9442b9409..0ae135cde8 100644 --- a/patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch +++ b/patches/server/PortalCreateEvent-needs-to-know-its-entity.patch @@ -55,9 +55,9 @@ diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java -@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPos; - import net.minecraft.core.Direction; +@@ -0,0 +0,0 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; + import net.minecraft.util.RandomSource; import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.BlockGetter; @@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + world.scheduleTick(blockposition, this, getFireTickDelay(world.random)); } - private static int getFireTickDelay(Random random) { + private static int getFireTickDelay(RandomSource random) { diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java diff --git a/patches/unapplied/server/Prevent-headless-pistons-from-being-created.patch b/patches/server/Prevent-headless-pistons-from-being-created.patch similarity index 100% rename from patches/unapplied/server/Prevent-headless-pistons-from-being-created.patch rename to patches/server/Prevent-headless-pistons-from-being-created.patch diff --git a/patches/unapplied/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch b/patches/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch similarity index 100% rename from patches/unapplied/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch rename to patches/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch