diff --git a/gradle.properties b/gradle.properties index 4bdae64..5da6433 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=org.galemc.gale version=1.20.6-R0.1-SNAPSHOT mcVersion=1.20.6 -paperRef=9bf48555241dc03246c67258fe66eaf6c7a4a044 +paperRef=3004717b0e993ec4ec8a15e8e59f3f7677211769 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/api/0007-Do-not-log-plugin-library-loads.patch b/patches/api/0007-Do-not-log-plugin-library-loads.patch index 37d8532..391a1bf 100644 --- a/patches/api/0007-Do-not-log-plugin-library-loads.patch +++ b/patches/api/0007-Do-not-log-plugin-library-loads.patch @@ -55,7 +55,7 @@ index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..92d20e70d26318fbaed8adffd21c6b77 * This class was not meant to be constructed explicitly * diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java -index 8e1b6be2462aaa692efa1f72986921a6dc357196..72b20fa06b461d89f0eeff7b2fbbbe89bae0027c 100644 +index c66252802c51174bc26f266cb5cdecdd856ff220..211c093ce2253e918cd40725ebf1ef172d1b9bdf 100644 --- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java +++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java @@ -68,6 +68,7 @@ public class LibraryLoader @@ -66,7 +66,7 @@ index 8e1b6be2462aaa692efa1f72986921a6dc357196..72b20fa06b461d89f0eeff7b2fbbbe89 logger.log( Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName() ); } } ); -@@ -88,6 +89,7 @@ public class LibraryLoader +@@ -94,6 +95,7 @@ public class LibraryLoader { return null; } @@ -74,7 +74,7 @@ index 8e1b6be2462aaa692efa1f72986921a6dc357196..72b20fa06b461d89f0eeff7b2fbbbe89 logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[] { java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), desc.getLibraries().size() // Paper - use configured log prefix -@@ -135,6 +137,7 @@ public class LibraryLoader +@@ -144,6 +146,7 @@ public class LibraryLoader } jarFiles.add( url ); diff --git a/patches/server/0005-Gale-branding-changes.patch b/patches/server/0005-Gale-branding-changes.patch index 99e5d2c..b9fcfd6 100644 --- a/patches/server/0005-Gale-branding-changes.patch +++ b/patches/server/0005-Gale-branding-changes.patch @@ -464,10 +464,10 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..2596e0ee4df5b96f181e28a742ef3459 @Override diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dbc86b8d4d2af6e5f7e678f2bb77fd39b85c04c5..0b9b55ccf5c719d6683403e2f22aa4c1a67a5f35 100644 +index 0ed42fa899721f83b598db05be1b5f321af3614a..4f54cd1f3ddd32834df0b12bd9c3028b6bc50f0a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -959,7 +959,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getTypeKey(); @@ -391,7 +391,7 @@ index b4ef3ad2c17168085372f1fe46809f02d9dfe74a..3a9437384e781a7a94f12edc6205b7da this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2fa5507aa2153a05208077f9547c165a1099b5bb..34c7e2b7f5799291b6adbeb9063c023e89ff51f1 100644 +index af015237214cebc4d1c4bb9e9c5f939d433e365c..31c461503fd4fbdac5b144537913c1fa8e1a70b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1033,6 +1033,7 @@ public final class CraftServer implements Server { @@ -402,7 +402,7 @@ index 2fa5507aa2153a05208077f9547c165a1099b5bb..34c7e2b7f5799291b6adbeb9063c023e for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) -@@ -3034,6 +3035,14 @@ public final class CraftServer implements Server { +@@ -3029,6 +3030,14 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } diff --git a/patches/server/0016-Make-timings-calls-final.patch b/patches/server/0016-Make-timings-calls-final.patch index a40c212..fe730da 100644 --- a/patches/server/0016-Make-timings-calls-final.patch +++ b/patches/server/0016-Make-timings-calls-final.patch @@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 67cdbf20b00d1d9759d2226111ec6764b82ac7a0..ca9be67ea208ab91192620e9c97c58c2ab4e31f2 100644 +index 729666f8d9fdb83bbc2b1baa3c61ecf02c10cc45..96830b6ec04d96f5108efbccdcbe45047e1230d7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1565,7 +1565,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; -@@ -1606,7 +1567,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getTypeKey(); @@ -1822,7 +1822,7 @@ index 3a9437384e781a7a94f12edc6205b7da87a0cf49..df7ff0ff2f83dead1d404f033369c0d5 this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration -@@ -232,7 +231,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -223,7 +222,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } // CraftBukkit end @@ -1830,7 +1830,7 @@ index 3a9437384e781a7a94f12edc6205b7da87a0cf49..df7ff0ff2f83dead1d404f033369c0d5 this.levelData = worlddatamutable; this.dimensionTypeRegistration = holder; final DimensionType dimensionmanager = (DimensionType) holder.value(); -@@ -1262,9 +1260,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1253,9 +1251,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } protected void tickBlockEntities() { @@ -1840,7 +1840,7 @@ index 3a9437384e781a7a94f12edc6205b7da87a0cf49..df7ff0ff2f83dead1d404f033369c0d5 this.timings.tileEntityPending.startTiming(); // Spigot this.tickingBlockEntities = true; if (!this.pendingBlockEntityTickers.isEmpty()) { -@@ -1305,7 +1300,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1296,7 +1291,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.timings.tileEntityTick.stopTiming(); // Spigot this.tickingBlockEntities = false; co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper @@ -1848,7 +1848,7 @@ index 3a9437384e781a7a94f12edc6205b7da87a0cf49..df7ff0ff2f83dead1d404f033369c0d5 this.spigotConfig.currentPrimedTnt = 0; // Spigot } -@@ -1520,7 +1514,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1511,7 +1505,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @Override public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { @@ -1856,7 +1856,7 @@ index 3a9437384e781a7a94f12edc6205b7da87a0cf49..df7ff0ff2f83dead1d404f033369c0d5 List list = Lists.newArrayList(); ((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call return list; -@@ -1539,7 +1532,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1530,7 +1523,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { @@ -1864,7 +1864,7 @@ index 3a9437384e781a7a94f12edc6205b7da87a0cf49..df7ff0ff2f83dead1d404f033369c0d5 // Paper start - optimise this call //TODO use limit if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) { -@@ -1794,11 +1786,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1785,11 +1777,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public ProfilerFiller getProfiler() { diff --git a/patches/server/0023-Move-random-tick-random.patch b/patches/server/0023-Move-random-tick-random.patch index 2e88c09..5d25046 100644 --- a/patches/server/0023-Move-random-tick-random.patch +++ b/patches/server/0023-Move-random-tick-random.patch @@ -19,7 +19,7 @@ require it to be initialized earlier. By moving it to the superclass, we initialize it earlier, ensuring that it is available sooner. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 3217bfc0df76c4211187fc4643132242c9018c56..76b6cb6015c8d8ad1aca34bfe8ea4f20468f57fb 100644 +index db21e92d1e81e34a80342581107e20a314415481..10723ae32ff7c293ee6c67d8a62e1af6edf971c2 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -961,7 +961,6 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -31,7 +31,7 @@ index 3217bfc0df76c4211187fc4643132242c9018c56..76b6cb6015c8d8ad1aca34bfe8ea4f20 public void tickChunk(LevelChunk chunk, int randomTickSpeed) { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index df7ff0ff2f83dead1d404f033369c0d59cef9089..d934ba31e397fae2498e7c6a9499bc5eb98eb897 100644 +index 7f6f50a33e017b671cdc3a21e618bb71365b2136..ded50c5fb9ae139f436dce76db3a33a965a828f7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -181,6 +181,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -40,6 +40,6 @@ index df7ff0ff2f83dead1d404f033369c0d59cef9089..d934ba31e397fae2498e7c6a9499bc5e + public final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); // Gale - Pufferfish - move random tick random + - // Paper start - fix and optimise world upgrading - // copied from below - public static ResourceKey getDimensionKey(DimensionType manager) { + public CraftWorld getWorld() { + return this.world; + } diff --git a/patches/server/0036-Inline-level-height.patch b/patches/server/0036-Inline-level-height.patch index 6bb716a..9c317e7 100644 --- a/patches/server/0036-Inline-level-height.patch +++ b/patches/server/0036-Inline-level-height.patch @@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index d934ba31e397fae2498e7c6a9499bc5eb98eb897..0c0396e0d3e23485a069a8b6bbd637826a7b1119 100644 +index ded50c5fb9ae139f436dce76db3a33a965a828f7..b335b738ef1f9c1cfecfab26e6653e2fa9500848 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -218,6 +218,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -209,6 +209,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); @@ -50,7 +50,7 @@ index d934ba31e397fae2498e7c6a9499bc5eb98eb897..0c0396e0d3e23485a069a8b6bbd63782 protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config -@@ -237,6 +246,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -228,6 +237,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.dimensionTypeRegistration = holder; final DimensionType dimensionmanager = (DimensionType) holder.value(); diff --git a/patches/server/0041-Remove-lambda-from-ticking-guard.patch b/patches/server/0041-Remove-lambda-from-ticking-guard.patch index cc243bb..9a88685 100644 --- a/patches/server/0041-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0041-Remove-lambda-from-ticking-guard.patch @@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index da218c526740244d633b63b537539cb59e505fe7..92a53e55e6431a2748e5a489ca0375930087c3cf 100644 +index 820836ca964f7785099eb685b7cb1757ac61c12b..4bb9e099b647a6a524395d9e5393ef6f2fdc9153 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -900,7 +900,20 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -57,10 +57,10 @@ index da218c526740244d633b63b537539cb59e505fe7..92a53e55e6431a2748e5a489ca037593 } } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0c0396e0d3e23485a069a8b6bbd637826a7b1119..50f660de3d94c2b30668f8fd09a590a2d1b3ba16 100644 +index b335b738ef1f9c1cfecfab26e6653e2fa9500848..5d8c9c56d30cd74ffe5941832978d72f421d3639 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1325,13 +1325,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1316,13 +1316,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { tickConsumer.accept(entity); MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick diff --git a/patches/server/0078-Reduce-array-allocations.patch b/patches/server/0078-Reduce-array-allocations.patch index adc321d..0251616 100644 --- a/patches/server/0078-Reduce-array-allocations.patch +++ b/patches/server/0078-Reduce-array-allocations.patch @@ -392,7 +392,7 @@ index 4aa6232bf0f72fcde32d257100bd15b1c5192aaa..ad73e14f068ae2f3b83769eef1191b9b private static final Codec ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC) .xmap( diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 5443013060b62e3bfcc51cddca96d1c0bc59fe72..76a1b31a55b1838dc80b796f997edaddbcaa755c 100644 +index 244a19ecd0234fa1d7a6ecfea20751595688605d..f76ca394169d844a263a53c31c30e57de4381e0d 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -89,7 +89,7 @@ public class Main { @@ -449,7 +449,7 @@ index 4bb9e099b647a6a524395d9e5393ef6f2fdc9153..5ec5ed9ac62fda568fd011dd62b1c5a2 return ret; } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3cc51e2be04feff9c0e645b0a39bf969de37de0d..5404d8b54c8c8d48e4b92ca947d431ed60bb7ce8 100644 +index 59b157545b562ea94ffbc42c8174f4c573d79399..50bf9b83614bbfc1ed76c08d6fea113a1a771b25 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -29,6 +29,8 @@ import java.util.function.Consumer; @@ -624,7 +624,7 @@ index eb3c12e03c0d5c9cec84d97e2c51c50ce59c23a4..9b29ec4e72e4cdf2a42868ca5659fdcf private EquipmentSlot(final EquipmentSlot.Type type, final int entityId, final int armorStandId, final String name) { this.type = type; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index b095a5b4c2390bc3e52f8bb559c621ecb42db2c6..70f1aec3e396561b111696b7ddc31ce848702671 100644 +index 91e3e4a126c1565538d190b5da552ba999c28ba8..8a1ff07671d2b1e6f5132d81733a00fd5d2179c1 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3233,7 +3233,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -745,7 +745,7 @@ index e158ff1a9dbd054985873e854fcf6c433102059c..4dbe4db3e7b005eabdec56e5047ad7bc private static Enchantment register(String name, Enchantment enchantment) { return Registry.register(BuiltInRegistries.ENCHANTMENT, name, enchantment); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 50f660de3d94c2b30668f8fd09a590a2d1b3ba16..5854c76fadd8fe08d0d0ca5d01ce218b86a508c1 100644 +index 5d8c9c56d30cd74ffe5941832978d72f421d3639..ba2c1672a018dbd0a179e71f7166fb9df87782dd 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -10,6 +10,8 @@ import java.util.function.Consumer; @@ -757,7 +757,7 @@ index 50f660de3d94c2b30668f8fd09a590a2d1b3ba16..5854c76fadd8fe08d0d0ca5d01ce218b import net.minecraft.CrashReport; import net.minecraft.CrashReportCategory; import net.minecraft.core.BlockPos; -@@ -1870,7 +1872,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1861,7 +1863,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) { io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ); if (slices == null) { diff --git a/patches/server/0117-CraftBukkit-UUID-to-world-map.patch b/patches/server/0117-CraftBukkit-UUID-to-world-map.patch index 26f1b2c..f75084e 100644 --- a/patches/server/0117-CraftBukkit-UUID-to-world-map.patch +++ b/patches/server/0117-CraftBukkit-UUID-to-world-map.patch @@ -13,7 +13,7 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5756ea8ca76f47118ac0b06a02c5663b1b544518..8fc6d5c02065027520cfa6eef109820b0476477a 100644 +index e738c814f9b24e9a2593e9b91294a9f67231a5b4..69b23604d7a8ca40eb8b025d70dfd4803e9f3382 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -40,6 +40,9 @@ import java.util.logging.Logger; @@ -34,7 +34,7 @@ index 5756ea8ca76f47118ac0b06a02c5663b1b544518..8fc6d5c02065027520cfa6eef109820b // private final Map, Registry> registries = new HashMap<>(); // Paper - replace with RegistryAccess private YamlConfiguration configuration; private YamlConfiguration commandsConfiguration; -@@ -1455,6 +1459,7 @@ public final class CraftServer implements Server { +@@ -1450,6 +1454,7 @@ public final class CraftServer implements Server { this.getLogger().log(Level.SEVERE, null, ex); } @@ -42,7 +42,7 @@ index 5756ea8ca76f47118ac0b06a02c5663b1b544518..8fc6d5c02065027520cfa6eef109820b this.worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH)); this.console.removeLevel(handle); return true; -@@ -1473,12 +1478,7 @@ public final class CraftServer implements Server { +@@ -1468,12 +1473,7 @@ public final class CraftServer implements Server { @Override public World getWorld(UUID uid) { @@ -56,7 +56,7 @@ index 5756ea8ca76f47118ac0b06a02c5663b1b544518..8fc6d5c02065027520cfa6eef109820b } // Paper start -@@ -1496,6 +1496,7 @@ public final class CraftServer implements Server { +@@ -1491,6 +1491,7 @@ public final class CraftServer implements Server { System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world."); return; } diff --git a/patches/server/0119-Specific-interval-TPS-API.patch b/patches/server/0119-Specific-interval-TPS-API.patch index d167515..6762cd1 100644 --- a/patches/server/0119-Specific-interval-TPS-API.patch +++ b/patches/server/0119-Specific-interval-TPS-API.patch @@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8fc6d5c02065027520cfa6eef109820b0476477a..809e652467491da306a9d876274e91e398259dd8 100644 +index 69b23604d7a8ca40eb8b025d70dfd4803e9f3382..3768a55c5e20ec47e2b1d41dacb1496006a30652 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -3086,6 +3086,24 @@ public final class CraftServer implements Server { +@@ -3081,6 +3081,24 @@ public final class CraftServer implements Server { }; } diff --git a/patches/server/0120-5-second-TPS-average.patch b/patches/server/0120-5-second-TPS-average.patch index b9cbf30..5ddb6c4 100644 --- a/patches/server/0120-5-second-TPS-average.patch +++ b/patches/server/0120-5-second-TPS-average.patch @@ -59,10 +59,10 @@ index 039a86034928a5eb7aaa2d7ca76a7bddcca346bd..7c32c60100cf2bd109eb8762efa856c1 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 26ff5f76b79a722f56afa8c55a2941f99642998b..d3878d2b9bbff9b68089a415e9d8c2b044fdfb2d 100644 +index d5113b3650ec45127246b18e1f64526bff1798e4..55ea6cd231128b7c2781e59a4fe51a021ab35bb8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1065,6 +1065,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop -Date: Fri, 24 Mar 2023 09:16:33 +0100 -Subject: [PATCH] Instantly continue on world upgrade finish - -License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) -Gale - https://galemc.org - -diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java -index 7f6d1ccd147e5593412567bb2934ce5662da7ef0..c3bc7fab47da974f6b134ca91a79af72c9d44c1c 100644 ---- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java -+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java -@@ -26,6 +26,7 @@ import java.util.Optional; - import java.util.concurrent.ExecutorService; - import java.util.concurrent.Executors; - import java.util.concurrent.ThreadFactory; -+import java.util.concurrent.TimeUnit; - import java.util.concurrent.atomic.AtomicInteger; - import java.util.concurrent.atomic.AtomicLong; - import java.util.function.Supplier; -@@ -101,7 +102,12 @@ public class ThreadedWorldUpgrader { - new ChunkStorage(storageInfo, regionFolder.toPath(), this.dataFixer, false), this.removeCaches, this.dimensionType, this.generatorKey); - - long expectedChunks = (long)regionFiles.length * (32L * 32L); -+ // Gale start - instantly continue on world upgrade finish -+ final long[] finalExpectedChunks = {-1L}; - -+ var finishLock = new java.util.concurrent.locks.ReentrantLock(); -+ var finishCondition = finishLock.newCondition(); -+ // Gale end - instantly continue on world upgrade finish - for (final File regionFile : regionFiles) { - final ChunkPos regionPos = RegionFileStorage.getRegionFileCoordinates(regionFile.toPath()); - if (regionPos == null) { -@@ -109,7 +115,23 @@ public class ThreadedWorldUpgrader { - continue; - } - -- this.threadPool.execute(new ConvertTask(info, regionPos.x >> 5, regionPos.z >> 5)); -+ // Gale start - instantly continue on world upgrade finish -+ Runnable taskWithNotification = () -> { -+ new ConvertTask(info, regionPos.x >> 5, regionPos.z >> 5).run(); -+ final long current = info.convertedChunks.get(); -+ if (current == finalExpectedChunks[0]) { -+ while (!finishLock.tryLock()) { -+ Thread.onSpinWait(); -+ } -+ try { -+ finishCondition.signal(); -+ } finally { -+ finishLock.unlock(); -+ } -+ } -+ }; -+ this.threadPool.execute(taskWithNotification); -+ // Gale end - instantly continue on world upgrade finish - // Paper start - Write SavedData IO async - this.threadPool.execute(() -> { - try { -@@ -120,6 +142,7 @@ public class ThreadedWorldUpgrader { - }); - // Paper end - Write SavedData IO async - } -+ finalExpectedChunks[0] = expectedChunks; // Gale - instantly continue on world upgrade finish - this.threadPool.shutdown(); - - final DecimalFormat format = new DecimalFormat("#0.00"); -@@ -131,9 +154,16 @@ public class ThreadedWorldUpgrader { - - LOGGER.info("{}% completed ({} / {} chunks)...", format.format((double)current / (double)expectedChunks * 100.0), current, expectedChunks); - -+ // Gale start - instantly continue on world upgrade finish -+ while (!finishLock.tryLock()) { -+ Thread.onSpinWait(); -+ } - try { -- Thread.sleep(1000L); -- } catch (final InterruptedException ignore) {} -+ finishCondition.await(1000L, TimeUnit.MILLISECONDS); -+ } catch (final InterruptedException ignore) {} finally { -+ finishLock.unlock(); -+ } -+ // Gale end - instantly continue on world upgrade finish - } - - final long end = System.nanoTime(); diff --git a/patches/server/0137-Virtual-thread-support.patch b/patches/server/0136-Virtual-thread-support.patch similarity index 100% rename from patches/server/0137-Virtual-thread-support.patch rename to patches/server/0136-Virtual-thread-support.patch