diff --git a/patches/server/0003-JettPack-patches.patch b/patches/removed/0003-JettPack-patches.patch similarity index 100% rename from patches/server/0003-JettPack-patches.patch rename to patches/removed/0003-JettPack-patches.patch diff --git a/patches/server/0004-Lithium-optimizations.patch b/patches/removed/0004-Lithium-optimizations.patch similarity index 100% rename from patches/server/0004-Lithium-optimizations.patch rename to patches/removed/0004-Lithium-optimizations.patch diff --git a/patches/server/0005-CarpetFixes-optimizations.patch b/patches/removed/0005-CarpetFixes-optimizations.patch similarity index 100% rename from patches/server/0005-CarpetFixes-optimizations.patch rename to patches/removed/0005-CarpetFixes-optimizations.patch diff --git a/patches/server/0006-Suki-Patches.patch b/patches/removed/0006-Suki-Patches.patch similarity index 100% rename from patches/server/0006-Suki-Patches.patch rename to patches/removed/0006-Suki-Patches.patch diff --git a/patches/server/0007-C2ME-optimizations.patch b/patches/removed/0007-C2ME-optimizations.patch similarity index 100% rename from patches/server/0007-C2ME-optimizations.patch rename to patches/removed/0007-C2ME-optimizations.patch diff --git a/patches/server/0008-Use-our-logo-instead-of-Purpur-s.patch b/patches/server/0003-Use-our-logo-instead-of-Purpur-s.patch similarity index 100% rename from patches/server/0008-Use-our-logo-instead-of-Purpur-s.patch rename to patches/server/0003-Use-our-logo-instead-of-Purpur-s.patch diff --git a/patches/server/0009-Smarter-statistics-ticking.patch b/patches/server/0004-Smarter-statistics-ticking.patch similarity index 95% rename from patches/server/0009-Smarter-statistics-ticking.patch rename to patches/server/0004-Smarter-statistics-ticking.patch index c647bb2..68d3ce9 100644 --- a/patches/server/0009-Smarter-statistics-ticking.patch +++ b/patches/server/0004-Smarter-statistics-ticking.patch @@ -10,7 +10,7 @@ Original code by YatopiaMC, licensed under MIT You can find the original code on https://github.com/YatopiaMC/Yatopia 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 5668e6fa7f560199c352dbed629dbc6897d468a7..5a17c5df95390120bdd36c86dcd14a334f3a7030 100644 +index 1b7e38538881ba00ffdbe9226952627151532c5c..119e26e32654c834ff1158836ce56ba8985c09e8 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -315,19 +315,21 @@ public abstract class Player extends LivingEntity { diff --git a/patches/server/0010-Smooth-Teleports.patch b/patches/server/0005-Smooth-Teleports.patch similarity index 98% rename from patches/server/0010-Smooth-Teleports.patch rename to patches/server/0005-Smooth-Teleports.patch index 4cc3852..ccd2ce8 100644 --- a/patches/server/0010-Smooth-Teleports.patch +++ b/patches/server/0005-Smooth-Teleports.patch @@ -9,7 +9,7 @@ Original license: MIT Original project: https://github.com/Cryptite/Slice diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 467f60dcbed645d773e7e3e042d2bbbd8f5bb589..89f2bffb6d3458f885e6098ea770c46867f6419d 100644 +index 14b2c36049c91a8abfc545e2fb5e3d6f908370e8..77c00de9b94531f8136469e04e535a43829c0a60 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -271,6 +271,7 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0011-Fast-speed-check.patch b/patches/server/0006-Fast-speed-check.patch similarity index 94% rename from patches/server/0011-Fast-speed-check.patch rename to patches/server/0006-Fast-speed-check.patch index 97a4ddb..47014b9 100644 --- a/patches/server/0011-Fast-speed-check.patch +++ b/patches/server/0006-Fast-speed-check.patch @@ -14,7 +14,7 @@ doing questionable/buggy ones, and claiming breathtaking performance improvement any of those Spigot forks! diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6f2518ec1be9af4fa00d719c50cbe64e4e57fcbc..9701a89149cc2bd7330b23c441b51677be0bdc18 100644 +index 193b6621d6506a04bc1f9f23571aeb2e635d562c..7ef574008f413008427d075860c9eb5debeef4f4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1195,7 +1195,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { diff --git a/patches/server/0012-PaperPR-Optimize-VarInts.patch b/patches/server/0007-PaperPR-Optimize-VarInts.patch similarity index 100% rename from patches/server/0012-PaperPR-Optimize-VarInts.patch rename to patches/server/0007-PaperPR-Optimize-VarInts.patch diff --git a/patches/server/0013-Options-of-warnings.patch b/patches/server/0008-Options-of-warnings.patch similarity index 94% rename from patches/server/0013-Options-of-warnings.patch rename to patches/server/0008-Options-of-warnings.patch index 8f177d2..680aa9c 100644 --- a/patches/server/0013-Options-of-warnings.patch +++ b/patches/server/0008-Options-of-warnings.patch @@ -10,13 +10,14 @@ Let users decide if we should warn while running in offline mode Let users decide if we should warn while running in proxy mode diff --git a/src/main/java/cc/keyimc/keyi/KeyiConfig.java b/src/main/java/cc/keyimc/keyi/KeyiConfig.java -index 8b9a2f06b0a61cfdd493eeddde512f0abd17f49e..98705c4206906404fed31c87fb03737fe3771b0a 100644 +index bc9403d002ef24e71be67a962d099f5d73db9540..5582c15a37fbbf74d2039ba15d67684f5294a46d 100644 --- a/src/main/java/cc/keyimc/keyi/KeyiConfig.java +++ b/src/main/java/cc/keyimc/keyi/KeyiConfig.java -@@ -133,6 +133,16 @@ public final class KeyiConfig { +@@ -132,4 +132,14 @@ public final class KeyiConfig { + public static void reload() { KeyiConfig.init((File) MinecraftServer.getServer().options.valueOf("keyi-settings")); } - ++ + public static boolean enableRootUserWarning = true; + public static boolean enableOfflineModeWarning = true; + public static boolean enableProxyUnsafeWarning = true; @@ -26,10 +27,8 @@ index 8b9a2f06b0a61cfdd493eeddde512f0abd17f49e..98705c4206906404fed31c87fb03737f + enableOfflineModeWarning = getBoolean("misc.enable-offline-mode-warning", enableOfflineModeWarning); + enableProxyUnsafeWarning = getBoolean("misc.enable-proxy-unsafe-warning", enableProxyUnsafeWarning); + } -+ - // Suki start - only refresh lootables for players - - public static boolean onlyRefreshForPlayers = false; + } +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java index a9c4f1192f53fea55b2f5edc8a91b6911489e2d3..5420915b21bbd17eeaba2ba45e08399a3abe6952 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/patches/server/0014-Add-an-option-for-tripwire-duping.patch b/patches/server/0009-Add-an-option-for-tripwire-duping.patch similarity index 86% rename from patches/server/0014-Add-an-option-for-tripwire-duping.patch rename to patches/server/0009-Add-an-option-for-tripwire-duping.patch index 8dd35b8..1064317 100644 --- a/patches/server/0014-Add-an-option-for-tripwire-duping.patch +++ b/patches/server/0009-Add-an-option-for-tripwire-duping.patch @@ -5,22 +5,21 @@ Subject: [PATCH] Add an option for tripwire duping diff --git a/src/main/java/cc/keyimc/keyi/KeyiConfig.java b/src/main/java/cc/keyimc/keyi/KeyiConfig.java -index 98705c4206906404fed31c87fb03737fe3771b0a..c93bb951fd456af9e8f030b6f5c7989925c3556f 100644 +index 5582c15a37fbbf74d2039ba15d67684f5294a46d..8884a2471b4b7c5cabf1c0c767710ba69c7ae4ec 100644 --- a/src/main/java/cc/keyimc/keyi/KeyiConfig.java +++ b/src/main/java/cc/keyimc/keyi/KeyiConfig.java -@@ -143,6 +143,12 @@ public final class KeyiConfig { +@@ -142,4 +142,10 @@ public final class KeyiConfig { + enableOfflineModeWarning = getBoolean("misc.enable-offline-mode-warning", enableOfflineModeWarning); enableProxyUnsafeWarning = getBoolean("misc.enable-proxy-unsafe-warning", enableProxyUnsafeWarning); } - ++ + public static boolean fixTripwireDuping = true; + + private static void fixes() { + fixTripwireDuping = getBoolean("fixes.fix-tripwire-duping", fixTripwireDuping); + } -+ - // Suki start - only refresh lootables for players - - public static boolean onlyRefreshForPlayers = false; + } +\ No newline at end of file diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java index 004dce26ff073f1de52a84cd425c4f60fdab5e50..b37a5d643dc07eaa0808b972f43281f2e24d3394 100644 --- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java diff --git a/patches/server/0015-Add-an-option-for-spigot-item-merging-mechanism.patch b/patches/server/0010-Add-an-option-for-spigot-item-merging-mechanism.patch similarity index 86% rename from patches/server/0015-Add-an-option-for-spigot-item-merging-mechanism.patch rename to patches/server/0010-Add-an-option-for-spigot-item-merging-mechanism.patch index 67c0379..d52f836 100644 --- a/patches/server/0015-Add-an-option-for-spigot-item-merging-mechanism.patch +++ b/patches/server/0010-Add-an-option-for-spigot-item-merging-mechanism.patch @@ -5,22 +5,21 @@ Subject: [PATCH] Add an option for spigot item merging mechanism diff --git a/src/main/java/cc/keyimc/keyi/KeyiConfig.java b/src/main/java/cc/keyimc/keyi/KeyiConfig.java -index c93bb951fd456af9e8f030b6f5c7989925c3556f..2ccee00d230f4801c4ed4b80b8415a249e933133 100644 +index 8884a2471b4b7c5cabf1c0c767710ba69c7ae4ec..4f08f2e40f5bc3bc5a87bf3a34945afdec65f288 100644 --- a/src/main/java/cc/keyimc/keyi/KeyiConfig.java +++ b/src/main/java/cc/keyimc/keyi/KeyiConfig.java -@@ -149,6 +149,12 @@ public final class KeyiConfig { +@@ -148,4 +148,10 @@ public final class KeyiConfig { + private static void fixes() { fixTripwireDuping = getBoolean("fixes.fix-tripwire-duping", fixTripwireDuping); } - ++ + public static boolean useSpigotItemMergingMechanism = true; + + private static void performance() { + useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism); + } -+ - // Suki start - only refresh lootables for players - - public static boolean onlyRefreshForPlayers = false; + } +\ No newline at end of file diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java index aa1c929d948cea8f6212330f922eb5f1d9b9bb97..bb72741300cedd1c37fc5611c6472292bdf245a1 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/patches/server/0016-Add-global-eula-file-feature.patch b/patches/server/0011-Add-global-eula-file-feature.patch similarity index 100% rename from patches/server/0016-Add-global-eula-file-feature.patch rename to patches/server/0011-Add-global-eula-file-feature.patch diff --git a/patches/server/0017-Do-not-save-firework-entities-or-the-server-may-be-l.patch b/patches/server/0012-Do-not-save-firework-entities-or-the-server-may-be-l.patch similarity index 100% rename from patches/server/0017-Do-not-save-firework-entities-or-the-server-may-be-l.patch rename to patches/server/0012-Do-not-save-firework-entities-or-the-server-may-be-l.patch diff --git a/patches/server/0018-Disable-arrow-despawn-counter-by-default.patch b/patches/server/0013-Disable-arrow-despawn-counter-by-default.patch similarity index 91% rename from patches/server/0018-Disable-arrow-despawn-counter-by-default.patch rename to patches/server/0013-Disable-arrow-despawn-counter-by-default.patch index 2a5901c..8fbc8ee 100644 --- a/patches/server/0018-Disable-arrow-despawn-counter-by-default.patch +++ b/patches/server/0013-Disable-arrow-despawn-counter-by-default.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Disable arrow despawn counter by default diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index daa437f3aaebed4d917fde65d75a8a941755a764..576a50c0279f5336d606b53aeb2ed76785e1d538 100644 +index bb352ed86e4047e38ad27900f72fc0ddb741bf71..2cc8eeedfd5729fd324b10cb4b2a6298dad39e9d 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -116,7 +116,7 @@ public class PurpurWorldConfig { diff --git a/patches/server/0020-Don-t-create-new-random-instance.patch b/patches/server/0014-Don-t-create-new-random-instance.patch similarity index 96% rename from patches/server/0020-Don-t-create-new-random-instance.patch rename to patches/server/0014-Don-t-create-new-random-instance.patch index ffb6db3..22d7fe1 100644 --- a/patches/server/0020-Don-t-create-new-random-instance.patch +++ b/patches/server/0014-Don-t-create-new-random-instance.patch @@ -7,7 +7,7 @@ Original code by PatinaMC, licensed under GNU General Public License v3.0 You can find the original code on https://github.com/PatinaMC/Patina diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 882512d766bdd52fc6ada18db61d0e7e243ab039..a79aedc82328492629c1347b7154ab087e46d14a 100644 +index 77c00de9b94531f8136469e04e535a43829c0a60..e633be38543a6eb4b2e0e1d834996400762b2536 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -387,7 +387,7 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0021-Skip-entity-move-if-no-movement.patch b/patches/server/0015-Skip-entity-move-if-no-movement.patch similarity index 92% rename from patches/server/0021-Skip-entity-move-if-no-movement.patch rename to patches/server/0015-Skip-entity-move-if-no-movement.patch index 620346f..166e425 100644 --- a/patches/server/0021-Skip-entity-move-if-no-movement.patch +++ b/patches/server/0015-Skip-entity-move-if-no-movement.patch @@ -9,7 +9,7 @@ Original code by RelativityMC, licensed under MIT You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9701a89149cc2bd7330b23c441b51677be0bdc18..0032bd550a398c330e16db8081b8dc8ba21333d2 100644 +index 7ef574008f413008427d075860c9eb5debeef4f4..83eece9c61f8316221a304f3dd69a7fe3cce3727 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -399,6 +399,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -34,7 +34,7 @@ index 9701a89149cc2bd7330b23c441b51677be0bdc18..0032bd550a398c330e16db8081b8dc8b // Paper start - detailed watchdog information io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); synchronized (this.posLock) { -@@ -3821,6 +3829,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3796,6 +3804,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public final void setBoundingBox(AABB boundingBox) { diff --git a/patches/server/0022-Use-Timings-v2-instead-of-spark.patch b/patches/server/0016-Use-Timings-v2-instead-of-spark.patch similarity index 93% rename from patches/server/0022-Use-Timings-v2-instead-of-spark.patch rename to patches/server/0016-Use-Timings-v2-instead-of-spark.patch index 4e06809..f58a439 100644 --- a/patches/server/0022-Use-Timings-v2-instead-of-spark.patch +++ b/patches/server/0016-Use-Timings-v2-instead-of-spark.patch @@ -89,10 +89,10 @@ index e8efbbeece7e866c6c4d7489677d2d9e15fea4d0..8bc0cb9ad5bb4e76d962ff54305e2c08 PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cb2fc1a77d8170772ec4595642d317b04652b293..04a8cc1ec44b474e1048ccb06b4a7c11a61ec29b 100644 +index 735e01c550d561aa21c3c8f7f34a495ec3a0ab67..13d86c1fba2377808a5ef1e2820db445383af156 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -330,13 +330,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop registryreadops, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { super("Server"); SERVER = this; // Paper - better singleton @@ -112,7 +112,7 @@ index cb2fc1a77d8170772ec4595642d317b04652b293..04a8cc1ec44b474e1048ccb06b4a7c11 this.status = new ServerStatus(); this.random = RandomSource.create(); this.port = -1; -@@ -938,9 +938,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; -@@ -1466,20 +1466,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper @@ -312,7 +312,7 @@ index cb2fc1a77d8170772ec4595642d317b04652b293..04a8cc1ec44b474e1048ccb06b4a7c11 } catch (Throwable throwable) { // Spigot Start CrashReport crashreport; -@@ -1585,33 +1584,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.executeBlocking(() -> { this.saveDebugReport(path.resolve("server")); -@@ -2509,40 +2508,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && /*this.random.nextInt(this.spigotConfig.thunderChance) == 0 &&*/ chunk.shouldDoLightning(this.random)) { // Spigot // Paper - disable thunder // Pufferfish - replace random with shouldDoLightning -@@ -900,7 +893,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -893,7 +893,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -971,7 +949,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Pufferfish - optimize further random ticking // Paper start - optimise chunk ticking this.getRandomBlockPosition(j, 0, k, 15, blockposition); -@@ -936,8 +929,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -929,8 +929,8 @@ public class ServerLevel extends Level implements WorldGenLevel { } // Paper start - optimise random block ticking @@ -982,7 +960,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 if (randomTickSpeed > 0) { LevelChunkSection[] sections = chunk.getSections(); int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); -@@ -971,8 +964,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -964,8 +964,8 @@ public class ServerLevel extends Level implements WorldGenLevel { } } // Paper end - optimise random block ticking @@ -993,7 +971,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 } public Optional findLightningRod(BlockPos pos) { -@@ -1264,24 +1257,24 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1257,24 +1257,24 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot end // Paper start- timings final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); @@ -1026,7 +1004,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 Iterator iterator = entity.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1304,17 +1297,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1297,17 +1297,17 @@ public class ServerLevel extends Level implements WorldGenLevel { if (passenger instanceof Player || this.entityTickList.contains(passenger)) { // Paper - EAR 2 final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger); @@ -1050,7 +1028,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 // Paper start - EAR 2 if (isActive) { passenger.rideTick(); -@@ -1326,7 +1319,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1319,7 +1319,7 @@ public class ServerLevel extends Level implements WorldGenLevel { vehicle.positionRider(passenger); } // Paper end - EAR 2 @@ -1059,7 +1037,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 Iterator iterator = passenger.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1335,7 +1328,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1328,7 +1328,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(passenger, entity2); } @@ -1068,7 +1046,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 } } else { passenger.stopRiding(); -@@ -1355,14 +1348,14 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1348,14 +1348,14 @@ public class ServerLevel extends Level implements WorldGenLevel { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); } @@ -1086,7 +1064,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 // Copied from save() // CraftBukkit start - moved from MinecraftServer.saveChunks -@@ -1374,7 +1367,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1367,7 +1367,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.convertable.saveDataTag(this.server.registryHolder, this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); } // CraftBukkit end @@ -1095,7 +1073,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 } // Paper end -@@ -1388,7 +1381,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1381,7 +1381,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit @@ -1104,7 +1082,7 @@ index 00fe84ae4fee41b365223f836c82e1688fe322ee..71ff2cfc4aba6da71911ea717e355764 if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -1398,11 +1391,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1391,11 +1391,11 @@ public class ServerLevel extends Level implements WorldGenLevel { progressListener.progressStage(Component.translatable("menu.savingChunks")); } @@ -1222,21 +1200,9 @@ index 7094701d213c73ba47ace806962244c10fdf4dda..fcdb9bde8e1605e30dde3e580491522d } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index aa27ab72d30f917ea41045db16b6f59f1442ea77..09ae98db728bade8121587e9ded6f3ab98f3bb30 100644 +index 0bb14272d024af90e7aef40f2f694e184af607d3..09ae98db728bade8121587e9ded6f3ab98f3bb30 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -117,9 +117,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - public static final int TICKS_PER_DAY = 24000; - public static final int MAX_ENTITY_SPAWN_Y = 20000000; - public static final int MIN_ENTITY_SPAWN_Y = -20000000; -- protected final List blockEntityTickers = me.jellysquid.mods.lithium.common.util.collections.HashedReferenceList.wrapper(Lists.newArrayList()); public final int getTotalTileEntityTickers() { return this.blockEntityTickers.size(); } // Paper // Jettpack - lithium: HashedReferenceList -+ protected final List blockEntityTickers = Lists.newArrayList(); public final int getTotalTileEntityTickers() { return this.blockEntityTickers.size(); } // Paper - protected final NeighborUpdater neighborUpdater; -- private final List pendingBlockEntityTickers = me.jellysquid.mods.lithium.common.util.collections.HashedReferenceList.wrapper(Lists.newArrayList()); // Jettpack - lithium: HashedReferenceList -+ private final List pendingBlockEntityTickers = Lists.newArrayList(); - private boolean tickingBlockEntities; - public final Thread thread; - private final boolean isDebug; @@ -712,9 +712,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { BlockState iblockdata2 = this.getBlockState(pos); @@ -1349,33 +1315,19 @@ index 50712b2222703fff01378e2ececb0fc0dba60b65..a182b3c804cf56855e15290f826fdebd if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); 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 7249fe1d53c22d4164c68cb89b8df95e92873d1b..e0e4a924e926b086699998095a1abddd01d8c002 100644 +index 2877441927de3aeba28f5c3dd876e2ae4c15797c..e0e4a924e926b086699998095a1abddd01d8c002 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -53,10 +53,6 @@ import net.minecraft.world.level.material.Fluids; - import net.minecraft.world.ticks.LevelChunkTicks; - import net.minecraft.world.ticks.TickContainerAccess; - import org.slf4j.Logger; --// KeYi start --import cc.keyimc.keyi.utils.FastRandom; --import java.util.Random; // KeYi --// KeYi end - - public class LevelChunk extends ChunkAccess { - -@@ -934,9 +930,9 @@ public class LevelChunk extends ChunkAccess { +@@ -930,7 +930,7 @@ public class LevelChunk extends ChunkAccess { this.chunkHolder.getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system if (this.needsDecoration) { - //try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper // Purpur + try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper this.needsDecoration = false; -- Random random = new FastRandom(); -+ java.util.Random random = new java.util.Random(); + java.util.Random random = new java.util.Random(); random.setSeed(this.level.getSeed()); - long xRand = random.nextLong() / 2L * 2L + 1L; - long zRand = random.nextLong() / 2L * 2L + 1L; -@@ -954,7 +950,7 @@ public class LevelChunk extends ChunkAccess { +@@ -950,7 +950,7 @@ public class LevelChunk extends ChunkAccess { } } server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(this.bukkitChunk)); @@ -1384,7 +1336,7 @@ index 7249fe1d53c22d4164c68cb89b8df95e92873d1b..e0e4a924e926b086699998095a1abddd } } } -@@ -1313,10 +1309,10 @@ public class LevelChunk extends ChunkAccess { +@@ -1309,10 +1309,10 @@ public class LevelChunk extends ChunkAccess { if (LevelChunk.this.isTicking(blockposition)) { try { @@ -1398,7 +1350,7 @@ index 7249fe1d53c22d4164c68cb89b8df95e92873d1b..e0e4a924e926b086699998095a1abddd BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); if (this.blockEntity.getType().isValid(iblockdata)) { -@@ -1327,7 +1323,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1323,7 +1323,7 @@ public class LevelChunk extends ChunkAccess { LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata}); } @@ -1407,7 +1359,7 @@ index 7249fe1d53c22d4164c68cb89b8df95e92873d1b..e0e4a924e926b086699998095a1abddd } catch (Throwable throwable) { if (throwable instanceof ThreadDeath) throw throwable; // Paper // Paper start - Prevent tile entity and entity crashes -@@ -1338,7 +1334,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1334,7 +1334,7 @@ public class LevelChunk extends ChunkAccess { // Paper end // Spigot start } finally { @@ -1417,10 +1369,10 @@ index 7249fe1d53c22d4164c68cb89b8df95e92873d1b..e0e4a924e926b086699998095a1abddd } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a57d633c439f66cb27209f56abf391e84bbb52c5..ef0f8c37308dc2fa97bff437319a850526e660c2 100644 +index 3a67aaa39daf1fb86938f53e129aadfb686583b0..33accb56fbc00560e2f253a2150991331e515858 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -436,38 +436,7 @@ public final class CraftServer implements Server { +@@ -435,38 +435,7 @@ public final class CraftServer implements Server { if (!pluginFolder.exists()) { pluginFolder.mkdirs(); } diff --git a/patches/server/0023-Optimized-getBiome-method.patch b/patches/server/0017-Optimized-getBiome-method.patch similarity index 100% rename from patches/server/0023-Optimized-getBiome-method.patch rename to patches/server/0017-Optimized-getBiome-method.patch diff --git a/patches/server/0024-Use-optimized-RecipeManager.patch b/patches/server/0018-Use-optimized-RecipeManager.patch similarity index 100% rename from patches/server/0024-Use-optimized-RecipeManager.patch rename to patches/server/0018-Use-optimized-RecipeManager.patch diff --git a/patches/server/0025-Use-cached-pool-for-mob-spawning-executor.patch b/patches/server/0019-Use-cached-pool-for-mob-spawning-executor.patch similarity index 97% rename from patches/server/0025-Use-cached-pool-for-mob-spawning-executor.patch rename to patches/server/0019-Use-cached-pool-for-mob-spawning-executor.patch index 93851f0..0d86966 100644 --- a/patches/server/0025-Use-cached-pool-for-mob-spawning-executor.patch +++ b/patches/server/0019-Use-cached-pool-for-mob-spawning-executor.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use cached pool for mob spawning executor diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 04a8cc1ec44b474e1048ccb06b4a7c11a61ec29b..66843d7ca82c4be7f45b7b830f0d45d925a3d504 100644 +index 13d86c1fba2377808a5ef1e2820db445383af156..ae95e3af64811f6f149a01b9715d8fdd2c2583fa 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -43,6 +43,7 @@ import java.util.Optional; diff --git a/patches/server/0026-Add-Java19-Support-for-SIMD.patch b/patches/server/0020-Add-Java19-Support-for-SIMD.patch similarity index 100% rename from patches/server/0026-Add-Java19-Support-for-SIMD.patch rename to patches/server/0020-Add-Java19-Support-for-SIMD.patch diff --git a/patches/server/0027-Make-PlayerList-more-thread-safe.patch b/patches/server/0021-Make-PlayerList-more-thread-safe.patch similarity index 100% rename from patches/server/0027-Make-PlayerList-more-thread-safe.patch rename to patches/server/0021-Make-PlayerList-more-thread-safe.patch diff --git a/patches/server/0019-Use-a-faster-random-implementation.patch b/patches/server/0022-Use-a-faster-random-implementation.patch similarity index 91% rename from patches/server/0019-Use-a-faster-random-implementation.patch rename to patches/server/0022-Use-a-faster-random-implementation.patch index d400c34..a7da0f5 100644 --- a/patches/server/0019-Use-a-faster-random-implementation.patch +++ b/patches/server/0022-Use-a-faster-random-implementation.patch @@ -1,12 +1,12 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: nostalgic853 -Date: Mon, 24 Oct 2022 10:52:07 +0800 +Date: Fri, 18 Nov 2022 23:39:13 +0800 Subject: [PATCH] Use a faster random implementation diff --git a/src/main/java/cc/keyimc/keyi/utils/FastRandom.java b/src/main/java/cc/keyimc/keyi/utils/FastRandom.java new file mode 100644 -index 0000000000000000000000000000000000000000..a9b3a467e7dbfdc78c11f04e6bb5a9642c20470c +index 0000000000000000000000000000000000000000..ca75a84c2fe0b163f5618f408372b38e048ae2cd --- /dev/null +++ b/src/main/java/cc/keyimc/keyi/utils/FastRandom.java @@ -0,0 +1,395 @@ @@ -423,29 +423,8 @@ index e5ea9f27a1936ed9e329e74317c91c5df89b9fbd..89a41d396162a1c2eb2df5192b0d888b private long lastFill = -1; private long nextRefill = -1; -diff --git a/src/main/java/me/jellysquid/mods/lithium/common/cached_blockpos_iteration/IterateOutwardsCache.java b/src/main/java/me/jellysquid/mods/lithium/common/cached_blockpos_iteration/IterateOutwardsCache.java -index a5d3aa309d3fdaab9e0fea2dfb91a080a3ac1193..384733b2b0bc7c5108ebdc725c0d13548bd349a3 100644 ---- a/src/main/java/me/jellysquid/mods/lithium/common/cached_blockpos_iteration/IterateOutwardsCache.java -+++ b/src/main/java/me/jellysquid/mods/lithium/common/cached_blockpos_iteration/IterateOutwardsCache.java -@@ -6,6 +6,7 @@ import java.util.Iterator; - import java.util.Random; - import java.util.concurrent.ConcurrentHashMap; - import net.minecraft.core.BlockPos; -+import cc.keyimc.keyi.utils.FastRandom; // KeYi - - /** - * @author 2No2Name, original implemenation by SuperCoder7979 and Gegy1000 -@@ -22,7 +23,7 @@ public class IterateOutwardsCache { - public IterateOutwardsCache(int capacity) { - this.capacity = capacity; - this.table = new ConcurrentHashMap<>(31); -- this.random = new Random(); -+ this.random = new FastRandom(); // KeYi - use a faster random - } - - private void fillPositionsWithIterateOutwards(LongList entry, int xRange, int yRange, int zRange) { 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 620173eef4c2f30a97a4c2f8049ea01fcc60d0b2..1ef5f03a332e832817be132bbbf3ac1021f085d1 100644 +index e0e4a924e926b086699998095a1abddd01d8c002..f55584f7255012599fdce018b85e2e21e4660849 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -53,6 +53,10 @@ import net.minecraft.world.level.material.Fluids; @@ -461,7 +440,7 @@ index 620173eef4c2f30a97a4c2f8049ea01fcc60d0b2..1ef5f03a332e832817be132bbbf3ac10 @@ -932,7 +936,7 @@ public class LevelChunk extends ChunkAccess { if (this.needsDecoration) { - //try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper // Purpur + try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper this.needsDecoration = false; - java.util.Random random = new java.util.Random(); + Random random = new FastRandom(); @@ -469,7 +448,7 @@ index 620173eef4c2f30a97a4c2f8049ea01fcc60d0b2..1ef5f03a332e832817be132bbbf3ac10 long xRand = random.nextLong() / 2L * 2L + 1L; long zRand = random.nextLong() / 2L * 2L + 1L; diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index fc3442b4c7e1f22080fe6bf36d4fade162d6709e..7de2b353db5b76089c10cba826898bcd228f4ad9 100644 +index dcfe090c269d4cbcc2eb1b6f85392848bb34656c..ef8909c9c13c8f46ec6d452f0d14c9a1119e0edf 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java @@ -26,6 +26,7 @@ import net.minecraft.nbt.CompoundTag; @@ -490,7 +469,7 @@ index fc3442b4c7e1f22080fe6bf36d4fade162d6709e..7de2b353db5b76089c10cba826898bcd } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index dabf1649f5bf14ec17dad6d43dcd7e2b7df255d3..ed754df76d3f86e2230c88ebb45125fe6af1e507 100644 +index 41fafd4a1583e748d763439e8838739ec1ff8e1d..48c35afdbb8b08dbc1279bc57ea44bccb65b2a8a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -135,6 +135,7 @@ import org.bukkit.util.Consumer;