diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index dfa2024f4..286aeeaaa 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -9,4 +9,3 @@ # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java -minecraft net.minecraft.network.protocol.game.ClientboundPlayerChatPacket diff --git a/patches/server/0005-MC-Dev-fixes.patch b/patches/server/0005-MC-Dev-fixes.patch index 6e707d7f0..57ebf7d8b 100644 --- a/patches/server/0005-MC-Dev-fixes.patch +++ b/patches/server/0005-MC-Dev-fixes.patch @@ -39,31 +39,6 @@ index eabf34265470e68b56c0d8787a7acffcf9b49e83..c94084aee70d269a71a5423c13a5eba2 } } }; -diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java -index f346306d61854bdc6b395f5d8f799909537a1b50..69423244a1b6658e2c6ad4a7c5329e140b7155a8 100644 ---- a/src/main/java/net/minecraft/nbt/ListTag.java -+++ b/src/main/java/net/minecraft/nbt/ListTag.java -@@ -2,9 +2,12 @@ package net.minecraft.nbt; - - import com.google.common.collect.Iterables; - import com.google.common.collect.Lists; -+import it.unimi.dsi.fastutil.bytes.ByteOpenHashSet; -+import it.unimi.dsi.fastutil.bytes.ByteSet; - import java.io.DataInput; - import java.io.DataOutput; - import java.io.IOException; -+import java.util.Arrays; - import java.util.List; - import java.util.Objects; - -@@ -102,6 +105,7 @@ public class ListTag extends CollectionTag { - return "TAG_List"; - } - }; -+ private static final ByteSet INLINE_ELEMENT_TYPES = new ByteOpenHashSet(Arrays.asList((byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6)); // Paper - decompiler fix // todo: what is this - private final List list; - private byte type; - diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java index 423c750d4a5d719f7bc593aff5b1298e5c3c417b..2df77845b78b9d5fae0a36103d42c8202ee2af9e 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java diff --git a/patches/server/0008-Adventure.patch b/patches/server/0008-Adventure.patch index 318003319..d01c3bcf7 100644 --- a/patches/server/0008-Adventure.patch +++ b/patches/server/0008-Adventure.patch @@ -1425,7 +1425,7 @@ index 56996af65ef7478adb90d3b2f4cd3351fc49200b..7002d5f5700570e32ebf0b63e340d87d // 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 2cbe0230173ad391fe70b0a31d8999927461b5e6..bf00219f3795c0e303960dae3123d1cc6f5b7837 100644 +index 2cbe0230173ad391fe70b0a31d8999927461b5e6..f5f2a60b0c20d64a7523a4339b14f40e15c62633 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; @@ -1490,7 +1490,7 @@ index 2cbe0230173ad391fe70b0a31d8999927461b5e6..bf00219f3795c0e303960dae3123d1cc + // 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().broadcastMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM, Util.NIL_UUID); ++ this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM); + // Paper end } // CraftBukkit end diff --git a/patches/unapplied/server/0009-Paper-command.patch b/patches/server/0009-Paper-command.patch similarity index 100% rename from patches/unapplied/server/0009-Paper-command.patch rename to patches/server/0009-Paper-command.patch 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 100% rename from patches/unapplied/server/0011-Paper-Metrics.patch rename to patches/server/0011-Paper-Metrics.patch diff --git a/patches/unapplied/server/0012-Timings-v2.patch b/patches/server/0012-Timings-v2.patch similarity index 91% rename from patches/unapplied/server/0012-Timings-v2.patch rename to patches/server/0012-Timings-v2.patch index f5ca2ae82..a7af01d74 100644 --- a/patches/unapplied/server/0012-Timings-v2.patch +++ b/patches/server/0012-Timings-v2.patch @@ -767,10 +767,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 dd8d14a1b128f801a4e1c811de5990d2602feeb2..f1c94ec44233ce0007a43922d1ca7ba5e71d68bd 100644 +index c763b4d9cc16f8c3ced91ce8656bd238205dedc0..9be29fbb97aced80da8adb693521a8bd870870c5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -180,7 +180,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; +@@ -175,7 +175,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end @@ -779,15 +779,15 @@ index dd8d14a1b128f801a4e1c811de5990d2602feeb2..f1c94ec44233ce0007a43922d1ca7ba5 public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { -@@ -893,6 +893,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { -@@ -1261,15 +1282,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit @@ -861,7 +861,7 @@ index dd8d14a1b128f801a4e1c811de5990d2602feeb2..f1c94ec44233ce0007a43922d1ca7ba5 this.profiler.push("tallying"); long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; -@@ -1279,30 +1303,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // CraftBukkit start - fire RemoteServerCommandEvent -@@ -707,10 +709,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -687,10 +689,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (event.isCancelled()) { return; } @@ -1035,7 +1035,7 @@ index ebd94265f56ecc946ff1834ec0d45673e010453e..1c0fefd539ef82d2d1b33a4974d67dc3 } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af..f9e9e00855627b78e8ff018bf6d52c9787fcffeb 100644 +index ef23f9f81a909348ee4ae3d7eb51dbcc430530ca..e9a2a71b1f2bf6c701d4eba8dc31a10015cf7904 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,8 +1,10 @@ @@ -1049,34 +1049,7 @@ index d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af..f9e9e00855627b78e8ff018bf6d52c97 import com.google.common.collect.Lists; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -681,11 +683,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - - private CompletableFuture> scheduleChunkLoad(ChunkPos pos) { - return CompletableFuture.supplyAsync(() -> { -- try { -+ try (Timing ignored = this.level.timings.chunkLoad.startTimingIfSync()) { // Paper - this.level.getProfiler().incrementCounter("chunkLoad"); -- CompoundTag nbttagcompound = this.readChunk(pos); -+ CompoundTag nbttagcompound; // Paper -+ try (Timing ignored2 = this.level.timings.chunkIO.startTimingIfSync()) { // Paper start - timings -+ nbttagcompound = this.readChunk(pos); -+ } // Paper end - -- if (nbttagcompound != null) { -+ if (nbttagcompound != null) {try (Timing ignored2 = this.level.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings - boolean flag = nbttagcompound.contains("Status", 8); - - if (flag) { -@@ -696,7 +701,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - } - - ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos); -- } -+ }} // Paper - } catch (ReportedException reportedexception) { - Throwable throwable = reportedexception.getCause(); - -@@ -813,6 +818,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -847,6 +849,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = ChunkHolder.getStatus(chunkHolder.getTicketLevel()); return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> { @@ -1084,7 +1057,7 @@ index d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af..f9e9e00855627b78e8ff018bf6d52c97 ChunkPos chunkcoordintpair = chunkHolder.getPos(); ProtoChunk protochunk = (ProtoChunk) ichunkaccess; LevelChunk chunk; -@@ -837,6 +843,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -871,6 +874,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } return chunk; @@ -1092,7 +1065,7 @@ index d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af..f9e9e00855627b78e8ff018bf6d52c97 }); }, (runnable) -> { ProcessorHandle mailbox = this.mainThreadMailbox; -@@ -1384,6 +1391,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1423,6 +1427,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -1100,7 +1073,7 @@ index d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af..f9e9e00855627b78e8ff018bf6d52c97 ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -1408,14 +1416,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1447,14 +1452,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -1119,10 +1092,10 @@ index d9202f7a5b17d8a5c063c8aba4ce22a53d8f59af..f9e9e00855627b78e8ff018bf6d52c97 } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index e4d0035bbf17008642cdcc0e1dca5bae832bbbaa..d198303d4d0cff34156c00176ec2f3f2ad42ada4 100644 +index b0c46312dfb00c13421bb643dbf246610aff897b..63e11397d6efb293b140c4c4bca91e49464e8ea6 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -516,13 +516,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -517,13 +517,15 @@ public class ServerChunkCache extends ChunkSource { } gameprofilerfiller.incrementCounter("getChunkCacheMiss"); @@ -1140,7 +1113,7 @@ index e4d0035bbf17008642cdcc0e1dca5bae832bbbaa..d198303d4d0cff34156c00176ec2f3f2 ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; }, (playerchunk_failure) -> { -@@ -720,7 +722,9 @@ public class ServerChunkCache extends ChunkSource { +@@ -721,7 +723,9 @@ public class ServerChunkCache extends ChunkSource { public void save(boolean flush) { this.runDistanceManagerUpdates(); @@ -1150,7 +1123,7 @@ index e4d0035bbf17008642cdcc0e1dca5bae832bbbaa..d198303d4d0cff34156c00176ec2f3f2 } @Override -@@ -759,7 +763,9 @@ public class ServerChunkCache extends ChunkSource { +@@ -760,7 +764,9 @@ public class ServerChunkCache extends ChunkSource { this.level.timings.doChunkMap.stopTiming(); // Spigot this.level.getProfiler().popPush("chunks"); if (tickChunks) { @@ -1160,7 +1133,7 @@ index e4d0035bbf17008642cdcc0e1dca5bae832bbbaa..d198303d4d0cff34156c00176ec2f3f2 } this.level.timings.doChunkUnload.startTiming(); // Spigot -@@ -788,13 +794,16 @@ public class ServerChunkCache extends ChunkSource { +@@ -789,13 +795,16 @@ public class ServerChunkCache extends ChunkSource { boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit gameprofilerfiller.push("naturalSpawnCount"); @@ -1177,7 +1150,7 @@ index e4d0035bbf17008642cdcc0e1dca5bae832bbbaa..d198303d4d0cff34156c00176ec2f3f2 while (iterator.hasNext()) { ChunkHolder playerchunk = (ChunkHolder) iterator.next(); -@@ -823,27 +832,27 @@ public class ServerChunkCache extends ChunkSource { +@@ -824,27 +833,27 @@ public class ServerChunkCache extends ChunkSource { } if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { @@ -1211,7 +1184,7 @@ index e4d0035bbf17008642cdcc0e1dca5bae832bbbaa..d198303d4d0cff34156c00176ec2f3f2 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cbb5795571 100644 +index 501fd02fedf1a47da28d07fd04b63f89368723ce..53280aeb1ec8088dfb34068e16fd2743c0cf86cb 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 @@ @@ -1223,15 +1196,15 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb import com.google.common.collect.Lists; import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; -@@ -152,7 +154,6 @@ import net.minecraft.world.ticks.LevelTicks; - import org.slf4j.Logger; +@@ -155,7 +157,6 @@ import org.slf4j.Logger; import org.bukkit.Bukkit; + import org.bukkit.Location; import org.bukkit.WeatherType; -import org.bukkit.craftbukkit.SpigotTimings; // Spigot import org.bukkit.craftbukkit.event.CraftEventFactory; - import org.bukkit.craftbukkit.util.WorldUUID; - import org.bukkit.event.entity.CreatureSpawnEvent; -@@ -427,7 +428,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; +@@ -443,7 +444,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.updateSkyBrightness(); this.tickTime(); gameprofilerfiller.popPush("tickPending"); @@ -1240,7 +1213,7 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb if (!this.isDebug()) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); -@@ -436,12 +437,16 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -452,12 +453,16 @@ public class ServerLevel extends Level implements WorldGenLevel { this.fluidTicks.tick(j, 65536, this::tickFluid); gameprofilerfiller.pop(); } @@ -1258,7 +1231,7 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb gameprofilerfiller.popPush("blockEvents"); timings.doSounds.startTiming(); // Spigot this.runBlockEvents(); -@@ -606,6 +611,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -624,6 +629,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.popPush("tickBlocks"); @@ -1266,7 +1239,7 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb if (randomTickSpeed > 0) { LevelChunkSection[] achunksection = chunk.getSections(); int l = achunksection.length; -@@ -638,6 +644,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -656,6 +662,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -1274,7 +1247,7 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb gameprofilerfiller.pop(); } -@@ -872,14 +879,22 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -890,14 +897,22 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void tickNonPassenger(Entity entity) { @@ -1298,7 +1271,7 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb entity.setOldPosAndRot(); ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -898,7 +913,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -916,7 +931,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(entity, entity1); } @@ -1307,16 +1280,16 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb } -@@ -940,6 +955,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -958,6 +973,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper if (progressListener != null) { - progressListener.progressStartNoAbort(new TranslatableComponent("menu.savingLevel")); + progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -949,7 +965,10 @@ public class ServerLevel extends Level implements WorldGenLevel { - progressListener.progressStage(new TranslatableComponent("menu.savingChunks")); +@@ -967,7 +983,10 @@ public class ServerLevel extends Level implements WorldGenLevel { + progressListener.progressStage(Component.translatable("menu.savingChunks")); } + timings.worldSaveChunks.startTiming(); // Paper @@ -1327,62 +1300,54 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb 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 9dd29a669a10735819d3be03e4693850de58bb28..96c59b0e5ac3d36c8ecd513b64723e7dbe5d9b3a 100644 +index f5f2a60b0c20d64a7523a4339b14f40e15c62633..a75353e96d0e0a017e4a5dc84c04a5c594535439 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -210,6 +210,7 @@ import org.bukkit.inventory.CraftingInventory; - import org.bukkit.inventory.EquipmentSlot; - import org.bukkit.inventory.InventoryView; - import org.bukkit.inventory.SmithingInventory; -+import co.aikar.timings.MinecraftTimings; // Paper - // CraftBukkit end - - public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener { -@@ -288,7 +289,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -310,7 +310,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit end public void tick() { - org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot - this.resetPosition(); - this.player.xo = this.player.getX(); - this.player.yo = this.player.getY(); -@@ -364,7 +364,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + if (this.ackBlockChangesUpTo > -1) { + this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); + this.ackBlockChangesUpTo = -1; +@@ -391,7 +390,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 - this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling")); + this.disconnect(Component.translatable("multiplayer.disconnect.idling")); } - org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.stopTiming(); // Spigot + this.chatPreviewThrottler.tick(); + } +@@ -2021,7 +2019,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } -@@ -1946,7 +1945,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - // CraftBukkit end - - private void handleCommand(String input) { + private void handleCommand(String s) { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot -+ MinecraftTimings.playerCommandTimer.startTiming(); // Paper - // CraftBukkit start - whole method ++ co.aikar.timings.MinecraftTimings.playerCommandTimer.startTiming(); // Paper if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot - this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input); -@@ -1957,7 +1956,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); + +@@ -2031,7 +2029,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot -+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper ++ co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper return; } -@@ -1970,7 +1969,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -2044,7 +2042,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { - org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot -+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper ++ co.aikar.timings.MinecraftTimings.playerCommandTimer.stopTiming(); // Paper } - // this.server.getCommands().performCommand(this.player.createCommandSourceStack(), s); - // CraftBukkit end + } + // 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 fbe28ea0fd3bf85b564cf6156e1a2a7efa75822d..5d7298a045ea827a5530faee62061d0f4ea34e2b 100644 +index 821b9c0ba003163195a461dd0bce1fa9ffd0a146..870fb4ffb01ba291d9d3aabfd722e669a477e209 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 @@ @@ -1392,7 +1357,7 @@ index fbe28ea0fd3bf85b564cf6156e1a2a7efa75822d..5d7298a045ea827a5530faee62061d0f import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1013,10 +1014,11 @@ public abstract class PlayerList { +@@ -1017,10 +1018,11 @@ public abstract class PlayerList { } public void saveAll() { @@ -1406,10 +1371,10 @@ index fbe28ea0fd3bf85b564cf6156e1a2a7efa75822d..5d7298a045ea827a5530faee62061d0f 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 e99f7f5eae48e635f167744394ce559ea06971ea..63cbe322c272761e769abaa1e707e50c0acbfd8d 100644 +index 277a9fc7b61361f472eae171a3546c85da4f30b4..76dc492e9c2239a09de9ead5de50abb86a97f452 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -128,7 +128,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; +@@ -131,7 +131,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; import org.bukkit.entity.Hanging; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Vehicle; @@ -1417,7 +1382,7 @@ index e99f7f5eae48e635f167744394ce559ea06971ea..63cbe322c272761e769abaa1e707e50c import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -@@ -295,7 +294,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -298,7 +297,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled public boolean persistentInvisibility = false; public BlockPos lastLavaContact; @@ -1425,7 +1390,7 @@ index e99f7f5eae48e635f167744394ce559ea06971ea..63cbe322c272761e769abaa1e707e50c // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -744,7 +742,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -748,7 +746,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public void move(MoverType movementType, Vec3 movement) { @@ -1433,7 +1398,7 @@ index e99f7f5eae48e635f167744394ce559ea06971ea..63cbe322c272761e769abaa1e707e50c if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -906,7 +903,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -912,7 +909,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.level.getProfiler().pop(); } } @@ -1442,10 +1407,10 @@ index e99f7f5eae48e635f167744394ce559ea06971ea..63cbe322c272761e769abaa1e707e50c protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) { diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index d790c37753f019b682fe00bea392359ba18bf204..8699a3bd63e2df83615ae39a6873d9874f0fb8da 100644 +index d14757d30040c3c9030309a8bb4a37e0c9a4d8db..0c7c8b8671738d9ec408f5dc7f2950a9991858b8 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -296,7 +296,14 @@ public class EntityType implements EntityTypeTest { +@@ -305,7 +305,14 @@ public class EntityType implements EntityTypeTest { return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id)); } @@ -1460,7 +1425,7 @@ index d790c37753f019b682fe00bea392359ba18bf204..8699a3bd63e2df83615ae39a6873d987 this.builtInRegistryHolder = Registry.ENTITY_TYPE.createIntrusiveHolder(this); this.factory = factory; this.category = spawnGroup; -@@ -308,6 +315,14 @@ public class EntityType implements EntityTypeTest { +@@ -317,6 +324,14 @@ public class EntityType implements EntityTypeTest { this.dimensions = dimensions; this.clientTrackingRange = maxTrackDistance; this.updateInterval = trackTickInterval; @@ -1475,7 +1440,7 @@ index d790c37753f019b682fe00bea392359ba18bf204..8699a3bd63e2df83615ae39a6873d987 } @Nullable -@@ -568,6 +583,12 @@ public class EntityType implements EntityTypeTest { +@@ -567,6 +582,12 @@ public class EntityType implements EntityTypeTest { return this.updateInterval; } @@ -1488,7 +1453,7 @@ index d790c37753f019b682fe00bea392359ba18bf204..8699a3bd63e2df83615ae39a6873d987 public boolean trackDeltas() { return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; } -@@ -666,7 +687,7 @@ public class EntityType implements EntityTypeTest { +@@ -665,7 +686,7 @@ public class EntityType implements EntityTypeTest { Util.fetchChoiceType(References.ENTITY_TREE, id); } @@ -1498,10 +1463,10 @@ index d790c37753f019b682fe00bea392359ba18bf204..8699a3bd63e2df83615ae39a6873d987 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cbfa58d329 100644 +index ba7037a44b2fba6aafcbc4081c5c481a2cdcfd3b..c7017b86a3268aef0baff2ae0a56155aafc6a067 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -139,7 +139,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; +@@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; import org.bukkit.event.player.PlayerItemConsumeEvent; // CraftBukkit end @@ -1510,7 +1475,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb public abstract class LivingEntity extends Entity { -@@ -2762,7 +2762,6 @@ public abstract class LivingEntity extends Entity { +@@ -2795,7 +2795,6 @@ public abstract class LivingEntity extends Entity { @Override public void tick() { @@ -1518,7 +1483,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); -@@ -2803,9 +2802,7 @@ public abstract class LivingEntity extends Entity { +@@ -2836,9 +2835,7 @@ public abstract class LivingEntity extends Entity { } } @@ -1528,7 +1493,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb double d0 = this.getX() - this.xo; double d1 = this.getZ() - this.zo; float f = (float) (d0 * d0 + d1 * d1); -@@ -2885,8 +2882,6 @@ public abstract class LivingEntity extends Entity { +@@ -2918,8 +2915,6 @@ public abstract class LivingEntity extends Entity { if (this.isSleeping()) { this.setXRot(0.0F); } @@ -1537,7 +1502,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb } public void detectEquipmentUpdates() { -@@ -3068,7 +3063,6 @@ public abstract class LivingEntity extends Entity { +@@ -3101,7 +3096,6 @@ public abstract class LivingEntity extends Entity { this.setDeltaMovement(d4, d5, d6); this.level.getProfiler().push("ai"); @@ -1545,7 +1510,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; -@@ -3078,7 +3072,6 @@ public abstract class LivingEntity extends Entity { +@@ -3111,7 +3105,6 @@ public abstract class LivingEntity extends Entity { this.serverAiStep(); this.level.getProfiler().pop(); } @@ -1553,7 +1518,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb this.level.getProfiler().pop(); this.level.getProfiler().push("jump"); -@@ -3113,9 +3106,9 @@ public abstract class LivingEntity extends Entity { +@@ -3146,9 +3139,9 @@ public abstract class LivingEntity extends Entity { this.updateFallFlying(); AABB axisalignedbb = this.getBoundingBox(); @@ -1565,7 +1530,7 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb this.level.getProfiler().pop(); this.level.getProfiler().push("freezing"); boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); -@@ -3144,9 +3137,7 @@ public abstract class LivingEntity extends Entity { +@@ -3177,9 +3170,7 @@ public abstract class LivingEntity extends Entity { this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } @@ -1576,10 +1541,10 @@ index c2b768c949cbf8d5e1db5a99812eb31c47194e0e..c8e59de21c1fc217068f40fc5c4c87cb if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { this.hurt(DamageSource.DROWN, 1.0F); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 47f625a30f3f2aa95d94f571abf5af95eee68912..d097223e30de74d5347792fb6d0eecb254099f73 100644 +index 914e42e983d56d9c85b1583f57afab699054f4d6..861ebb82ab009588809fe2c8a4f05fbdcfe6f750 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -81,7 +81,6 @@ import org.bukkit.Bukkit; +@@ -83,7 +83,6 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; @@ -1587,7 +1552,7 @@ index 47f625a30f3f2aa95d94f571abf5af95eee68912..d097223e30de74d5347792fb6d0eecb2 import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.data.CraftBlockData; -@@ -147,7 +146,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -153,7 +152,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1596,7 +1561,7 @@ index 47f625a30f3f2aa95d94f571abf5af95eee68912..d097223e30de74d5347792fb6d0eecb2 public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; -@@ -238,7 +237,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -249,7 +248,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} }); // CraftBukkit end @@ -1605,7 +1570,7 @@ index 47f625a30f3f2aa95d94f571abf5af95eee68912..d097223e30de74d5347792fb6d0eecb2 this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -727,15 +726,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -685,15 +684,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { timings.tileEntityTick.stopTiming(); // Spigot this.tickingBlockEntities = false; @@ -1623,10 +1588,10 @@ index 47f625a30f3f2aa95d94f571abf5af95eee68912..d097223e30de74d5347792fb6d0eecb2 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 e72f44910f7390da9e2d78c5bb8f14d5abf9562b..54125cf5957f8165551e077c47d02b7daa578efb 100644 +index 950c468cad2937cd9a077a8f7a3d227662576a9a..60c5d4c97a340120f49f51b3d1dc7e6f2a19a936 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -89,6 +89,15 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -91,6 +91,15 @@ public class Block extends BlockBehaviour implements ItemLike { public static final int UPDATE_LIMIT = 512; protected final StateDefinition stateDefinition; private BlockState defaultBlockState; @@ -1661,10 +1626,10 @@ index dec38e58e30c84887e9d29436c0f76c70c0a627d..be08224c8107aab3e9a3645a20977dd1 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 73a99db6c31dec822514392a6102b7f8cc3b2738..5496c9ae4af9658164098356532da47351808b51 100644 +index ab986a3d1dc2f605b5b84d2b62cd97007e3a2c22..58a245b2ca6e65d491694142ad04d38236b46434 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -661,6 +661,7 @@ public class LevelChunk extends ChunkAccess { +@@ -681,6 +681,7 @@ public class LevelChunk extends ChunkAccess { server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration)); if (this.needsDecoration) { @@ -1672,7 +1637,7 @@ index 73a99db6c31dec822514392a6102b7f8cc3b2738..5496c9ae4af9658164098356532da473 this.needsDecoration = false; java.util.Random random = new java.util.Random(); random.setSeed(this.level.getSeed()); -@@ -680,6 +681,7 @@ public class LevelChunk extends ChunkAccess { +@@ -700,6 +701,7 @@ public class LevelChunk extends ChunkAccess { } } server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(this.bukkitChunk)); @@ -1681,10 +1646,10 @@ index 73a99db6c31dec822514392a6102b7f8cc3b2738..5496c9ae4af9658164098356532da473 } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -index 95abf42577725383a2b49242c28b81beef487ee5..4e5cfc508e356691a9a249013553f97e77c213b0 100644 +index 98ba88896c73651591b8ad8e070868fb443ae999..864e2e0355a5fb8c1d4a5b0896ba299faf9ea534 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java -@@ -490,13 +490,10 @@ public class ChunkSerializer { +@@ -507,13 +507,10 @@ public class ChunkSerializer { ListTag nbttaglist1 = ChunkSerializer.getListOfCompoundsOrNull(nbt, "block_entities"); return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> { @@ -1698,7 +1663,7 @@ index 95abf42577725383a2b49242c28b81beef487ee5..4e5cfc508e356691a9a249013553f97e if (nbttaglist1 != null) { for (int i = 0; i < nbttaglist1.size(); ++i) { CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i); -@@ -514,7 +511,6 @@ public class ChunkSerializer { +@@ -531,7 +528,6 @@ public class ChunkSerializer { } } } @@ -1707,10 +1672,10 @@ index 95abf42577725383a2b49242c28b81beef487ee5..4e5cfc508e356691a9a249013553f97e }; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 81e78644417764cee33f81cdb116a91fb1d8ccf3..a40995140db011271bd092b0b7415d1eee0e8b18 100644 +index 5408ba255ee04b75e2f4977fc7aa73866945037c..b3061e6f6c2d645520cecc6cfd8f2a079a8f7f96 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2361,12 +2361,31 @@ public final class CraftServer implements Server { +@@ -2344,12 +2344,31 @@ public final class CraftServer implements Server { private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() { @@ -1912,12 +1877,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 cd288194bee65fbf3b7fe8a5d36e09acb1931e57..b3769c6d96d33d870c38349f1a6255dbf840089a 100644 +index d8d634ea96a03a643f6743da8af23480824ced98..485411ddc5ccbe17bc0ecd7caa9a8d5a15f042a7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2282,6 +2282,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - packet.components = components; - CraftPlayer.this.getHandle().connection.send(packet); +@@ -2273,6 +2273,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, i)); } + + // Paper start @@ -2108,7 +2073,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 ec5946ce9061573ec7d2a2ec52b71e0228ae0b25..6c5dfff9616cf6bbfc09471a3a81059acb4ffcbb 100644 +index 43e31362a980a4f300864321224bdf3ca92110ff..482be6fc06d034fe41ac3aab9201295f529c574f 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 92% 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 index 5b51677c1..44a2100b0 100644 --- 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 @@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a40995140db011271bd092b0b7415d1eee0e8b18..a9f3bddd33cf7f7773c262f1b818eed9895987ef 100644 +index b3061e6f6c2d645520cecc6cfd8f2a079a8f7f96..4764f4da6dd6a0a8d197d9ddb0a641316a2d5f2d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -399,10 +399,15 @@ public final class CraftServer implements Server { +@@ -394,10 +394,15 @@ public final class CraftServer implements Server { public void loadPlugins() { this.pluginManager.registerInterface(JavaPluginLoader.class); @@ -29,7 +29,7 @@ index a40995140db011271bd092b0b7415d1eee0e8b18..a9f3bddd33cf7f7773c262f1b818eed9 for (Plugin plugin : plugins) { try { String message = String.format("Loading %s", plugin.getDescription().getFullName()); -@@ -417,6 +422,35 @@ public final class CraftServer implements Server { +@@ -412,6 +417,35 @@ public final class CraftServer implements Server { } } @@ -66,7 +66,7 @@ index a40995140db011271bd092b0b7415d1eee0e8b18..a9f3bddd33cf7f7773c262f1b818eed9 if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index aff3116c77277dcb4d3825d33f40a0b17258a0ba..ae4dc96da9e50ce8645e1b5da13e29085e916e98 100644 +index 0d427758182ebe01d612d5140e4a0d519a96d8c0..193a97a99b8ffe54e456276445e931b2ca1d53db 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -142,6 +142,12 @@ public class Main { 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 90% 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 index bf6fc2d7e..c0caf3418 100644 --- 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 @@ -28,10 +28,10 @@ index 0853ff7641103447f458b2dc08076c27e3937074..3f7ec17466e4fae7139672854e2c8223 + } } diff --git a/src/main/java/net/minecraft/world/level/block/BambooBlock.java b/src/main/java/net/minecraft/world/level/block/BambooBlock.java -index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42ca4d5363b 100644 +index 4d9c6b462101dd533b0d08c40e0257e39ccbead3..081c6732e78bf732d6f2328249dc4fe8b04397b8 100644 --- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java -@@ -135,7 +135,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -130,7 +130,7 @@ public class BambooBlock extends Block implements BonemealableBlock { if (random.nextInt(Math.max(1, (int) (100.0F / world.spigotConfig.bambooModifier) * 3)) == 0 && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot int i = this.getHeightBelowUpToMax(world, pos) + 1; @@ -40,7 +40,7 @@ index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42c this.growBamboo(state, world, pos, random, i); } } -@@ -166,7 +166,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -161,7 +161,7 @@ public class BambooBlock extends Block implements BonemealableBlock { int i = this.getHeightAboveUpToMax(world, pos); int j = this.getHeightBelowUpToMax(world, pos); @@ -49,7 +49,7 @@ index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42c } @Override -@@ -185,7 +185,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -180,7 +180,7 @@ public class BambooBlock extends Block implements BonemealableBlock { BlockPos blockposition1 = pos.above(i); BlockState iblockdata1 = world.getBlockState(blockposition1); @@ -58,7 +58,7 @@ index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42c return; } -@@ -226,7 +226,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -221,7 +221,7 @@ public class BambooBlock extends Block implements BonemealableBlock { } int j = (Integer) state.getValue(BambooBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1; @@ -67,7 +67,7 @@ index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42c // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooBlock.AGE, j)).setValue(BambooBlock.LEAVES, blockpropertybamboosize)).setValue(BambooBlock.STAGE, k), 3)) { -@@ -241,7 +241,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -236,7 +236,7 @@ public class BambooBlock extends Block implements BonemealableBlock { protected int getHeightAboveUpToMax(BlockGetter world, BlockPos pos) { int i; @@ -76,7 +76,7 @@ index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42c ; } -@@ -251,7 +251,7 @@ public class BambooBlock extends Block implements BonemealableBlock { +@@ -246,7 +246,7 @@ public class BambooBlock extends Block implements BonemealableBlock { protected int getHeightBelowUpToMax(BlockGetter world, BlockPos pos) { int i; @@ -86,7 +86,7 @@ index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42c } diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -index b6b769fb354187cb31f878b87cce63049c0c7cf8..f1bbfc85582d29a50a82f9207509985dcb76b693 100644 +index 3b4be44e4204435a360bc224a9b2651952dedf02..0d255201ebce3bb495a4e086da5e4d9195cbc091 100644 --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java @@ -55,7 +55,7 @@ public class CactusBlock extends Block { @@ -99,7 +99,7 @@ index b6b769fb354187cb31f878b87cce63049c0c7cf8..f1bbfc85582d29a50a82f9207509985d if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java -index d40492e9729f165ed944ab2c9fa81cde042ce49c..66c06e0f7c8d223a2b00bab57a15e3a705fe176a 100644 +index e5956a2a68f168a4c08c6c409ae7b288eb792660..3c893c7b1cdb56e527553f07c2bd8ba4b6707b77 100644 --- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java @@ -52,7 +52,7 @@ public class SugarCaneBlock extends Block { 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 97% rename from patches/unapplied/server/0015-Configurable-baby-zombie-movement-speed.patch rename to patches/server/0015-Configurable-baby-zombie-movement-speed.patch index ddd91d873..574818bc6 100644 --- a/patches/unapplied/server/0015-Configurable-baby-zombie-movement-speed.patch +++ b/patches/server/0015-Configurable-baby-zombie-movement-speed.patch @@ -25,7 +25,7 @@ index 3f7ec17466e4fae7139672854e2c8223ada16b76..4d787f0596be1a44724ade309cc00e11 + } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 627aeb45342c2804f911572056a63aa1cb0110e7..953f138b6cd48cc94bc23a4321a9684b4214637e 100644 +index ee91459775aada8cc2e5c4403436b11c15e8e674..cf80a2592e923967fa440f8c383a9dc977177638 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -76,7 +76,7 @@ import org.bukkit.event.entity.EntityTransformEvent; diff --git a/patches/unapplied/server/0016-Configurable-fishing-time-ranges.patch b/patches/server/0016-Configurable-fishing-time-ranges.patch similarity index 96% rename from patches/unapplied/server/0016-Configurable-fishing-time-ranges.patch rename to patches/server/0016-Configurable-fishing-time-ranges.patch index 6a61c4665..1c7ac7762 100644 --- a/patches/unapplied/server/0016-Configurable-fishing-time-ranges.patch +++ b/patches/server/0016-Configurable-fishing-time-ranges.patch @@ -22,7 +22,7 @@ index 4d787f0596be1a44724ade309cc00e115778a797..4b9122a3e094aa9e0a789f35fb6b0f9a + } } diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index 1fe9c591fdb1b8c3d457964a6877a91b56470016..34ee9c22ed5bca2406588a4b6a045bbc51c64920 100644 +index 792d85ea46d392a27ac89c42e037dc90d33fad7f..91fde59289100133a4f473bee176ff1b6805faae 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -85,6 +85,10 @@ public class FishingHook extends Projectile { 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 90% 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 index 2d884dbbd..6c43ebf7b 100644 --- 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 @@ -19,10 +19,10 @@ index 4b9122a3e094aa9e0a789f35fb6b0f9a7a53f772..d2ac0123812224181afae8fca96058dd + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 63cbe322c272761e769abaa1e707e50c0acbfd8d..d778209604c71a0728748dac91a5cb993f4357b7 100644 +index 76dc492e9c2239a09de9ead5de50abb86a97f452..4b55e1a3b373f141f60f4ba392abeda37d2364e0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1278,6 +1278,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1296,6 +1296,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return this.isInWater() || this.isInRain(); } @@ -31,10 +31,10 @@ index 63cbe322c272761e769abaa1e707e50c0acbfd8d..d778209604c71a0728748dac91a5cb99 return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 625641be06b7afafec59ce19ecd39c54bf840351..28d0be9c3391a636fdc04c2e081ed462ed512c5d 100644 +index decf753d088983ef6bbf32a32a6ee8d3cca3ee69..4f58fae1b3738e7e0507a46df275a258c94fcec4 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -105,6 +105,7 @@ public abstract class Mob extends LivingEntity { +@@ -110,6 +110,7 @@ public abstract class Mob extends LivingEntity { private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; @@ -42,7 +42,7 @@ index 625641be06b7afafec59ce19ecd39c54bf840351..28d0be9c3391a636fdc04c2e081ed462 public GoalSelector targetSelector; @Nullable private LivingEntity target; -@@ -801,7 +802,17 @@ public abstract class Mob extends LivingEntity { +@@ -812,7 +813,17 @@ public abstract class Mob extends LivingEntity { @Override protected final void serverAiStep() { ++this.noActionTime; 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 96% 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 index e65088b2f..0be452f16 100644 --- 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 @@ -65,10 +65,10 @@ index d2ac0123812224181afae8fca96058ddc8cdff1e..3afadc8d916714398974d77aa0f10937 + } } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 28d0be9c3391a636fdc04c2e081ed462ed512c5d..57a856cc52db63861d38e1b94c899b47b7572139 100644 +index 4f58fae1b3738e7e0507a46df275a258c94fcec4..88b021b7d1b71bd3fa64b54ca0fd52fef93ea9f0 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -777,14 +777,14 @@ public abstract class Mob extends LivingEntity { +@@ -788,14 +788,14 @@ public abstract class Mob extends LivingEntity { if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); 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 91% 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 index e68780137..4f5b39ed6 100644 --- a/patches/unapplied/server/0019-Allow-for-toggling-of-spawn-chunks.patch +++ b/patches/server/0019-Allow-for-toggling-of-spawn-chunks.patch @@ -20,10 +20,10 @@ index 3afadc8d916714398974d77aa0f1093729e008ca..f32726275d18772904883b618be66893 + } } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index d097223e30de74d5347792fb6d0eecb254099f73..1cb128fb60636016db826ab3120d586346d88cec 100644 +index 861ebb82ab009588809fe2c8a4f05fbdcfe6f750..efdab784bdec183425a6bc7f376f528c38a94752 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -238,6 +238,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -249,6 +249,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings 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 96% 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 index 6620f71fc..a9e9ba68d 100644 --- 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 @@ -64,10 +64,10 @@ index e24b46820394c5f220d5bf7c4e763ef95ff9e9ab..bbe15c66917781a8b6950307449f0243 if (this.onGround) { this.setDeltaMovement(this.getDeltaMovement().multiply(0.7D, -0.5D, 0.7D)); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java -index 3e64b1743042a293e2be9e1c16daa979b601e1ed..e430d9214d5abb367fa503e65af463f0e926563e 100644 +index c10c28eb441e65c6285c25b5d4760c876909c724..469dbae2e04a9ded9e46a576b2e1b020801c1395 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartTNT.java -@@ -45,6 +45,12 @@ public class MinecartTNT extends AbstractMinecart { +@@ -46,6 +46,12 @@ public class MinecartTNT extends AbstractMinecart { public void tick() { super.tick(); if (this.fuse > 0) { 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 80% 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 85459fbbb..a803a2044 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 @@ -5,24 +5,11 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang stats -diff --git a/src/main/java/net/minecraft/server/Eula.java b/src/main/java/net/minecraft/server/Eula.java -index f092497b6defd28c94393e483a9288d121158a1e..df44790b1c342d0a6ff794bea86319fa7498cbae 100644 ---- a/src/main/java/net/minecraft/server/Eula.java -+++ b/src/main/java/net/minecraft/server/Eula.java -@@ -64,7 +64,7 @@ public class Eula { - try { - Properties properties = new Properties(); - properties.setProperty("eula", "false"); -- properties.store(outputStream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)."); -+ properties.store(outputStream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).\nYou also agree that tacos are tasty, and the best food in the world."); // Paper - fix lag; - } catch (Throwable var5) { - if (outputStream != null) { - try { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f1c94ec44233ce0007a43922d1ca7ba5e71d68bd..eef07309b24e88820d35517dd868fff25f777262 100644 +index 9be29fbb97aced80da8adb693521a8bd870870c5..bd549661ccfb29b9a4f9d69956c549ba3e888e31 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1456,7 +1456,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop withinDistance(double x, double y, double z, double max) { double d4 = max * max; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 57a856cc52db63861d38e1b94c899b47b7572139..3d54fa71b2d3532e93fe3636a86150e10fcba31a 100644 +index 88b021b7d1b71bd3fa64b54ca0fd52fef93ea9f0..7827e40e824de85ae1f6ea6fc82455b2cea532cb 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -773,7 +773,7 @@ public abstract class Mob extends LivingEntity { +@@ -784,7 +784,7 @@ public abstract class Mob extends LivingEntity { if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(); } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -34,7 +34,7 @@ index 57a856cc52db63861d38e1b94c899b47b7572139..3d54fa71b2d3532e93fe3636a86150e1 if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -index 6eaedfabf70b604705ad9a772a2e602c8590b500..97c2c1647fa12650e5963c7c1c746fec2429e3d7 100644 +index 87f66fd33e404367d924137b2d8aac3b06937f43..2dcda3b03796655da443e1b3dd68c6f6bca20d21 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java +++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java @@ -127,7 +127,7 @@ public class Silverfish extends Monster { @@ -47,11 +47,11 @@ index 6eaedfabf70b604705ad9a772a2e602c8590b500..97c2c1647fa12650e5963c7c1c746fec return false; } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 1d4d3d6fc8affde249fb7cda8a3a488b6689130a..067513b240db88b818bd26d74c31fb5f8ee80f5d 100644 +index ec0c4767218f197306b179ed0a9c16a15551fa52..24456bbf2cd9f1878cf545e8d164ff524c321a4c 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -175,6 +175,9 @@ public abstract class Player extends LivingEntity { - private final ItemCooldowns cooldowns; +@@ -183,6 +183,9 @@ public abstract class Player extends LivingEntity { + private Optional lastDeathLocation; @Nullable public FishingHook fishing; + // Paper start @@ -61,7 +61,7 @@ index 1d4d3d6fc8affde249fb7cda8a3a488b6689130a..067513b240db88b818bd26d74c31fb5f // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 212b23a380a4bcdb1d2995ca2ccfc8a1709691bd..31bfc0c491c9a4cc6782b6c284121f96972517ea 100644 +index ab22310d5ab4ad7014b88080cbd44a2881002b55..c5b9b19763fd944b4f31c6d3c9b71d372f8403cf 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -51,7 +51,7 @@ public abstract class BaseSpawner { @@ -117,10 +117,10 @@ 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 b3769c6d96d33d870c38349f1a6255dbf840089a..0e153d6e1df199a7b2af73c44e7fe784c7d1947c 100644 +index 485411ddc5ccbe17bc0ecd7caa9a8d5a15f042a7..93cf8f31d0cfc8d98519eab0c953271c4a10b548 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1961,8 +1961,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1959,8 +1959,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return this.getHandle().locale; 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 78% rename from patches/unapplied/server/0025-Further-improve-server-tick-loop.patch rename to patches/server/0025-Further-improve-server-tick-loop.patch index 050eaa62f..96f321513 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 eef07309b24e88820d35517dd868fff25f777262..e26818bd6fb2216ab9b363affe99e4b6c83cca6a 100644 +index bd549661ccfb29b9a4f9d69956c549ba3e888e31..032e6819da27c8616b9b3b6c09bd559e69c35100 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -282,7 +282,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -291,7 +291,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit - long j = i / 50L; + if (i > 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit + long j = i / 50L; - if (this.server.getWarnOnOverload()) // CraftBukkit -- MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); + if (this.server.getWarnOnOverload()) // CraftBukkit +- MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); + MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); - this.nextTickTime += j * 50L; - this.lastOverloadWarning = this.nextTickTime; - } + this.nextTickTime += j * 50L; + this.lastOverloadWarning = this.nextTickTime; + } - ++MinecraftServer.currentTickLong; // Paper -- if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) + ++MinecraftServer.currentTickLong; // Paper +- if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) + if ( ++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0 ) - { -- double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL; -- this.recentTps[0] = MinecraftServer.calcTps( this.recentTps[0], 0.92, currentTps ); // 1/exp(5sec/1min) -- this.recentTps[1] = MinecraftServer.calcTps( this.recentTps[1], 0.9835, currentTps ); // 1/exp(5sec/5min) -- this.recentTps[2] = MinecraftServer.calcTps( this.recentTps[2], 0.9945, currentTps ); // 1/exp(5sec/15min) + { +- double currentTps = 1E3 / ( curTime - tickSection ) * MinecraftServer.SAMPLE_INTERVAL; +- this.recentTps[0] = MinecraftServer.calcTps( this.recentTps[0], 0.92, currentTps ); // 1/exp(5sec/1min) +- this.recentTps[1] = MinecraftServer.calcTps( this.recentTps[1], 0.9835, currentTps ); // 1/exp(5sec/5min) +- this.recentTps[2] = MinecraftServer.calcTps( this.recentTps[2], 0.9945, currentTps ); // 1/exp(5sec/15min) + final long diff = curTime - tickSection; + java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); + tps1.add(currentTps, diff); @@ -130,24 +130,24 @@ index eef07309b24e88820d35517dd868fff25f777262..e26818bd6fb2216ab9b363affe99e4b6 + this.recentTps[1] = tps5.getAverage(); + this.recentTps[2] = tps15.getAverage(); + // Paper end - tickSection = curTime; - } - // Spigot end -@@ -1044,7 +1102,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements +@@ -361,6 +361,11 @@ public class ChestBlock extends AbstractChestBlock implements } private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) { diff --git a/patches/unapplied/server/0047-Ensure-commands-are-not-ran-async.patch b/patches/server/0047-Ensure-commands-are-not-ran-async.patch similarity index 95% rename from patches/unapplied/server/0047-Ensure-commands-are-not-ran-async.patch rename to patches/server/0047-Ensure-commands-are-not-ran-async.patch index cb9c5b38c..6a4025dcb 100644 --- a/patches/unapplied/server/0047-Ensure-commands-are-not-ran-async.patch +++ b/patches/server/0047-Ensure-commands-are-not-ran-async.patch @@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren that it is happening so that plugin authors can fix their code to stop executing commands async. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 96c59b0e5ac3d36c8ecd513b64723e7dbe5d9b3a..b85e557972e37566c853e0b4f882719b4d8bb293 100644 +index a75353e96d0e0a017e4a5dc84c04a5c594535439..984209f32015d765367fd7693fb759de571b9ad0 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1872,6 +1872,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1947,6 +1947,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } if (!async && s.startsWith("/")) { @@ -48,10 +48,10 @@ index 96c59b0e5ac3d36c8ecd513b64723e7dbe5d9b3a..b85e557972e37566c853e0b4f882719b } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 46f895acd74de17784d0c5efc66caf10a8be8686..b6e8bf97d961c5b3fd59c8eab11db5d7cf11fe36 100644 +index a7dcdb5cce888f8580b54f7de263110e69285311..c30ee88c7e49364a799c848ceb683084ae0febc8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -857,6 +857,28 @@ public final class CraftServer implements Server { +@@ -852,6 +852,28 @@ public final class CraftServer implements Server { Validate.notNull(commandLine, "CommandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot diff --git a/patches/unapplied/server/0048-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0048-All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 89% rename from patches/unapplied/server/0048-All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/0048-All-chunks-are-slime-spawn-chunks-toggle.patch index e39421f1d..7016bc9d6 100644 --- a/patches/unapplied/server/0048-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/patches/server/0048-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -19,10 +19,10 @@ index adf5a83fc1b62e55ba4524893f8704ad6cd81e97..567bad50508870001c3337bf109a407b + } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index cee85fcbe061cf70ba9c828372369a4c41f9fbff..990f2e17aad4a1116482b3aa534686cf8dc3669a 100644 +index a62f88048d8243f5b98834988c049471114c4199..61304f83aff18ae20316db7e16b673a652eb73a4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java -@@ -321,7 +321,7 @@ public class Slime extends Mob implements Enemy { +@@ -316,7 +316,7 @@ public class Slime extends Mob implements Enemy { } ChunkPos chunkcoordintpair = new ChunkPos(pos); @@ -32,10 +32,10 @@ index cee85fcbe061cf70ba9c828372369a4c41f9fbff..990f2e17aad4a1116482b3aa534686cf if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { return checkMobSpawnRules(type, world, spawnReason, pos, random); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index d68bb94bf75d04b3f371518558addc645b55d8a4..404bd3389aaa75ca23f04d23ecea9093443c3976 100644 +index d748eb01ecb2b15b081ab3d98b3b3d5804a2215a..0a72475c241e0392993c3e501f891b74c7f72019 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -219,7 +219,7 @@ public class CraftChunk implements Chunk { +@@ -220,7 +220,7 @@ public class CraftChunk implements Chunk { @Override public boolean isSlimeChunk() { // 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk diff --git a/patches/unapplied/server/0049-Expose-server-CommandMap.patch b/patches/server/0049-Expose-server-CommandMap.patch similarity index 78% rename from patches/unapplied/server/0049-Expose-server-CommandMap.patch rename to patches/server/0049-Expose-server-CommandMap.patch index 58807b4f7..32f3ab5a0 100644 --- a/patches/unapplied/server/0049-Expose-server-CommandMap.patch +++ b/patches/server/0049-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b6e8bf97d961c5b3fd59c8eab11db5d7cf11fe36..680453b00b7fad402d0311141d82a9f0dd6cce2e 100644 +index c30ee88c7e49364a799c848ceb683084ae0febc8..5b002bb66d75f5a93492324fd77a91f851c47224 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1975,6 +1975,7 @@ public final class CraftServer implements Server { +@@ -1958,6 +1958,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/unapplied/server/0050-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0050-Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 100% rename from patches/unapplied/server/0050-Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/0050-Be-a-bit-more-informative-in-maxHealth-exception.patch diff --git a/patches/unapplied/server/0051-Ensure-inv-drag-is-in-bounds.patch b/patches/server/0051-Ensure-inv-drag-is-in-bounds.patch similarity index 87% rename from patches/unapplied/server/0051-Ensure-inv-drag-is-in-bounds.patch rename to patches/server/0051-Ensure-inv-drag-is-in-bounds.patch index 0616b5316..f323028a3 100644 --- a/patches/unapplied/server/0051-Ensure-inv-drag-is-in-bounds.patch +++ b/patches/server/0051-Ensure-inv-drag-is-in-bounds.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure inv drag is in bounds diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index fc8c3798643c1a8cf29298f02c8ec057b950a2fc..eecb852e4946c774ad295c53dbd904571262055a 100644 +index 04874783a67dd8d9c2b2fd12e5f9d5447b8a2d7d..36d42b2a97168dfa525b55d8fa2f7a603b43340f 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -418,7 +418,7 @@ public abstract class AbstractContainerMenu { +@@ -416,7 +416,7 @@ public abstract class AbstractContainerMenu { this.resetQuickCraft(); } } else if (this.quickcraftStatus == 1) { diff --git a/patches/unapplied/server/0052-Player-Tab-List-and-Title-APIs.patch b/patches/server/0052-Player-Tab-List-and-Title-APIs.patch similarity index 96% rename from patches/unapplied/server/0052-Player-Tab-List-and-Title-APIs.patch rename to patches/server/0052-Player-Tab-List-and-Title-APIs.patch index 14ebb4ed8..bb7793545 100644 --- a/patches/unapplied/server/0052-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0052-Player-Tab-List-and-Title-APIs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 0053474ab7c25de6d86c16e3079feb21f75d1c11..303b877bc467de7c046cc221d061fac841c1d9f3 100644 +index 42514a0c7066dc79050c0496d6463528b593f9e4..70631b3fe080320dfea0d1a4deb23e87448da250 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -356,6 +356,11 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -439,6 +439,11 @@ public class FriendlyByteBuf extends ByteBuf { public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144); } @@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4 // Paper end buf.writeComponent(this.text); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 34b2b30ba5bf1f163ed647db1ea75e57323fb042..0f04ae8e52f8dca80cfa71b2162a4c477dc0c4db 100644 +index 82a6eb9db090f254add880c8a289f948c82d5a64..25489d8aec04821d257badf009f66bb89fa8d04c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ @@ -73,7 +73,7 @@ index 34b2b30ba5bf1f163ed647db1ea75e57323fb042..0f04ae8e52f8dca80cfa71b2162a4c47 import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -270,6 +271,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -268,6 +269,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/patches/unapplied/server/0053-Add-configurable-portal-search-radius.patch b/patches/server/0053-Add-configurable-portal-search-radius.patch similarity index 93% rename from patches/unapplied/server/0053-Add-configurable-portal-search-radius.patch rename to patches/server/0053-Add-configurable-portal-search-radius.patch index 3a79b7e76..966fb4a9c 100644 --- a/patches/unapplied/server/0053-Add-configurable-portal-search-radius.patch +++ b/patches/server/0053-Add-configurable-portal-search-radius.patch @@ -23,10 +23,10 @@ index 567bad50508870001c3337bf109a407b6b4cde0e..66dd2ebda5692157e397f7ddafd96a49 + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2f35ce076a468ac260e28ba90ac55f7717ee1b13..4329563bccfefe5d56c12d0fa341f1ffd4ce22a1 100644 +index 51475d726004b857e0fbaffa9df2c777c2942071..d6bf1d3356a8894cdeacac270d96d7ea07c79879 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2911,7 +2911,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2940,7 +2940,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); // CraftBukkit start @@ -42,7 +42,7 @@ index 2f35ce076a468ac260e28ba90ac55f7717ee1b13..4329563bccfefe5d56c12d0fa341f1ff return null; } diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index 2f9ce2a5d187bbaf55f2599998aad357dac72ecc..05150fbade1d5a9b3b6de8ad1f5e825f34d1037e 100644 +index bb05ea288432ece497957c3503c3435655ce8997..8672545ba07205ef362442e1342f2ee5281f62cb 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java @@ -43,7 +43,7 @@ public class PortalForcer { diff --git a/patches/unapplied/server/0054-Add-velocity-warnings.patch b/patches/server/0054-Add-velocity-warnings.patch similarity index 93% rename from patches/unapplied/server/0054-Add-velocity-warnings.patch rename to patches/server/0054-Add-velocity-warnings.patch index bbf4214f5..e701f05b9 100644 --- a/patches/unapplied/server/0054-Add-velocity-warnings.patch +++ b/patches/server/0054-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 680453b00b7fad402d0311141d82a9f0dd6cce2e..3341fb3250f2dd06328e7ec8ee2758d7497eaecc 100644 +index 5b002bb66d75f5a93492324fd77a91f851c47224..ff7f1347619d4df2a5c217a4b6545878ed81293c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -279,6 +279,7 @@ public final class CraftServer implements Server { +@@ -274,6 +274,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; @@ -17,10 +17,10 @@ index 680453b00b7fad402d0311141d82a9f0dd6cce2e..3341fb3250f2dd06328e7ec8ee2758d7 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index fdbcf4989f72e1604a2841f565adfeebf8d45622..1e0b8314ef388763aa43055909e48778f0d421a3 100644 +index 35e6cdd6930209d5c0f1c23c4e6838a5c0d81aa3..bbd87aaedba4ff034678e17b2c377dbdbce02c57 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -438,10 +438,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -450,10 +450,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setVelocity(Vector velocity) { Preconditions.checkArgument(velocity != null, "velocity"); velocity.checkFinite(); diff --git a/patches/unapplied/server/0055-Configurable-inter-world-teleportation-safety.patch b/patches/server/0055-Configurable-inter-world-teleportation-safety.patch similarity index 93% rename from patches/unapplied/server/0055-Configurable-inter-world-teleportation-safety.patch rename to patches/server/0055-Configurable-inter-world-teleportation-safety.patch index 68de154e2..ed40c6ee7 100644 --- a/patches/unapplied/server/0055-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0055-Configurable-inter-world-teleportation-safety.patch @@ -30,10 +30,10 @@ index 66dd2ebda5692157e397f7ddafd96a492e53c9e9..45b51fea6ba4381e4d245d70b5671f6e + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0f04ae8e52f8dca80cfa71b2162a4c477dc0c4db..de9dbbff4e0e3d14821d21a1506a6b2d4a8ce3ab 100644 +index 25489d8aec04821d257badf009f66bb89fa8d04c..f7e77a911ea950efc6be76d4d2c6b3fdf66a383c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1034,7 +1034,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1032,7 +1032,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.connection.teleport(to); } else { diff --git a/patches/unapplied/server/0056-Add-exception-reporting-event.patch b/patches/server/0056-Add-exception-reporting-event.patch similarity index 93% rename from patches/unapplied/server/0056-Add-exception-reporting-event.patch rename to patches/server/0056-Add-exception-reporting-event.patch index 119710f7a..79b0f9f44 100644 --- a/patches/unapplied/server/0056-Add-exception-reporting-event.patch +++ b/patches/server/0056-Add-exception-reporting-event.patch @@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8 + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index f9e9e00855627b78e8ff018bf6d52c9787fcffeb..fb8d50dc14e1d23001e184b425bc6ac2f8b0f37e 100644 +index e9a2a71b1f2bf6c701d4eba8dc31a10015cf7904..8b11fbfe2805ad7e8ba84e6b7fdfafc054a248bd 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -961,6 +961,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -992,6 +992,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return true; } catch (Exception exception) { ChunkMap.LOGGER.error("Failed to save chunk {},{}", new Object[]{chunkcoordintpair.x, chunkcoordintpair.z, exception}); @@ -61,7 +61,7 @@ index f9e9e00855627b78e8ff018bf6d52c9787fcffeb..fb8d50dc14e1d23001e184b425bc6ac2 } } diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java -index 7b84b20a4de0d6e95a1d47cb077abd0e00a2336c..b7b98832be6178a2bca534bf974519ede977b282 100644 +index 439ff01be1521c283d60cacb110fcb4993933057..da98f074ccd5a40c635824112c97fd174c393cb1 100644 --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java @@ -1,5 +1,6 @@ @@ -88,7 +88,7 @@ index 7b84b20a4de0d6e95a1d47cb077abd0e00a2336c..b7b98832be6178a2bca534bf974519ed } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java -index 1a9dfd8411bb8affdb3ff4c003433ecab203b004..5e526d0feda11d6b73f71b965aa098e0a79457d1 100644 +index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..fed09b886f4fa0006d160e5f2abb00dfee45434d 100644 --- a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java +++ b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java @@ -118,6 +118,7 @@ public class VillageSiege implements CustomSpawner { @@ -100,7 +100,7 @@ index 1a9dfd8411bb8affdb3ff4c003433ecab203b004..5e526d0feda11d6b73f71b965aa098e0 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 922b234865ff5d64049d634d0356f9a068bc8a8c..d923cc91a8f1e71831be8ded1b4818ac3b48fc34 100644 +index e52d69675c823184303536db0f673762d8eca100..2bc5b3c76264a5a23170adbc2e04c55a5e4f2a6a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1,5 +1,10 @@ @@ -114,7 +114,7 @@ index 922b234865ff5d64049d634d0356f9a068bc8a8c..d923cc91a8f1e71831be8ded1b4818ac import com.google.common.collect.Lists; import com.mojang.serialization.Codec; import java.io.IOException; -@@ -738,6 +743,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -696,6 +701,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper start - Prevent tile entity and entity crashes final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); MinecraftServer.LOGGER.error(msg, throwable); @@ -123,10 +123,10 @@ index 922b234865ff5d64049d634d0356f9a068bc8a8c..d923cc91a8f1e71831be8ded1b4818ac // Paper end } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 2d290d2e17517bc39828e05369ca5bc5ce892c27..fee21a585b95448a5edab70002e9c4ea36a5d989 100644 +index b37e04a0c466dacf52e74a4d4fb0885511c2abc1..878fc7f57178bff0e42fd01434f0aaa2732f5a5b 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -288,6 +288,7 @@ public final class NaturalSpawner { +@@ -289,6 +289,7 @@ public final class NaturalSpawner { } } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); @@ -134,7 +134,7 @@ index 2d290d2e17517bc39828e05369ca5bc5ce892c27..fee21a585b95448a5edab70002e9c4ea return null; } } -@@ -400,6 +401,7 @@ public final class NaturalSpawner { +@@ -401,6 +402,7 @@ public final class NaturalSpawner { entity = biomesettingsmobs_c.type.create(world.getLevel()); } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); @@ -143,7 +143,7 @@ index 2d290d2e17517bc39828e05369ca5bc5ce892c27..fee21a585b95448a5edab70002e9c4ea } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index ed6203119fe2e4ee47a2d51c84df5b7c236f32da..7a63c26e360fd054bf237df3eeffc466d73d5dfb 100644 +index a438025a2102fa911a6941cd9723c84743113dc7..2704a05766d42b0277fa6308820b88371db00ace 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1,6 +1,7 @@ @@ -154,7 +154,7 @@ index ed6203119fe2e4ee47a2d51c84df5b7c236f32da..7a63c26e360fd054bf237df3eeffc466 import com.google.common.collect.Maps; import com.google.common.collect.UnmodifiableIterator; import com.mojang.logging.LogUtils; -@@ -544,10 +545,16 @@ public class LevelChunk extends ChunkAccess { +@@ -559,10 +560,16 @@ public class LevelChunk extends ChunkAccess { // CraftBukkit start } else { @@ -175,7 +175,7 @@ index ed6203119fe2e4ee47a2d51c84df5b7c236f32da..7a63c26e360fd054bf237df3eeffc466 // CraftBukkit end } } -@@ -1027,6 +1034,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1052,6 +1059,7 @@ public class LevelChunk extends ChunkAccess { // Paper start - Prevent tile entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); diff --git a/patches/server/0057-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/0057-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch new file mode 100644 index 000000000..5775fe4da --- /dev/null +++ b/patches/server/0057-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: kashike +Date: Tue, 8 Mar 2016 18:28:43 -0800 +Subject: [PATCH] Don't nest if we don't need to when cerealising text + components + + +diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java +index 75b5f37c54a4de7f4235e2e5246aeda8a605ef45..6ba9874037af30acaf585914990dc7988db7b2ea 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java ++++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java +@@ -21,7 +21,15 @@ public record ClientboundSystemChatPacket(@org.jetbrains.annotations.Nullable ne + } + + public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, int typeId) { +- this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), typeId); ++ this(null, garbageConversion(content), typeId); // Paper - don't nest if we don't need to so that we can preserve formatting ++ } ++ ++ private static String garbageConversion(net.md_5.bungee.api.chat.BaseComponent[] content) { ++ if (content.length == 1) { ++ return net.md_5.bungee.chat.ComponentSerializer.toString(content[0]); ++ } else { ++ return net.md_5.bungee.chat.ComponentSerializer.toString(content); ++ } + } + // Spigot end + // Paper end diff --git a/patches/unapplied/server/0058-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch similarity index 88% rename from patches/unapplied/server/0058-Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch index 9ec525713..558e5e9f2 100644 --- a/patches/unapplied/server/0058-Disable-Scoreboards-for-non-players-by-default.patch +++ b/patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch @@ -25,10 +25,10 @@ index 45b51fea6ba4381e4d245d70b5671f6e42c1f718..397995fe4c360d837282535b9b7aaf7f + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 4329563bccfefe5d56c12d0fa341f1ffd4ce22a1..79dddb060d967303be70b690df83c3b2a2b1f67e 100644 +index d6bf1d3356a8894cdeacac270d96d7ea07c79879..e6917848029b1686e4e3a1a0eadac85eda92518d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2551,6 +2551,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2578,6 +2578,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @Nullable public Team getTeam() { @@ -37,10 +37,10 @@ index 4329563bccfefe5d56c12d0fa341f1ffd4ce22a1..79dddb060d967303be70b690df83c3b2 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 91579d3ead3900ed6ff5b050f80ae031b141c24d..cb7cccee34e897195d0a258ba6623b75e797ee7c 100644 +index 062d8c0d48798199319da5ccb422af2f1564f6f6..3f82c88058edb5c37fff98d760d931de20a85b5d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -800,6 +800,7 @@ public abstract class LivingEntity extends Entity { +@@ -823,6 +823,7 @@ public abstract class LivingEntity extends Entity { if (nbt.contains("Team", 8)) { String s = nbt.getString("Team"); PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s); diff --git a/patches/unapplied/server/0059-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0059-Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/server/0059-Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/0059-Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/server/0060-Chunk-Save-Reattempt.patch b/patches/server/0060-Chunk-Save-Reattempt.patch similarity index 100% rename from patches/unapplied/server/0060-Chunk-Save-Reattempt.patch rename to patches/server/0060-Chunk-Save-Reattempt.patch diff --git a/patches/unapplied/server/0057-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/unapplied/server/0057-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch deleted file mode 100644 index c569f0e66..000000000 --- a/patches/unapplied/server/0057-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: kashike -Date: Tue, 8 Mar 2016 18:28:43 -0800 -Subject: [PATCH] Don't nest if we don't need to when cerealising text - components - - -diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java -index f4f52e43852d2b0b56770c3f747a655a3a6dd683..8b0d452b12d5eca1f92e2cdf014118e215407b31 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java -@@ -36,7 +36,14 @@ public class ClientboundChatPacket implements Packet { - // Paper end - // Spigot start - if (this.components != null) { -- buf.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(components)); -+ // buf.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(components)); // Paper - comment, replaced with below -+ // Paper start - don't nest if we don't need to so that we can preserve formatting -+ if (this.components.length == 1) { -+ buf.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(this.components[0])); -+ } else { -+ buf.writeUtf(net.md_5.bungee.chat.ComponentSerializer.toString(this.components)); -+ } -+ // Paper end - } else { - buf.writeComponent(this.message); - }