You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -150,7 +150,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
21
+
}
22
+
// Paper end - rewrite chunk system
23
+
// Paper start - chunk tick iteration optimisations
24
+
- private final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom shuffleRandom = new ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom(0L);
25
+
+ private final net.minecraft.world.level.levelgen.BitRandomSource shuffleRandom = org.dreeam.leaf.config.modules.opt.FastRNG.enabled ? new org.dreeam.leaf.util.math.random.FasterRandomSource(0L) : new ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom(0L); // Leaf - Faster random generator
26
+
private boolean isChunkNearPlayer(final ChunkMap chunkMap, final ChunkPos chunkPos, final LevelChunk levelChunk) {
27
+
final ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData chunkData = ((ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemChunkHolder)((ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemLevelChunk)levelChunk).moonrise$getChunkAndHolder().holder())
index b3c388f6108360708baf275121af18f46622494f..84d3df4008e56d8ceba2b422f42c34295c5e0a83 100644
31
+
--- a/net/minecraft/server/level/ServerLevel.java
32
+
+++ b/net/minecraft/server/level/ServerLevel.java
33
+
@@ -902,7 +902,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
34
+
private void optimiseRandomTick(final LevelChunk chunk, final int tickSpeed) {
35
+
final LevelChunkSection[] sections = chunk.getSections();
36
+
final int minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection((ServerLevel)(Object)this);
37
+
- final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = this.simpleRandom;
38
+
+ final net.minecraft.world.level.levelgen.BitRandomSource simpleRandom = this.simpleRandom; // Leaf - Faster random generator - upcasting
39
+
final boolean doubleTickFluids = !ca.spottedleaf.moonrise.common.PlatformHooks.get().configFixMC224294();
40
+
41
+
final ChunkPos cpos = chunk.getPos();
42
+
@@ -951,7 +951,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
43
+
private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.simpleRandom.nextInt(16); } // Gale - Airplane - optimize random calls in chunk ticking
44
+
45
+
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
46
+
- final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = this.simpleRandom; // Paper - optimise random ticking
47
+
+ final net.minecraft.world.level.levelgen.BitRandomSource simpleRandom = this.simpleRandom; // Paper - optimise random ticking // Leaf - Faster random generator - upcasting
index 13edbcdabc159e3694e7dbe824ccb5bb447fe788..367ba07f63917dc75883d5fd3dde93dc9ffc144a 100644
106
+
--- a/net/minecraft/world/level/Level.java
107
+
+++ b/net/minecraft/world/level/Level.java
108
+
@@ -126,7 +126,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
109
+
public float rainLevel;
110
+
protected float oThunderLevel;
111
+
public float thunderLevel;
112
+
- public final RandomSource random = new ca.spottedleaf.moonrise.common.util.ThreadUnsafeRandom(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()); // Paper - replace random
113
+
+ public final RandomSource random = org.dreeam.leaf.config.modules.opt.FastRNG.enabled ? new org.dreeam.leaf.util.math.random.FasterRandomSource(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()) : new ca.spottedleaf.moonrise.common.util.ThreadUnsafeRandom(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()); // Paper - replace random // Leaf - Faster random generator
114
+
@Deprecated
115
+
private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
116
+
private final Holder<DimensionType> dimensionTypeRegistration;
117
+
@@ -182,7 +182,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
118
+
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
119
+
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
120
+
121
+
- public final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = new ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()); // Gale - Pufferfish - move random tick random
122
+
+ public final net.minecraft.world.level.levelgen.BitRandomSource simpleRandom = org.dreeam.leaf.config.modules.opt.FastRNG.enabled ? new org.dreeam.leaf.util.math.random.FasterRandomSource(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()) : new ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()); // Gale - Pufferfish - move random tick random // Leaf - Faster random generator
123
+
124
+
// Purpur start - Add adjustable breeding cooldown to config
0 commit comments