diff --git a/gradle.properties b/gradle.properties index 652a04e4..a4e99bdf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ group=org.leavesmc.leaves version=1.21-R0.1-SNAPSHOT mcVersion=1.21 -paperRef=5a5035be964f3350b06264a31d8add2fa9d2994f -preVersion=true -updatingMinecraft=true +paperRef=0246a9da86a923e68d079eeceaeabdf750ee630d +preVersion=false +updatingMinecraft=false org.gradle.jvmargs=-Xmx2G org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/server/0003-Delete-Timings.patch b/patches/server/0003-Delete-Timings.patch index 1117a6ea..4ab8c0c4 100644 --- a/patches/server/0003-Delete-Timings.patch +++ b/patches/server/0003-Delete-Timings.patch @@ -741,7 +741,7 @@ index 0c3c82b28e581286b798ee58ca4193efc2faff4a..fe6a5a6377bcb577b21471ae93639f8d // return true as command was handled return 1; diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index d20969e18984c9b93483477f31b079686977b1db..5a05d42634e82b8667aac0ca4071d6d71d753090 100644 +index 214ea75502d4abf9ebbc99a3811e4d2f8465227e..68c1fa35fccb98245dfb9f68ba14b1c16b13c5e1 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java @@ -1,6 +1,5 @@ @@ -750,8 +750,8 @@ index d20969e18984c9b93483477f31b079686977b1db..5a05d42634e82b8667aac0ca4071d6d7 -import co.aikar.timings.MinecraftTimings; import com.mojang.logging.LogUtils; import io.papermc.paper.configuration.constraint.Constraints; - import io.papermc.paper.configuration.type.number.IntOr; -@@ -117,7 +116,6 @@ public class GlobalConfiguration extends ConfigurationPart { + import io.papermc.paper.configuration.type.number.DoubleOr; +@@ -118,7 +117,6 @@ public class GlobalConfiguration extends ConfigurationPart { @PostProcess private void postProcess() { @@ -1008,7 +1008,7 @@ index 0b4a70ebd312038d5b128c9e1f990666d1642a1a..a108ebfe472c908e86e0af2cfd9cb630 // Paper start if (waitableArray[0] != null) { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d85cbcc06b35d5a3467d7d1c81c9f09c1a8db175..dba161d9024db15c5267738535250fb154f45a5a 100644 +index 1e0a6e5a3c907ab55ee6f2780a7d43bd455f2b7b..460e3c572884db5862a3f6101cf44d900d77e43b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,6 +1,5 @@ @@ -1018,7 +1018,7 @@ index d85cbcc06b35d5a3467d7d1c81c9f09c1a8db175..dba161d9024db15c5267738535250fb1 import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList.Builder; import com.google.common.collect.Iterables; -@@ -959,7 +958,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -958,7 +957,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -1026,7 +1026,7 @@ index d85cbcc06b35d5a3467d7d1c81c9f09c1a8db175..dba161d9024db15c5267738535250fb1 ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -984,17 +982,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -983,17 +981,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -1045,7 +1045,7 @@ index d85cbcc06b35d5a3467d7d1c81c9f09c1a8db175..dba161d9024db15c5267738535250fb1 } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 8a0b00d645e4cf2ca96ec7e8ebc6ef726a0ab8b0..63869a234de3e69a690d3d0113755e64bd519b02 100644 +index dcb5651d1d9b10b40430fb2f713beedf68336704..68e445c21e0acbdf6bb74d50ddd32e0ef2c0e9ad 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -356,9 +356,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @@ -1058,7 +1058,7 @@ index 8a0b00d645e4cf2ca96ec7e8ebc6ef726a0ab8b0..63869a234de3e69a690d3d0113755e64 } @Override -@@ -393,26 +391,20 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -394,26 +392,20 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @Override public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) { this.level.getProfiler().push("purge"); @@ -1085,7 +1085,7 @@ index 8a0b00d645e4cf2ca96ec7e8ebc6ef726a0ab8b0..63869a234de3e69a690d3d0113755e64 this.level.getProfiler().pop(); this.clearCache(); } -@@ -448,13 +440,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -449,13 +441,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } // Paper end - chunk tick iteration optimisations Iterator iterator = null; // Paper - chunk tick iteration optimisations @@ -1099,7 +1099,7 @@ index 8a0b00d645e4cf2ca96ec7e8ebc6ef726a0ab8b0..63869a234de3e69a690d3d0113755e64 int k = this.distanceManager.getNaturalSpawnChunkCount(); // Paper start - Optional per player mob spawns int naturalSpawnChunkCount = k; -@@ -479,7 +469,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -480,7 +470,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false); } // Paper end - Optional per player mob spawns @@ -1107,7 +1107,7 @@ index 8a0b00d645e4cf2ca96ec7e8ebc6ef726a0ab8b0..63869a234de3e69a690d3d0113755e64 this.lastSpawnState = spawnercreature_d; gameprofilerfiller.popPush("spawnAndTick"); -@@ -520,19 +509,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -521,19 +510,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } } } @@ -1127,7 +1127,7 @@ index 8a0b00d645e4cf2ca96ec7e8ebc6ef726a0ab8b0..63869a234de3e69a690d3d0113755e64 { final it.unimi.dsi.fastutil.objects.ObjectArrayList chunks = (it.unimi.dsi.fastutil.objects.ObjectArrayList)list; final ServerChunkCache.ChunkAndHolder[] raw = chunks.elements(); -@@ -546,7 +531,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -547,7 +532,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon holder.holder().broadcastChanges(holder.chunk()); } } diff --git a/patches/server/0004-Leaves-Server-Utils.patch b/patches/server/0004-Leaves-Server-Utils.patch index 4a8edbb1..9f4a3cf9 100644 --- a/patches/server/0004-Leaves-Server-Utils.patch +++ b/patches/server/0004-Leaves-Server-Utils.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Server Utils diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1f7594e22f0f08ae110ef9b42f15119358aa5723..bea901be9d4d86cc016cc48a16f2775cf92d98d9 100644 +index 490ee48346395fcbaf2eb0151e9248f18974fea6..7d7258c56cfade2d82acdf83dfa20cd0416c0dab 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -430,6 +430,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -429,6 +429,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess private UUID originWorld; public boolean freezeLocked = false; // Paper - Freeze Tick Lock API public boolean fixedPose = false; // Paper - Expand Pose API diff --git a/patches/server/0010-Fakeplayer-support.patch b/patches/server/0010-Fakeplayer-support.patch index c428a701..b07f5d18 100644 --- a/patches/server/0010-Fakeplayer-support.patch +++ b/patches/server/0010-Fakeplayer-support.patch @@ -71,10 +71,10 @@ index 9fabf9322acd663c4452b562494e74aa42eb19da..b5f18a0115b629930de84a9d086505ad AdvancementProgress advancementprogress = this.getOrStartProgress(advancement); boolean flag1 = advancementprogress.isDone(); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index dba161d9024db15c5267738535250fb154f45a5a..80bffea97a6bb12b92c1644a1f1d547783454060 100644 +index 460e3c572884db5862a3f6101cf44d900d77e43b..14494e49cdd9d07be125823b07731d04768a64b3 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1268,6 +1268,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1267,6 +1267,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } else if (this.seenBy.remove(player.connection)) { this.serverEntity.removePairing(player); @@ -305,7 +305,7 @@ index 8ccd40b562691e757c7b5efa1497d93a95040a9a..901e9ff7a89b48b7acca7e5b96f64004 + // Leaves end - fakeplayer support } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bea901be9d4d86cc016cc48a16f2775cf92d98d9..36577e641ef0cdc5bf273389ae92f0b83d13d78f 100644 +index 7d7258c56cfade2d82acdf83dfa20cd0416c0dab..1beefbd05c13181214e188f50e88fb67f6712a45 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1455,7 +1455,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -468,7 +468,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..7daa86bff793c040a10125e033b36fbd CraftParticle.createParticleParam(particle, data), // Particle x, y, z, // Position diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2cde808bfa797256409879505ba205a71f381981..a007beca6c00bce4514889935b1762a37826c75a 100644 +index cd789c235acf740ec29c30b180e7fbe1a140caa9..9c3df47ae65289c27a1d63ac06ca41c074ff374e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -94,6 +94,8 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/server/0020-Optimize-entity-coordinate-key.patch b/patches/server/0020-Optimize-entity-coordinate-key.patch index ad649be3..8b9f4d60 100644 --- a/patches/server/0020-Optimize-entity-coordinate-key.patch +++ b/patches/server/0020-Optimize-entity-coordinate-key.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize entity coordinate key This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 36577e641ef0cdc5bf273389ae92f0b83d13d78f..2563e077ceaf6c21e20f00c59341abcca39c91eb 100644 +index 1beefbd05c13181214e188f50e88fb67f6712a45..a95fd8164ddd2992525e1f453df2094ed2108cf7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -316,7 +316,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -315,7 +315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public double yo; public double zo; private Vec3 position; diff --git a/patches/server/0029-Remove-streams-and-iterators-from-range-check.patch b/patches/server/0029-Remove-streams-and-iterators-from-range-check.patch index 23e96f75..920ebd4f 100644 --- a/patches/server/0029-Remove-streams-and-iterators-from-range-check.patch +++ b/patches/server/0029-Remove-streams-and-iterators-from-range-check.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remove streams and iterators from range check This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 80bffea97a6bb12b92c1644a1f1d547783454060..d9c36827706776e143fccd72b53c12a9ac455475 100644 +index 14494e49cdd9d07be125823b07731d04768a64b3..5fe7ae8b873f71a0caf886e6036a4f58c835c4c2 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1284,19 +1284,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1283,19 +1283,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance); } diff --git a/patches/server/0043-MC-Technical-Survival-Mode.patch b/patches/server/0043-MC-Technical-Survival-Mode.patch index f19645a2..55fc50a3 100644 --- a/patches/server/0043-MC-Technical-Survival-Mode.patch +++ b/patches/server/0043-MC-Technical-Survival-Mode.patch @@ -27,10 +27,10 @@ index 8fe9a0bf5a6c27d8a505afc2f51b3dccc905423b..979d70561c1a3b9b539f413ba689a89a } return player.displayName(); diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..12cf1f7ba7d6c14b8b31d939b6f281bd2135656a 100644 +index 783eac6e458c6f1a0584301fb84a2fe341868f34..fab68378705def88f4bf9d243747ac3420fe8b31 100644 --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -@@ -316,6 +316,7 @@ public class PaperConfigurations extends Configurations persistentStateManagerFactory) { this.level = world; this.mainThreadProcessor = new ServerChunkCache.MainThreadExecutor(world); -@@ -420,6 +426,22 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -421,6 +427,22 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon gameprofilerfiller.push("pollingChunks"); gameprofilerfiller.push("filteringLoadedChunks"); @@ -44,7 +44,7 @@ index 63869a234de3e69a690d3d0113755e64bd519b02..16a4cca571326732566e4725404059bb // Paper start - chunk tick iteration optimisations List list; { -@@ -474,6 +496,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -475,6 +497,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon gameprofilerfiller.popPush("spawnAndTick"); boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit @@ -60,7 +60,7 @@ index 63869a234de3e69a690d3d0113755e64bd519b02..16a4cca571326732566e4725404059bb if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.level.random); // Paper - per player mob spawns - do not need this when per-player is enabled // Paper start - PlayerNaturallySpawnCreaturesEvent int chunkRange = level.spigotConfig.mobSpawnRange; -@@ -496,7 +527,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -497,7 +528,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon if (true && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair)) { // Paper - rewrite chunk system chunk1.incrementInhabitedTime(j); if (flag && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair, true)) { // Spigot