diff --git a/gradle.properties b/gradle.properties index e559bd06..45d7be40 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,5 +4,5 @@ version=1.20.2-R0.1-SNAPSHOT mcVersion=1.20.2 packageVersion=1_20_R2 org.gradle.jvmargs=-Xmx2G -paperRef=e57af7d01e509c747520cc1037169029256289bf +paperRef=90fe0d58a5945c31f2c1b138799f64f2fe3475d8 preVersion=false diff --git a/patches/api/0009-Force-peaceful-mode-switch.patch b/patches/api/0009-Force-peaceful-mode-switch.patch index c2c957ec..f843cb8b 100644 --- a/patches/api/0009-Force-peaceful-mode-switch.patch +++ b/patches/api/0009-Force-peaceful-mode-switch.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 8d861f5522a33669f67b3e41dfbc5234637114b4..54fb966467cf2aa13bbc39b6360517ff6541980d 100644 +index 91eb95b04094394e8dc1e3a3343efc63690c87e4..1240a16b45e037f137e14200e2edab780705576d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -4018,6 +4018,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -4080,6 +4080,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @NotNull public Set getFeatureFlags(); diff --git a/patches/server/0002-Delete-Timings.patch b/patches/server/0002-Delete-Timings.patch index 45a399a4..6abdcf32 100644 --- a/patches/server/0002-Delete-Timings.patch +++ b/patches/server/0002-Delete-Timings.patch @@ -1161,7 +1161,7 @@ index 81e3d3dbc74e238c76ead4a0b6efaa2ada3cc49d..6e42c5b72598aaff4a4d3c4ebb9c7bd2 // 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 0c2617574e21037d94ac56ad08b490f9bca5c5af..8bb72e567633dff5d5748b221771d16d25bf8e39 100644 +index 28c6ec04750daca3d77a0cee2b9f17f2508662cc..8486ed5cfb6268cfb9f0b7ce544aef10e459bbc7 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,13 +1,10 @@ @@ -1620,7 +1620,7 @@ index 17610196db7a1c6feb2cf74a02479a8691aa323f..47bf04c95163149063d1828a02d0d86d } else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8bd243a8d5a4be54f907af2b02e96ea833cee62f..6c704b32091b2d7db742e1a68404ba6db1f9154f 100644 +index 34fcdeb0f4039f1fc6c4c8c593cc615560af1ba2..d52aae55bde8f3c831481580d43c73aa781a22b9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2388,7 +2388,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1709,7 +1709,7 @@ index 73871f456a85bda1e51f54986d0e61fb629822e8..7dbb55953ce9fb489c8a6706bc8a64fd return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 77a1c7dfbaccc2e74da5c78ce4dfcd1717a7ac65..7b395528b8e0853c6b3e040526edad07e54c02ba 100644 +index b95f88d5e5b4785ee063695fd81935636a0588d1..d54b91c8227c2e89e56d56ea3260d27ff93ff3e7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1953,10 +1953,10 @@ index 370a25d2deb54f10a35ee24d9e7e92fbfde60edf..ca8a5ae1df1761588233068f9c8288d0 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 4abec88caab4116cfa318f7b66c6b1a8346a7401..8bb33965605ee1fdd5d37662f147dcc4a3fc4877 100644 +index 3e9758fa40bf93fe3d315cc66389193bd57bc393..61db2201e88a0db06a9d4c332178a55953c5a851 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -790,7 +790,6 @@ public class LevelChunk extends ChunkAccess { +@@ -786,7 +786,6 @@ public class LevelChunk extends ChunkAccess { this.chunkHolder.getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system if (this.needsDecoration) { @@ -1964,7 +1964,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..8bb33965605ee1fdd5d37662f147dcc4 this.needsDecoration = false; java.util.Random random = new java.util.Random(); random.setSeed(this.level.getSeed()); -@@ -810,7 +809,6 @@ public class LevelChunk extends ChunkAccess { +@@ -806,7 +805,6 @@ public class LevelChunk extends ChunkAccess { } } server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); @@ -1972,7 +1972,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..8bb33965605ee1fdd5d37662f147dcc4 } } } -@@ -1168,7 +1166,6 @@ public class LevelChunk extends ChunkAccess { +@@ -1164,7 +1162,6 @@ public class LevelChunk extends ChunkAccess { ProfilerFiller gameprofilerfiller = LevelChunk.this.level.getProfiler(); gameprofilerfiller.push(this::getType); @@ -1980,7 +1980,7 @@ index 4abec88caab4116cfa318f7b66c6b1a8346a7401..8bb33965605ee1fdd5d37662f147dcc4 BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); if (this.blockEntity.getType().isValid(iblockdata)) { -@@ -1189,9 +1186,6 @@ public class LevelChunk extends ChunkAccess { +@@ -1185,9 +1182,6 @@ public class LevelChunk extends ChunkAccess { LevelChunk.this.removeBlockEntity(this.getPos()); // Paper end // Spigot start @@ -2149,10 +2149,10 @@ index 7a2f46579352870cfbb32c343d7c68919758ffe3..c583ad62d70ab073a1dd95b11b5bd2bf } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 96f6e0554baf5915dd1f5b93f3bcfe7a13393c29..ed2783e633e28e891778213a1b8248c7f3252ea6 100644 +index 6b31f88803041c75023a2c99bdc1efd902f0205c..3ec205299955d088c05f5f9f7625ba8a8ebdad90 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -209,7 +209,6 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -214,7 +214,6 @@ public final class CraftMagicNumbers implements UnsafeValues { // Paper start @Override public void reportTimings() { diff --git a/patches/server/0027-Optimize-random-calls-in-chunk-ticking.patch b/patches/server/0027-Optimize-random-calls-in-chunk-ticking.patch index c0001ca6..53712af5 100644 --- a/patches/server/0027-Optimize-random-calls-in-chunk-ticking.patch +++ b/patches/server/0027-Optimize-random-calls-in-chunk-ticking.patch @@ -22,7 +22,7 @@ index 950b9d4ef4a9cb0e3f2ff083d84f1ebb2c642ebd..45cac95d44509ec8fcc46177a47c3073 boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 244cf1e0b1f767a41f0a863e77b58c66ee3ff71f..897d7f9abacfea2aae2f6e067065c55333a0b391 100644 +index aac170cb0b3b83acc425875b14301a37811a6d1d..7e201e056d3d3d7370776f7e1f3f8146998945e0 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -948,6 +948,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -49,7 +49,7 @@ index 244cf1e0b1f767a41f0a863e77b58c66ee3ff71f..897d7f9abacfea2aae2f6e067065c553 if (this.isRainingAt(blockposition)) { 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 8bb33965605ee1fdd5d37662f147dcc4a3fc4877..7d9d09b0f84acb3a4692c58e5b6876a2e1875ba7 100644 +index 61db2201e88a0db06a9d4c332178a55953c5a851..17696dfdb3ad1d8c63ff1d1fa0c5eb6bf2e2ae42 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -86,6 +86,18 @@ public class LevelChunk extends ChunkAccess { @@ -71,7 +71,7 @@ index 8bb33965605ee1fdd5d37662f147dcc4a3fc4877..7d9d09b0f84acb3a4692c58e5b6876a2 public LevelChunk(Level world, ChunkPos pos) { this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null); } -@@ -113,6 +125,12 @@ public class LevelChunk extends ChunkAccess { +@@ -109,6 +121,12 @@ public class LevelChunk extends ChunkAccess { this.postLoad = entityLoader; this.blockTicks = blockTickScheduler; this.fluidTicks = fluidTickScheduler; diff --git a/patches/server/0042-BBOR-Protocol.patch b/patches/server/0042-BBOR-Protocol.patch index 69b318e4..7c2ce532 100644 --- a/patches/server/0042-BBOR-Protocol.patch +++ b/patches/server/0042-BBOR-Protocol.patch @@ -17,10 +17,10 @@ index 59b2124ea6d9b489488ace4fcd4529420a8eca99..7f835ccc97daa0d5ebfebc0a5781233a public boolean isAllowCheatsForAllPlayers() { 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 7d9d09b0f84acb3a4692c58e5b6876a2e1875ba7..6f005cc4b90d2610c8a2ce246f29156132e68267 100644 +index 17696dfdb3ad1d8c63ff1d1fa0c5eb6bf2e2ae42..bb47170917ed8918a9781b71ae60fd74e2d1c586 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -936,6 +936,11 @@ public class LevelChunk extends ChunkAccess { +@@ -932,6 +932,11 @@ public class LevelChunk extends ChunkAccess { public void setLoaded(boolean loadedToWorld) { this.loaded = loadedToWorld; diff --git a/patches/server/0077-No-block-update-command.patch b/patches/server/0077-No-block-update-command.patch index bdbbcd9f..648a38d3 100644 --- a/patches/server/0077-No-block-update-command.patch +++ b/patches/server/0077-No-block-update-command.patch @@ -30,10 +30,10 @@ index 4697df75fdee2023c41260bed211e3e3d90d2b9b..8c9bc54a7007b0c5ae1c8576aeca5d05 world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point 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 6f005cc4b90d2610c8a2ce246f29156132e68267..00989bd8ba9953353a213d57c5ff81f7d2f07773 100644 +index bb47170917ed8918a9781b71ae60fd74e2d1c586..7add47837626b7cbc170b1e0b1d0e445e7b51fa5 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -485,7 +485,7 @@ public class LevelChunk extends ChunkAccess { +@@ -481,7 +481,7 @@ public class LevelChunk extends ChunkAccess { } else { // CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled. if (!this.level.isClientSide && doPlace && (!this.level.captureBlockStates || block instanceof net.minecraft.world.level.block.BaseEntityBlock)) { diff --git a/patches/server/0085-Optimize-world-generation-chunk-and-block-access.patch b/patches/server/0085-Optimize-world-generation-chunk-and-block-access.patch index 42b6fc87..c1ce2e14 100644 --- a/patches/server/0085-Optimize-world-generation-chunk-and-block-access.patch +++ b/patches/server/0085-Optimize-world-generation-chunk-and-block-access.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize world generation chunk and block access This patch is Powered by Gale(https://github.com/GaleMC/Gale) diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 877498729c66de9aa6a27c9148f7494d7895615c..28386146cada17442d3b3f1517512b95ddcc6a9f 100644 +index 50ed7cfe1ecef6d075ba484804827cec83ba2bf2..933569818700d19ed1e18b6550584aa3f432dd31 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -83,6 +83,10 @@ public class WorldGenRegion implements WorldGenLevel { @@ -31,8 +31,8 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..28386146cada17442d3b3f1517512b95 + // Leaves end - optimize world generation chunk and block access } - public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) { -@@ -122,8 +131,29 @@ public class WorldGenRegion implements WorldGenLevel { + // Paper start - starlight +@@ -143,8 +152,29 @@ public class WorldGenRegion implements WorldGenLevel { @Override public ChunkAccess getChunk(int chunkX, int chunkZ) { @@ -63,7 +63,7 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..28386146cada17442d3b3f1517512b95 @Nullable @Override -@@ -182,7 +212,21 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -203,7 +233,21 @@ public class WorldGenRegion implements WorldGenLevel { @Override public BlockState getBlockState(BlockPos pos) { diff --git a/patches/server/0109-Force-peaceful-mode-switch.patch b/patches/server/0109-Force-peaceful-mode-switch.patch index eaa6978c..0759683d 100644 --- a/patches/server/0109-Force-peaceful-mode-switch.patch +++ b/patches/server/0109-Force-peaceful-mode-switch.patch @@ -100,10 +100,10 @@ index 7eec9dc8237ff04c53b573c3cc87e6cdbfdda7ed..2aafb872578d266f2826e5bddebc9b4a boolean spawnThisTick = true; int limit = enumcreaturetype.getMaxInstancesPerChunk(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 0e670de77a7f9926e295e1dd63d909bed1a959ca..ad07b41b8b2a595464e8dfe65de8dadca15cc6db 100644 +index 4879b585df9a6488922511a8e6603964bd13abcf..9dcb7677b995f4a11e674a46958a43a7abe6559f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2299,6 +2299,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2308,6 +2308,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { return CraftFeatureFlag.getFromNMS(this.getHandle().enabledFeatures()).stream().map(FeatureFlag.class::cast).collect(Collectors.toUnmodifiableSet()); } diff --git a/patches/server/0121-Servux-Protocol.patch b/patches/server/0121-Servux-Protocol.patch index d7875b19..b7e4d450 100644 --- a/patches/server/0121-Servux-Protocol.patch +++ b/patches/server/0121-Servux-Protocol.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Servux Protocol 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 00989bd8ba9953353a213d57c5ff81f7d2f07773..914fb5deb5dbdab1cd8899810e08205270d78df2 100644 +index 7add47837626b7cbc170b1e0b1d0e445e7b51fa5..6ecd3feb095385afcd69f80392e6282530b3931d 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -939,6 +939,7 @@ public class LevelChunk extends ChunkAccess { +@@ -935,6 +935,7 @@ public class LevelChunk extends ChunkAccess { // Leaves start - bbor if (loaded) { top.leavesmc.leaves.protocol.BBORProtocol.onChunkLoaded(this);