diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index dfa2024f41..286aeeaaa9 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/unapplied/server/Add-BeaconEffectEvent.patch b/patches/server/Add-BeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BeaconEffectEvent.patch rename to patches/server/Add-BeaconEffectEvent.patch diff --git a/patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch b/patches/server/Add-PlayerInitialSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch rename to patches/server/Add-PlayerInitialSpawnEvent.patch diff --git a/patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch similarity index 100% rename from patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch rename to patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch diff --git a/patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/Add-configurable-despawn-distances-for-living-entiti.patch similarity index 100% rename from patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/Add-configurable-despawn-distances-for-living-entiti.patch diff --git a/patches/unapplied/server/Add-configurable-portal-search-radius.patch b/patches/server/Add-configurable-portal-search-radius.patch similarity index 100% rename from patches/unapplied/server/Add-configurable-portal-search-radius.patch rename to patches/server/Add-configurable-portal-search-radius.patch diff --git a/patches/unapplied/server/Add-exception-reporting-event.patch b/patches/server/Add-exception-reporting-event.patch similarity index 100% rename from patches/unapplied/server/Add-exception-reporting-event.patch rename to patches/server/Add-exception-reporting-event.patch diff --git a/patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/server/Add-velocity-warnings.patch b/patches/server/Add-velocity-warnings.patch similarity index 100% rename from patches/unapplied/server/Add-velocity-warnings.patch rename to patches/server/Add-velocity-warnings.patch diff --git a/patches/unapplied/server/Add-version-history-to-version-command.patch b/patches/server/Add-version-history-to-version-command.patch similarity index 100% rename from patches/unapplied/server/Add-version-history-to-version-command.patch rename to patches/server/Add-version-history-to-version-command.patch diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index ce59bbaf84..ec290ad59e 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -1490,7 +1490,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // 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/All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 100% rename from patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch diff --git a/patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch b/patches/server/Allow-for-toggling-of-spawn-chunks.patch similarity index 100% rename from patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/Allow-for-toggling-of-spawn-chunks.patch diff --git a/patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch similarity index 100% rename from patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch rename to patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch diff --git a/patches/unapplied/server/Always-tick-falling-blocks.patch b/patches/server/Always-tick-falling-blocks.patch similarity index 100% rename from patches/unapplied/server/Always-tick-falling-blocks.patch rename to patches/server/Always-tick-falling-blocks.patch diff --git a/patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 100% rename from patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch diff --git a/patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/Check-online-mode-before-converting-and-renaming-pla.patch similarity index 100% rename from patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch rename to patches/server/Check-online-mode-before-converting-and-renaming-pla.patch diff --git a/patches/unapplied/server/Chunk-Save-Reattempt.patch b/patches/server/Chunk-Save-Reattempt.patch similarity index 100% rename from patches/unapplied/server/Chunk-Save-Reattempt.patch rename to patches/server/Chunk-Save-Reattempt.patch diff --git a/patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/Configurable-Disabling-Cat-Chest-Detection.patch similarity index 100% rename from patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch rename to patches/server/Configurable-Disabling-Cat-Chest-Detection.patch diff --git a/patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch b/patches/server/Configurable-baby-zombie-movement-speed.patch similarity index 100% rename from patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch rename to patches/server/Configurable-baby-zombie-movement-speed.patch diff --git a/patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch similarity index 100% rename from patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch diff --git a/patches/unapplied/server/Configurable-container-update-tick-rate.patch b/patches/server/Configurable-container-update-tick-rate.patch similarity index 100% rename from patches/unapplied/server/Configurable-container-update-tick-rate.patch rename to patches/server/Configurable-container-update-tick-rate.patch diff --git a/patches/unapplied/server/Configurable-end-credits.patch b/patches/server/Configurable-end-credits.patch similarity index 100% rename from patches/unapplied/server/Configurable-end-credits.patch rename to patches/server/Configurable-end-credits.patch diff --git a/patches/unapplied/server/Configurable-fishing-time-ranges.patch b/patches/server/Configurable-fishing-time-ranges.patch similarity index 100% rename from patches/unapplied/server/Configurable-fishing-time-ranges.patch rename to patches/server/Configurable-fishing-time-ranges.patch diff --git a/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch b/patches/server/Configurable-inter-world-teleportation-safety.patch similarity index 100% rename from patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch rename to patches/server/Configurable-inter-world-teleportation-safety.patch diff --git a/patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch b/patches/server/Configurable-mob-spawner-tick-rate.patch similarity index 98% rename from patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch rename to patches/server/Configurable-mob-spawner-tick-rate.patch index d8b46cc5a0..dac60c27d0 100644 --- a/patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch +++ b/patches/server/Configurable-mob-spawner-tick-rate.patch @@ -23,9 +23,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -0,0 +0,0 @@ public abstract class BaseSpawner { + public int maxNearbyEntities = 6; public int requiredPlayerRange = 16; public int spawnRange = 4; - private final Random random = new Random(); + private int tickDelay = 0; // Paper public BaseSpawner() {} diff --git a/patches/unapplied/server/Configurable-top-of-nether-void-damage.patch b/patches/server/Configurable-top-of-nether-void-damage.patch similarity index 100% rename from patches/unapplied/server/Configurable-top-of-nether-void-damage.patch rename to patches/server/Configurable-top-of-nether-void-damage.patch diff --git a/patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/Disable-Scoreboards-for-non-players-by-default.patch similarity index 100% rename from patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/Disable-Scoreboards-for-non-players-by-default.patch diff --git a/patches/unapplied/server/Disable-explosion-knockback.patch b/patches/server/Disable-explosion-knockback.patch similarity index 100% rename from patches/unapplied/server/Disable-explosion-knockback.patch rename to patches/server/Disable-explosion-knockback.patch diff --git a/patches/unapplied/server/Disable-ice-and-snow.patch b/patches/server/Disable-ice-and-snow.patch similarity index 100% rename from patches/unapplied/server/Disable-ice-and-snow.patch rename to patches/server/Disable-ice-and-snow.patch diff --git a/patches/unapplied/server/Disable-spigot-tick-limiters.patch b/patches/server/Disable-spigot-tick-limiters.patch similarity index 100% rename from patches/unapplied/server/Disable-spigot-tick-limiters.patch rename to patches/server/Disable-spigot-tick-limiters.patch diff --git a/patches/unapplied/server/Disable-thunder.patch b/patches/server/Disable-thunder.patch similarity index 100% rename from patches/unapplied/server/Disable-thunder.patch rename to patches/server/Disable-thunder.patch diff --git a/patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch new file mode 100644 index 0000000000..e0953edc51 --- /dev/null +++ b/patches/server/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: Riley Park +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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java ++++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java +@@ -0,0 +0,0 @@ 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/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 100% rename from patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch diff --git a/patches/unapplied/server/Ensure-commands-are-not-ran-async.patch b/patches/server/Ensure-commands-are-not-ran-async.patch similarity index 100% rename from patches/unapplied/server/Ensure-commands-are-not-ran-async.patch rename to patches/server/Ensure-commands-are-not-ran-async.patch diff --git a/patches/unapplied/server/Ensure-inv-drag-is-in-bounds.patch b/patches/server/Ensure-inv-drag-is-in-bounds.patch similarity index 100% rename from patches/unapplied/server/Ensure-inv-drag-is-in-bounds.patch rename to patches/server/Ensure-inv-drag-is-in-bounds.patch diff --git a/patches/unapplied/server/Entity-Origin-API.patch b/patches/server/Entity-Origin-API.patch similarity index 98% rename from patches/unapplied/server/Entity-Origin-API.patch rename to patches/server/Entity-Origin-API.patch index 086962083f..f0809e1e0a 100644 --- a/patches/unapplied/server/Entity-Origin-API.patch +++ b/patches/server/Entity-Origin-API.patch @@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - } + entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.valid = true; // CraftBukkit + // Paper start - Set origin location when the entity is being added to the world + if (entity.getOriginVector() == null) { diff --git a/patches/unapplied/server/Expose-server-CommandMap.patch b/patches/server/Expose-server-CommandMap.patch similarity index 100% rename from patches/unapplied/server/Expose-server-CommandMap.patch rename to patches/server/Expose-server-CommandMap.patch diff --git a/patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/Fix-lag-from-explosions-processing-dead-entities.patch similarity index 100% rename from patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch rename to patches/server/Fix-lag-from-explosions-processing-dead-entities.patch diff --git a/patches/unapplied/server/Further-improve-server-tick-loop.patch b/patches/server/Further-improve-server-tick-loop.patch similarity index 83% rename from patches/unapplied/server/Further-improve-server-tick-loop.patch rename to patches/server/Further-improve-server-tick-loop.patch index 58e189a646..2c94589f19 100644 --- a/patches/unapplied/server/Further-improve-server-tick-loop.patch +++ b/patches/server/Further-improve-server-tick-loop.patch @@ -93,33 +93,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected void runServer() { @@ -0,0 +0,0 @@ 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,19 +130,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.recentTps[1] = tps5.getAverage(); + this.recentTps[2] = tps15.getAverage(); + // Paper end - tickSection = curTime; - } - // Spigot end + tickSection = curTime; + } + // Spigot end @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { - 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java diff --git a/patches/unapplied/server/Not-implemeneted.patch b/patches/server/Not-implemeneted.patch similarity index 100% rename from patches/unapplied/server/Not-implemeneted.patch rename to patches/server/Not-implemeneted.patch diff --git a/patches/unapplied/server/Only-refresh-abilities-if-needed.patch b/patches/server/Only-refresh-abilities-if-needed.patch similarity index 100% rename from patches/unapplied/server/Only-refresh-abilities-if-needed.patch rename to patches/server/Only-refresh-abilities-if-needed.patch diff --git a/patches/unapplied/server/Optimize-explosions.patch b/patches/server/Optimize-explosions.patch similarity index 100% rename from patches/unapplied/server/Optimize-explosions.patch rename to patches/server/Optimize-explosions.patch diff --git a/patches/unapplied/server/Paper-Metrics.patch b/patches/server/Paper-Metrics.patch similarity index 100% rename from patches/unapplied/server/Paper-Metrics.patch rename to patches/server/Paper-Metrics.patch diff --git a/patches/unapplied/server/Paper-command.patch b/patches/server/Paper-command.patch similarity index 100% rename from patches/unapplied/server/Paper-command.patch rename to patches/server/Paper-command.patch diff --git a/patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch b/patches/server/Per-Player-View-Distance-API-placeholders.patch similarity index 100% rename from patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch rename to patches/server/Per-Player-View-Distance-API-placeholders.patch diff --git a/patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch b/patches/server/Player-Tab-List-and-Title-APIs.patch similarity index 100% rename from patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch rename to patches/server/Player-Tab-List-and-Title-APIs.patch diff --git a/patches/unapplied/server/Player-affects-spawning-API.patch b/patches/server/Player-affects-spawning-API.patch similarity index 99% rename from patches/unapplied/server/Player-affects-spawning-API.patch rename to patches/server/Player-affects-spawning-API.patch index 3b4b2a657f..c80862b3c0 100644 --- a/patches/unapplied/server/Player-affects-spawning-API.patch +++ b/patches/server/Player-affects-spawning-API.patch @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - private final ItemCooldowns cooldowns; + private Optional lastDeathLocation; @Nullable public FishingHook fishing; + // Paper start diff --git a/patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch b/patches/server/Prevent-tile-entity-and-entity-crashes.patch similarity index 100% rename from patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch rename to patches/server/Prevent-tile-entity-and-entity-crashes.patch diff --git a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch similarity index 85% rename from patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index b36e272a31..a9e3ad7890 100644 --- a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -5,19 +5,6 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/Eula.java -+++ b/src/main/java/net/minecraft/server/Eula.java -@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java @@ -49,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); diff --git a/patches/unapplied/server/Timings-v2.patch b/patches/server/Timings-v2.patch similarity index 97% rename from patches/unapplied/server/Timings-v2.patch rename to patches/server/Timings-v2.patch index 095c4b21b3..29409c6ee5 100644 --- a/patches/unapplied/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -781,7 +781,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> 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) { -@@ -0,0 +0,0 @@ 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(); - @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = ChunkHolder.getStatus(chunkHolder.getTicketLevel()); @@ -1223,14 +1196,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import com.google.common.collect.Lists; import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; -@@ -0,0 +0,0 @@ import net.minecraft.world.ticks.LevelTicks; - import org.slf4j.Logger; +@@ -0,0 +0,0 @@ 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; + import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; + import org.bukkit.craftbukkit.util.CraftNamespacedKey; @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { this.updateSkyBrightness(); this.tickTime(); @@ -1313,10 +1286,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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")); } @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - progressListener.progressStage(new TranslatableComponent("menu.savingChunks")); + progressListener.progressStage(Component.translatable("menu.savingChunks")); } + timings.worldSaveChunks.startTiming(); // Paper @@ -1330,45 +1303,37 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ import 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 { @@ -0,0 +0,0 @@ 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(); + if (this.ackBlockChangesUpTo > -1) { + this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); + this.ackBlockChangesUpTo = -1; @@ -0,0 +0,0 @@ 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(); + } +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } -@@ -0,0 +0,0 @@ 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); + this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); + @@ -0,0 +0,0 @@ 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; } @@ -1377,10 +1342,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1916,8 +1881,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - packet.components = components; - CraftPlayer.this.getHandle().connection.send(packet); + + CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, i)); } + + // Paper start diff --git a/patches/unapplied/server/Use-UserCache-for-player-heads.patch b/patches/server/Use-UserCache-for-player-heads.patch similarity index 100% rename from patches/unapplied/server/Use-UserCache-for-player-heads.patch rename to patches/server/Use-UserCache-for-player-heads.patch diff --git a/patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch deleted file mode 100644 index 2a5e346340..0000000000 --- a/patches/unapplied/server/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: Riley Park -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java -@@ -0,0 +0,0 @@ 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); - }