diff --git a/patches/unapplied/server/0008-Adventure.patch b/patches/server/0008-Adventure.patch similarity index 95% rename from patches/unapplied/server/0008-Adventure.patch rename to patches/server/0008-Adventure.patch index c5582d33ed..aeb61cea8c 100644 --- a/patches/unapplied/server/0008-Adventure.patch +++ b/patches/server/0008-Adventure.patch @@ -1148,7 +1148,7 @@ index 021a26a6b1c258deffc26c035ab52a4ea027d9a1..00d432bd395e7f7fb6ee24e371818d13 try { int i = friendlyByteBuf.writerIndex(); diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java -index d19b8ccc791c3f135603b950008136ae6d2f0bfb..bbfb98618a0b87406cc48465bdda15a0a4974b7e 100644 +index 06736982f7625c1a532315afe94e5e0c45ec1331..e7d9e2d8c87ddf3658b1c2e0f2a3e98ef8080cec 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java +++ b/src/main/java/net/minecraft/network/chat/Component.java @@ -1,6 +1,7 @@ @@ -1159,7 +1159,7 @@ index d19b8ccc791c3f135603b950008136ae6d2f0bfb..bbfb98618a0b87406cc48465bdda15a0 import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; -@@ -200,6 +201,7 @@ public interface Component extends Message, FormattedText, Iterable { +@@ -216,6 +217,7 @@ public interface Component extends Message, FormattedText, Iterable { GsonBuilder gsonbuilder = new GsonBuilder(); gsonbuilder.disableHtmlEscaping(); @@ -1167,7 +1167,7 @@ index d19b8ccc791c3f135603b950008136ae6d2f0bfb..bbfb98618a0b87406cc48465bdda15a0 gsonbuilder.registerTypeHierarchyAdapter(Component.class, new Component.Serializer()); gsonbuilder.registerTypeHierarchyAdapter(Style.class, new Style.Serializer()); gsonbuilder.registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory()); -@@ -375,6 +377,7 @@ public interface Component extends Message, FormattedText, Iterable { +@@ -391,6 +393,7 @@ public interface Component extends Message, FormattedText, Iterable { } public JsonElement serialize(Component ichatbasecomponent, Type type, JsonSerializationContext jsonserializationcontext) { @@ -1175,48 +1175,6 @@ index d19b8ccc791c3f135603b950008136ae6d2f0bfb..bbfb98618a0b87406cc48465bdda15a0 JsonObject jsonobject = new JsonObject(); if (!ichatbasecomponent.getStyle().isEmpty()) { -diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java -index fc2d39d93f88d71af503c20c497be7385ec312eb..285c9197bd716febb158464a1c791337e1d43995 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerChatPacket.java -@@ -14,9 +14,20 @@ import net.minecraft.network.chat.PlayerChatMessage; - import net.minecraft.network.protocol.Packet; - import net.minecraft.util.Crypt; - --public record ClientboundPlayerChatPacket(Component signedContent, Optional unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet { -+// Paper start -+public record ClientboundPlayerChatPacket(@org.jetbrains.annotations.Nullable net.kyori.adventure.text.Component adventure$message, Component signedContent, Optional unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) implements Packet { - private static final Duration MESSAGE_EXPIRES_AFTER = ServerboundChatPacket.MESSAGE_EXPIRES_AFTER.plus(Duration.ofMinutes(2L)); - -+ public ClientboundPlayerChatPacket(Component signedContent, Optional unsignedContent, int typeId, ChatSender sender, Instant timeStamp, Crypt.SaltSignaturePair saltSignature) { -+ this(null, signedContent, unsignedContent, typeId, sender, timeStamp, saltSignature); -+ } -+ -+ @Deprecated // doesn't support signed messages -+ public ClientboundPlayerChatPacket(net.kyori.adventure.text.Component adventure$message, int typeId, ChatSender sender, Instant timeStamp) { -+ this(adventure$message, Component.empty(), Optional.empty(), typeId, sender, timeStamp, net.minecraft.util.Crypt.SaltSignaturePair.EMPTY); -+ } -+ // Paper end -+ - public ClientboundPlayerChatPacket(FriendlyByteBuf buf) { - this(buf.readComponent(), buf.readOptional(FriendlyByteBuf::readComponent), buf.readVarInt(), new ChatSender(buf), buf.readInstant(), new Crypt.SaltSignaturePair(buf)); - } -@@ -24,7 +35,15 @@ public record ClientboundPlayerChatPacket(Component signedContent, Optional { -+public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.adventure.text.Component adventure$content, @javax.annotation.Nullable String content, int typeId) implements Packet { // Paper - Adventure +-public record ClientboundSystemChatPacket(String content, boolean overlay) implements Packet { ++public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.adventure.text.Component adventure$content, @javax.annotation.Nullable String content, boolean overlay) implements Packet { // Paper - Adventure - public ClientboundSystemChatPacket(Component content, int typeId) { -- this(Component.Serializer.toJson(content), typeId); -+ this(null, Component.Serializer.toJson(content), typeId); // Paper - Adventure + public ClientboundSystemChatPacket(Component content, boolean overlay) { +- this(Component.Serializer.toJson(content), overlay); ++ this(null, Component.Serializer.toJson(content), overlay); // Paper - Adventure } - public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, int typeId) { -- this(net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId); -+ this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId); // Paper - Adventure + public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, boolean overlay) { +- this(net.md_5.bungee.chat.ComponentSerializer.toString(content), overlay); ++ this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), overlay); // Paper - Adventure } // Spigot end + // Paper start @@ -1315,14 +1273,14 @@ index 32b391d7c4c21813db204957286a11970267a3bd..cfcdb21f48f74ea1638907e966f06c4a + com.google.common.base.Preconditions.checkArgument(!(adventure$content == null && content == null), "Component adventure$content and String (json) content cannot both be null"); + } + -+ public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, int typeId) { -+ this(content, null, typeId); ++ public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, boolean overlay) { ++ this(content, null, overlay); + } + // Paper end public ClientboundSystemChatPacket(FriendlyByteBuf buf) { - this(buf.readComponent(), buf.readVarInt()); -@@ -26,7 +35,15 @@ public record ClientboundSystemChatPacket(String content, int typeId) implements + this(buf.readComponent(), buf.readBoolean()); +@@ -23,7 +32,15 @@ public record ClientboundSystemChatPacket(String content, boolean overlay) imple @Override public void write(FriendlyByteBuf buf) { @@ -1335,7 +1293,7 @@ index 32b391d7c4c21813db204957286a11970267a3bd..cfcdb21f48f74ea1638907e966f06c4a + throw new IllegalArgumentException("Must supply either adventure component or string json content"); + } + // Paper end - buf.writeVarInt(this.typeId); + buf.writeBoolean(this.overlay); } diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundTabListPacket.java @@ -1368,10 +1326,10 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490 buf.writeComponent(this.footer); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1ad7797dbef61f8e8011ae6db3089939a279071c..327a8f3806d4b3a42f0a7691d578725bf47742fa 100644 +index 3aadba90ab32388b9e8ef96f182fa263c760f53b..acc5ce86ae8aa5ada21e6c97f7921caca4b0bd00 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -227,6 +227,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - if (!future.isSuccess()) { -@@ -1758,6 +1756,7 @@ public class ServerPlayer extends Player { + this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> { + boolean flag1 = true; +@@ -1751,6 +1749,7 @@ public class ServerPlayer extends Player { } public String locale = "en_us"; // CraftBukkit - add, lowercase @@ -1461,7 +1419,7 @@ index d04f0819df55480fefa3ac5807658b05b3a6441a..59f918a7c2eb2cd9f3f63a6cb8285815 public void updateOptions(ServerboundClientInformationPacket packet) { // CraftBukkit start if (getMainArm() != packet.mainHand()) { -@@ -1769,6 +1768,10 @@ public class ServerPlayer extends Player { +@@ -1762,6 +1761,10 @@ public class ServerPlayer extends Player { this.server.server.getPluginManager().callEvent(event); } this.locale = packet.language; @@ -1473,10 +1431,10 @@ index d04f0819df55480fefa3ac5807658b05b3a6441a..59f918a7c2eb2cd9f3f63a6cb8285815 // CraftBukkit end this.chatVisibility = packet.chatVisibility(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad730221c7319cd 100644 +index 13f996d163739f419b701854b5248a02edfc93c0..11e4dc3d8fbe48b5ec9d771a851f0ac69694e394 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -172,6 +172,8 @@ import org.apache.commons.lang3.StringUtils; +@@ -187,6 +187,8 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; // CraftBukkit start @@ -1484,8 +1442,8 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 +import io.papermc.paper.adventure.PaperAdventure; // Paper import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; - import net.minecraft.world.entity.animal.Bucketable; -@@ -413,21 +415,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + import net.minecraft.network.chat.OutgoingPlayerChatMessage; +@@ -441,14 +443,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return this.server.isSingleplayerOwner(this.player.getGameProfile()); } @@ -1509,7 +1467,19 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 // CraftBukkit start - fire PlayerKickEvent if (this.processedDisconnect) { return; +@@ -457,7 +462,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + Waitable waitable = new Waitable() { + @Override + protected Object evaluate() { +- ServerGamePacketListenerImpl.this.disconnect(s); ++ ServerGamePacketListenerImpl.this.disconnect(reason); // Paper - adventure + return null; + } + }; +@@ -474,9 +479,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + return; } + - String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game."; + net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure @@ -1518,17 +1488,16 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); -@@ -439,8 +444,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -488,7 +493,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent // Send the possibly modified leave message -- s = event.getReason(); -- final Component ichatbasecomponent = CraftChatMessage.fromString(s, true)[0]; +- final Component ichatbasecomponent = CraftChatMessage.fromString(event.getReason(), true)[0]; + final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end - this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> { -@@ -1720,9 +1724,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { +@@ -1785,9 +1790,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic */ this.player.disconnect(); @@ -1538,12 +1507,12 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 + // Paper start - Adventure + net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().remove(this.player); + if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) { -+ this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM); ++ this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); + // Paper end } // CraftBukkit end this.player.getTextFilter().leave(); -@@ -1947,7 +1953,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2039,7 +2046,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin @@ -1556,8 +1525,8 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 + } else if (false) { // Paper Player player = this.getCraftPlayer(); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); - this.cserver.getPluginManager().callEvent(event); -@@ -2861,30 +2872,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + String originalFormat = event.getFormat(), originalMessage = event.getMessage(); +@@ -3076,30 +3088,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } @@ -1571,14 +1540,14 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 + List lines = new java.util.ArrayList<>(); for (int i = 0; i < signText.size(); ++i) { - FilteredText filteredtext = (signText.get(i)).map(Component::literal); // CraftBukkit - decompile error + FilteredText filteredtext = (FilteredText) signText.get(i); if (this.player.isTextFilteringEnabled()) { -- lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString()); -+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrElse(CommonComponents.EMPTY).getString())); // Paper - adventure +- lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrEmpty()); ++ lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty())); // Paper - adventure } else { -- lines[i] = ChatFormatting.stripFormatting(filteredtext.raw().getString()); -+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw().getString())); // Paper - adventure +- lines[i] = ChatFormatting.stripFormatting(filteredtext.raw()); ++ lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw())); // Paper - adventure } } SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines); @@ -1596,10 +1565,10 @@ index 3e1a2faf97eeb376daef139ac8eb51c0bf2246f6..2e690a50420386690fa78d107ad73022 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index fc2910ee691da96591811e4c97987ebd2cb93ac3..ff8773f3671970bd759303f7a4bbc17d4df5a1de 100644 +index fed3a8c5a23f3a7b279f209aaaab5f6ffa3f137c..5054c3208d1723a33a96d23edcbc9f1483b879e5 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -377,7 +377,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -379,7 +379,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { @@ -1608,7 +1577,7 @@ index fc2910ee691da96591811e4c97987ebd2cb93ac3..ff8773f3671970bd759303f7a4bbc17d } Waitable waitable = new Waitable() { @Override -@@ -388,12 +388,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -390,12 +390,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable); if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { @@ -1637,7 +1606,7 @@ index 3a587073dbe5e8a599d342c5f758d842b7b6cddb..a426adfba3fccf1815177e0b8065684c @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054efb108b8 100644 +index ba6f4e9f74a524201390bd0e9106a6cf6afe0375..8a015bc9009fbd4877231777b1c6cdc4ae0124be 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils; @@ -1648,15 +1617,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 import java.io.File; import java.net.SocketAddress; import java.nio.file.Path; -@@ -100,6 +101,7 @@ import net.minecraft.world.scores.Team; - import org.slf4j.Logger; - - // CraftBukkit start -+import io.papermc.paper.adventure.PaperAdventure; // Paper - import com.google.common.base.Predicate; - import java.util.stream.Collectors; - import net.minecraft.server.dedicated.DedicatedServer; -@@ -262,7 +264,7 @@ public abstract class PlayerList { +@@ -264,7 +265,7 @@ public abstract class PlayerList { } // CraftBukkit start ichatmutablecomponent.withStyle(ChatFormatting.YELLOW); @@ -1665,7 +1626,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); this.players.add(player); -@@ -276,19 +278,18 @@ public abstract class PlayerList { +@@ -278,16 +279,18 @@ public abstract class PlayerList { // Ensure that player inventory is populated with its viewer player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); @@ -1681,16 +1642,13 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 + final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); - if (joinMessage != null && joinMessage.length() > 0) { -- for (Component line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) { -- this.server.getPlayerList().broadcastSystemMessage(line, ChatType.SYSTEM); -- } + if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure + joinMessage = PaperAdventure.asVanilla(jm); // Paper - Adventure -+ this.server.getPlayerList().broadcastSystemMessage(joinMessage, ChatType.SYSTEM); // Paper - Adventure - } - // CraftBukkit end - -@@ -485,7 +486,7 @@ public abstract class PlayerList { ++ this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure + for (Component line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) { + this.server.getPlayerList().broadcastSystemMessage(line, false); + } +@@ -487,7 +490,7 @@ public abstract class PlayerList { } @@ -1699,7 +1657,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 ServerLevel worldserver = entityplayer.getLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); -@@ -496,7 +497,7 @@ public abstract class PlayerList { +@@ -498,7 +501,7 @@ public abstract class PlayerList { entityplayer.closeContainer(); } @@ -1708,7 +1666,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); -@@ -549,7 +550,7 @@ public abstract class PlayerList { +@@ -551,7 +554,7 @@ public abstract class PlayerList { this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); // CraftBukkit end @@ -1717,7 +1675,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 } // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer -@@ -595,10 +596,10 @@ public abstract class PlayerList { +@@ -597,10 +600,10 @@ public abstract class PlayerList { } // return chatmessage; @@ -1730,7 +1688,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); -@@ -608,17 +609,17 @@ public abstract class PlayerList { +@@ -610,17 +613,17 @@ public abstract class PlayerList { } // return chatmessage; @@ -1751,7 +1709,7 @@ index 2fc5519020af0f18e93bf11cc0d33f65f1b23b55..9e0c61b63cc402c26ca1306313ca6054 return null; } return entity; -@@ -1126,7 +1127,7 @@ public abstract class PlayerList { +@@ -1128,7 +1131,7 @@ public abstract class PlayerList { public void removeAll() { // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { @@ -2525,7 +2483,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b5842cc22df06d6d8d984d6378fcf791e9c8bfe3..6da824e20f960414d0a183943366cec5f8c693c0 100644 +index cadafdfd3469b6f813f5e0add116640313fb6209..3fe120364ac61d40d6d8b16339e3086a3c0ac512 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -269,14 +269,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2771,7 +2729,7 @@ index b5842cc22df06d6d8d984d6378fcf791e9c8bfe3..6da824e20f960414d0a183943366cec5 + public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { + if (getHandle().connection == null) return; + final net.minecraft.core.Registry chatTypeRegistry = this.getHandle().level.registryAccess().registryOrThrow(net.minecraft.core.Registry.CHAT_TYPE_REGISTRY); -+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, chatTypeRegistry.getId(chatTypeRegistry.get(net.minecraft.network.chat.ChatType.SYSTEM)))); ++ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, type == net.kyori.adventure.audience.MessageType.SYSTEM)); + } + + @Override @@ -3712,7 +3670,7 @@ index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f53318 boolean hadFormat = false; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0d0a5b436ff68d49cf7a043127818bd474562b4b..43e31362a980a4f300864321224bdf3ca92110ff 100644 +index 8c5165c449f740e51aad3f41405aaad1cfe5c657..a9a900f09b95d84b53adbe0405c322d36b6edad1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -69,6 +69,38 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0009-Paper-command.patch b/patches/server/0009-Paper-command.patch similarity index 99% rename from patches/unapplied/server/0009-Paper-command.patch rename to patches/server/0009-Paper-command.patch index 59b2a9e70d..82aa9db917 100644 --- a/patches/unapplied/server/0009-Paper-command.patch +++ b/patches/server/0009-Paper-command.patch @@ -547,7 +547,7 @@ index 0000000000000000000000000000000000000000..ae60bd96b5284d54676d8e7e4dd5d170 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index e476f93547f386ded0174693a6218d793ccc450b..393e465b0bac55d407f2ec66d7b11ed0537c9641 100644 +index 08ae7a96e93c0d8547f560b3f753804525621c6b..8f29bb843fc456384f7b4e216afca5018fb7f794 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -191,6 +191,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface diff --git a/patches/unapplied/server/0010-Not-implemeneted.patch b/patches/server/0010-Not-implemeneted.patch similarity index 100% rename from patches/unapplied/server/0010-Not-implemeneted.patch rename to patches/server/0010-Not-implemeneted.patch diff --git a/patches/unapplied/server/0011-Paper-Metrics.patch b/patches/server/0011-Paper-Metrics.patch similarity index 99% rename from patches/unapplied/server/0011-Paper-Metrics.patch rename to patches/server/0011-Paper-Metrics.patch index 37974e62f8..d15b306441 100644 --- a/patches/unapplied/server/0011-Paper-Metrics.patch +++ b/patches/server/0011-Paper-Metrics.patch @@ -690,7 +690,7 @@ index 0000000000000000000000000000000000000000..5a19e30a9b7e65a70f68a429b8ca741f + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 393e465b0bac55d407f2ec66d7b11ed0537c9641..408eff59b081ace53bf435947df17e2fe75bfd5e 100644 +index 8f29bb843fc456384f7b4e216afca5018fb7f794..f4a6a6addbba65b3415320977048aeba0eadba63 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -192,6 +192,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface diff --git a/patches/unapplied/server/0012-Timings-v2.patch b/patches/server/0012-Timings-v2.patch similarity index 96% rename from patches/unapplied/server/0012-Timings-v2.patch rename to patches/server/0012-Timings-v2.patch index 6dcdb8a998..39fccf532a 100644 --- a/patches/unapplied/server/0012-Timings-v2.patch +++ b/patches/server/0012-Timings-v2.patch @@ -695,7 +695,7 @@ index 0000000000000000000000000000000000000000..0fda52841b5e1643efeda92106124998 + } +} diff --git a/src/main/java/net/minecraft/commands/CommandFunction.java b/src/main/java/net/minecraft/commands/CommandFunction.java -index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..b94038e2da0f986403c1ec9b27384344e2bb22f0 100644 +index eb434d46add6960dba026a03ec3c582a4277bfbd..04adaa6f393be8c3dfa13f371e6bc51082d1d1be 100644 --- a/src/main/java/net/minecraft/commands/CommandFunction.java +++ b/src/main/java/net/minecraft/commands/CommandFunction.java @@ -16,6 +16,15 @@ import net.minecraft.server.ServerFunctionManager; @@ -729,10 +729,10 @@ index 13421daa96b4ba302581f36abcd730952713d8cd..049e64c355d5f064009b1107ad15d28c } catch (Exception exception) { if (listener.shouldPropagateHandlingExceptions()) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 327a8f3806d4b3a42f0a7691d578725bf47742fa..53b04533ea2a9783e281507e996804357946f7d5 100644 +index acc5ce86ae8aa5ada21e6c97f7921caca4b0bd00..35df8fb2d2818df21fe3bd8832d9d81ce3a66233 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -175,7 +175,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; +@@ -177,7 +177,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent; import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end @@ -741,7 +741,7 @@ index 327a8f3806d4b3a42f0a7691d578725bf47742fa..53b04533ea2a9783e281507e99680435 public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { -@@ -852,6 +852,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { @@ -1019,7 +1019,7 @@ index 91fd4243416c41b1c2b0f0f1abc154064c164a25..e01d86c50e0227cfae91ba8022b763e5 ChunkPos chunkcoordintpair = chunkHolder.getPos(); ProtoChunk protochunk = (ProtoChunk) ichunkaccess; LevelChunk chunk; -@@ -877,6 +880,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -878,6 +881,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } return chunk; @@ -1027,7 +1027,7 @@ index 91fd4243416c41b1c2b0f0f1abc154064c164a25..e01d86c50e0227cfae91ba8022b763e5 }); }, (runnable) -> { ProcessorHandle mailbox = this.mainThreadMailbox; -@@ -1429,6 +1433,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1430,6 +1434,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -1035,7 +1035,7 @@ index 91fd4243416c41b1c2b0f0f1abc154064c164a25..e01d86c50e0227cfae91ba8022b763e5 ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -1453,14 +1458,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1454,14 +1459,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -1146,7 +1146,7 @@ index 186a8f5895fedbaf27a7949d9bdbb1a9f2e36fbf..86acdd910eebb8beac4536942119c9e9 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedeec94ffb91 100644 +index 95c3273d2379509cf6cd51a718f18b8697908932..1d4d60fa861b5e819c59f06168a096688d06e656 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1,6 +1,8 @@ @@ -1158,7 +1158,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee import com.google.common.collect.Lists; import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; -@@ -156,7 +158,6 @@ import org.slf4j.Logger; +@@ -157,7 +159,6 @@ import org.slf4j.Logger; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.WeatherType; @@ -1166,7 +1166,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; import org.bukkit.craftbukkit.util.CraftNamespacedKey; -@@ -446,7 +447,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -447,7 +448,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.updateSkyBrightness(); this.tickTime(); gameprofilerfiller.popPush("tickPending"); @@ -1175,7 +1175,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee if (!this.isDebug()) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); -@@ -455,12 +456,16 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -456,12 +457,16 @@ public class ServerLevel extends Level implements WorldGenLevel { this.fluidTicks.tick(j, 65536, this::tickFluid); gameprofilerfiller.pop(); } @@ -1193,7 +1193,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee gameprofilerfiller.popPush("blockEvents"); timings.doSounds.startTiming(); // Spigot this.runBlockEvents(); -@@ -627,6 +632,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -628,6 +633,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.popPush("tickBlocks"); @@ -1201,7 +1201,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee if (randomTickSpeed > 0) { LevelChunkSection[] achunksection = chunk.getSections(); int l = achunksection.length; -@@ -659,6 +665,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -660,6 +666,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -1209,7 +1209,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee gameprofilerfiller.pop(); } -@@ -893,14 +900,22 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -894,14 +901,22 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void tickNonPassenger(Entity entity) { @@ -1233,7 +1233,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee entity.setOldPosAndRot(); ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -919,7 +934,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -920,7 +935,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(entity, entity1); } @@ -1242,7 +1242,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee } -@@ -961,6 +976,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -962,6 +977,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit @@ -1250,7 +1250,7 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -970,7 +986,10 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -971,7 +987,10 @@ public class ServerLevel extends Level implements WorldGenLevel { progressListener.progressStage(Component.translatable("menu.savingChunks")); } @@ -1262,18 +1262,18 @@ index 58da012345126bbfc9980538adf3f79bd87412bb..a14386502e9b3ccec23233db2ddfedee this.entityManager.saveAll(); } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2e690a50420386690fa78d107ad730221c7319cd..70db08a398fb2461e9580ad2f75276f1a000fa06 100644 +index 11e4dc3d8fbe48b5ec9d771a851f0ac69694e394..fda4d570ef04e91c4e6c29c52221c04937dc4fbc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -311,7 +311,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - // CraftBukkit end +@@ -339,7 +339,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + @Override public void tick() { - org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot if (this.ackBlockChangesUpTo > -1) { this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); this.ackBlockChangesUpTo = -1; -@@ -392,7 +391,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -420,7 +419,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect(Component.translatable("multiplayer.disconnect.idling")); } @@ -1281,7 +1281,7 @@ index 2e690a50420386690fa78d107ad730221c7319cd..70db08a398fb2461e9580ad2f75276f1 this.chatPreviewThrottler.tick(); } -@@ -2022,7 +2020,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2146,7 +2144,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } private void handleCommand(String s) { @@ -1290,7 +1290,7 @@ index 2e690a50420386690fa78d107ad730221c7319cd..70db08a398fb2461e9580ad2f75276f1 if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2032,7 +2030,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2156,7 +2154,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1299,7 +1299,7 @@ index 2e690a50420386690fa78d107ad730221c7319cd..70db08a398fb2461e9580ad2f75276f1 return; } -@@ -2045,7 +2043,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2169,7 +2167,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -1309,7 +1309,7 @@ index 2e690a50420386690fa78d107ad730221c7319cd..70db08a398fb2461e9580ad2f75276f1 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9e0c61b63cc402c26ca1306313ca6054efb108b8..dbd53de61057eb9eb8be651abf9abcad18423ab1 100644 +index 8a015bc9009fbd4877231777b1c6cdc4ae0124be..bffd4efcbe50609b134b2bf498dc393e7ef70850 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1,5 +1,6 @@ @@ -1319,7 +1319,7 @@ index 9e0c61b63cc402c26ca1306313ca6054efb108b8..dbd53de61057eb9eb8be651abf9abcad import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1017,10 +1018,11 @@ public abstract class PlayerList { +@@ -1021,10 +1022,11 @@ public abstract class PlayerList { } public void saveAll() { @@ -1333,7 +1333,7 @@ index 9e0c61b63cc402c26ca1306313ca6054efb108b8..dbd53de61057eb9eb8be651abf9abcad public UserWhiteList getWhiteList() { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 4ab6e75929ba34bcea6558ab51c8c551d6f70b02..358042454272243663de7f82a77c21c35714a62a 100644 +index 331686c382fa88c0fd32056e2c68c3078341f4b7..47a05aa42739f4cfce828c0de42b4f1da467093e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -132,7 +132,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -1425,7 +1425,7 @@ index cdf8020194f2ec1fe7b65b22c8e1f5b1c23eaefa..2db27f5e3e3c1bb0502c055f78c4a81e } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1f9701128aedb0343709866207f3044b890fe1be..3e1e2d9711c3c1b05406353f96d706c8abfe7a61 100644 +index c4f91b80add5d79d999aa49c5da6dab094a24694..8221ec36a6453aea8a2249fde93ebc8fbd9d7e22 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1445,17 +1445,20 @@ index 1f9701128aedb0343709866207f3044b890fe1be..3e1e2d9711c3c1b05406353f96d706c8 super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); -@@ -2836,9 +2835,7 @@ public abstract class LivingEntity extends Entity { +@@ -2836,12 +2835,6 @@ public abstract class LivingEntity extends Entity { } } -- SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot - this.aiStep(); -- SpigotTimings.timerEntityTickRest.startTiming(); // Spigot +- if (!this.isRemoved()) { +- SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot +- this.aiStep(); +- SpigotTimings.timerEntityTickRest.startTiming(); // Spigot +- } +- double d0 = this.getX() - this.xo; double d1 = this.getZ() - this.zo; float f = (float) (d0 * d0 + d1 * d1); -@@ -2918,8 +2915,6 @@ public abstract class LivingEntity extends Entity { +@@ -2921,8 +2914,6 @@ public abstract class LivingEntity extends Entity { if (this.isSleeping()) { this.setXRot(0.0F); } @@ -1464,7 +1467,7 @@ index 1f9701128aedb0343709866207f3044b890fe1be..3e1e2d9711c3c1b05406353f96d706c8 } public void detectEquipmentUpdates() { -@@ -3101,7 +3096,6 @@ public abstract class LivingEntity extends Entity { +@@ -3104,7 +3095,6 @@ public abstract class LivingEntity extends Entity { this.setDeltaMovement(d4, d5, d6); this.level.getProfiler().push("ai"); @@ -1472,7 +1475,7 @@ index 1f9701128aedb0343709866207f3044b890fe1be..3e1e2d9711c3c1b05406353f96d706c8 if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; -@@ -3111,7 +3105,6 @@ public abstract class LivingEntity extends Entity { +@@ -3114,7 +3104,6 @@ public abstract class LivingEntity extends Entity { this.serverAiStep(); this.level.getProfiler().pop(); } @@ -1480,7 +1483,7 @@ index 1f9701128aedb0343709866207f3044b890fe1be..3e1e2d9711c3c1b05406353f96d706c8 this.level.getProfiler().pop(); this.level.getProfiler().push("jump"); -@@ -3146,9 +3139,9 @@ public abstract class LivingEntity extends Entity { +@@ -3149,9 +3138,9 @@ public abstract class LivingEntity extends Entity { this.updateFallFlying(); AABB axisalignedbb = this.getBoundingBox(); @@ -1492,7 +1495,7 @@ index 1f9701128aedb0343709866207f3044b890fe1be..3e1e2d9711c3c1b05406353f96d706c8 this.level.getProfiler().pop(); this.level.getProfiler().push("freezing"); boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); -@@ -3177,9 +3170,7 @@ public abstract class LivingEntity extends Entity { +@@ -3180,9 +3169,7 @@ public abstract class LivingEntity extends Entity { this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } @@ -1550,7 +1553,7 @@ index 0fa91ed5ed41c944f7398a88f9352742f34d4af5..39d64f3aeb998df5452699e098148d86 CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking entity"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being ticked"); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 950c468cad2937cd9a077a8f7a3d227662576a9a..60c5d4c97a340120f49f51b3d1dc7e6f2a19a936 100644 +index d0dca357cfd7e563fc7deb4f6048cf466605938f..4b3dc4648709abbdd6ac0972c298a64a875e5f6c 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -91,6 +91,15 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -1839,12 +1842,12 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6da824e20f960414d0a183943366cec5f8c693c0..3d7ad34b9fefd2a3f064866c6a3464a9389005e1 100644 +index 3fe120364ac61d40d6d8b16339e3086a3c0ac512..7a95748f52ef064af3173deedc229ec0b5f65cac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2281,6 +2281,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2275,6 +2275,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, i)); + CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR)); } + + // Paper start @@ -2035,7 +2038,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae this.value = value; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 43e31362a980a4f300864321224bdf3ca92110ff..cf49ba1e6a8b7f62deefbbf2fc645034d5d27bef 100644 +index a9a900f09b95d84b53adbe0405c322d36b6edad1..4f1945f854f4a022184ca4756b59d08b01693d6b 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch similarity index 100% rename from patches/unapplied/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch rename to patches/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch diff --git a/patches/unapplied/server/0014-Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/0014-Configurable-cactus-bamboo-and-reed-growth-heights.patch similarity index 100% rename from patches/unapplied/server/0014-Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/0014-Configurable-cactus-bamboo-and-reed-growth-heights.patch diff --git a/patches/unapplied/server/0015-Configurable-baby-zombie-movement-speed.patch b/patches/server/0015-Configurable-baby-zombie-movement-speed.patch similarity index 100% rename from patches/unapplied/server/0015-Configurable-baby-zombie-movement-speed.patch rename to patches/server/0015-Configurable-baby-zombie-movement-speed.patch diff --git a/patches/unapplied/server/0016-Configurable-fishing-time-ranges.patch b/patches/server/0016-Configurable-fishing-time-ranges.patch similarity index 100% rename from patches/unapplied/server/0016-Configurable-fishing-time-ranges.patch rename to patches/server/0016-Configurable-fishing-time-ranges.patch diff --git a/patches/unapplied/server/0017-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/0017-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch similarity index 100% rename from patches/unapplied/server/0017-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch rename to patches/server/0017-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch diff --git a/patches/unapplied/server/0018-Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/0018-Add-configurable-despawn-distances-for-living-entiti.patch similarity index 100% rename from patches/unapplied/server/0018-Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/0018-Add-configurable-despawn-distances-for-living-entiti.patch diff --git a/patches/unapplied/server/0019-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0019-Allow-for-toggling-of-spawn-chunks.patch similarity index 100% rename from patches/unapplied/server/0019-Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/0019-Allow-for-toggling-of-spawn-chunks.patch diff --git a/patches/unapplied/server/0020-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0020-Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 100% rename from patches/unapplied/server/0020-Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/0020-Drop-falling-block-and-tnt-entities-at-the-specified.patch diff --git a/patches/unapplied/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch similarity index 98% rename from patches/unapplied/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index a74c44eae8..e41dbdf3af 100644 --- a/patches/unapplied/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 53b04533ea2a9783e281507e996804357946f7d5..722d9a37b2132a246dbb8e19d4e393be684e0f6f 100644 +index 35df8fb2d2818df21fe3bd8832d9d81ce3a66233..c7660c2c9c5e1fb166ba6a3216f14e5fa934528d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1416,7 +1416,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop lastDeathLocation; @Nullable public FishingHook fishing; @@ -117,7 +117,7 @@ index 7c5918f84d2b8f9c778258b7e7d745105effb082..cfb286020b8ee87bad7edbda4cd0b999 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3d7ad34b9fefd2a3f064866c6a3464a9389005e1..5d0d2ac00589da28d26d1efafdea9be22e341af4 100644 +index 7a95748f52ef064af3173deedc229ec0b5f65cac..dc4b1772bb447d84592f2c49bb04efee4dfd4494 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1965,8 +1965,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/unapplied/server/0025-Further-improve-server-tick-loop.patch b/patches/server/0025-Further-improve-server-tick-loop.patch similarity index 96% rename from patches/unapplied/server/0025-Further-improve-server-tick-loop.patch rename to patches/server/0025-Further-improve-server-tick-loop.patch index 77df3f7459..974d7c6a12 100644 --- a/patches/unapplied/server/0025-Further-improve-server-tick-loop.patch +++ b/patches/server/0025-Further-improve-server-tick-loop.patch @@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 722d9a37b2132a246dbb8e19d4e393be684e0f6f..e4c7aa0b8c74b081dd77f81eb12693b8bcf457de 100644 +index c7660c2c9c5e1fb166ba6a3216f14e5fa934528d..494ee4d6de47d10b2f9e4be393f1fe2603a72167 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -268,7 +268,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -277,7 +277,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop