9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-21 15:59:33 +00:00

Update Paper

This commit is contained in:
violetc
2024-01-19 11:09:19 +08:00
parent 25f3bfe8c6
commit bb617373a6
51 changed files with 303 additions and 312 deletions

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Move ThreadUnsafeRandom Initialization
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 90626c175b8bb496e2e1c18cc8a501d8eff44a87..eaad1404e690f1fe47a49df1447e31f068fcb0a2 100644
index 9be0aa933b2a1d5d2962871102ffa576df56245b..8846eb5b21924b00a870dfdd57fc9afe9988a263 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -971,7 +971,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -970,7 +970,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// Paper start - optimise random block ticking
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
@@ -19,7 +19,7 @@ index 90626c175b8bb496e2e1c18cc8a501d8eff44a87..eaad1404e690f1fe47a49df1447e31f0
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 2f1e70a695b222dfa832b5d2c81544bc314b1aec..987c5d9c54d4fe101659c42a1113ecd5ab164a6c 100644
index e7c8d223fb6d82b017031d58a17050081e70ff3b..b8c9684247fcb4af3a42dfae59a3e68a320fd4b4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -202,6 +202,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -28,9 +28,9 @@ index 2f1e70a695b222dfa832b5d2c81544bc314b1aec..987c5d9c54d4fe101659c42a1113ecd5
+ protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); // Leaves - move thread unsafe random initialization
+
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, 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<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, 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<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -294,6 +296,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end - optimise collisions
}