mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-30 12:29:13 +00:00
fix random tick
This commit is contained in:
@@ -17,7 +17,7 @@ index 2f927b422c2c4f2f65d822befe3cbfd9e3bb3708..d0fcfeaf093b718c8acd6e057176d569
|
||||
if (flagAndHasNaturalSpawn) { // Gale - MultiPaper - skip unnecessary mob spawning computations
|
||||
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index eb849c57992658005e0f514c6f7923f8ca43bebf..2efcdb9bc91b9106b4aef9e24cc20596be4a5661 100644
|
||||
index eb849c57992658005e0f514c6f7923f8ca43bebf..0bf765334f20fa5a999400076797d5b1f82c7469 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1128,6 +1128,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -33,13 +33,13 @@ index eb849c57992658005e0f514c6f7923f8ca43bebf..2efcdb9bc91b9106b4aef9e24cc20596
|
||||
|
||||
if (randomTickSpeed > 0) {
|
||||
- this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking
|
||||
+ if (org.dreeam.leaf.config.modules.opt.OptimizeRandomTick.enabled) randomTickSystem.randomTickChunk(chunk, randomTickSpeed); // Leaf - random tick
|
||||
+ if (org.dreeam.leaf.config.modules.opt.OptimizeRandomTick.enabled) randomTickSystem.randomTickChunk(this.simpleRandom, chunk, randomTickSpeed); // Leaf - random tick
|
||||
+ else this.optimiseRandomTick(chunk, randomTickSpeed); // Paper - optimise random ticking // Leaf - random tick
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 624a177695580510c0a49d4503dee72da7fd7114..affe9fff1ff2f7e221f8cfe345d40d707e0f3dbc 100644
|
||||
index 624a177695580510c0a49d4503dee72da7fd7114..f85d46c23824de177fe0c08b2ce6fbbb81c3535b 100644
|
||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -151,6 +151,52 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -48,8 +48,8 @@ index 624a177695580510c0a49d4503dee72da7fd7114..affe9fff1ff2f7e221f8cfe345d40d70
|
||||
|
||||
+ // Leaf start - random tick
|
||||
+ private long leaf$randomTickChance;
|
||||
+ private long leaf$countTickingBlocks;
|
||||
+ private long leaf$countTickingSections;
|
||||
+ private int leaf$countTickingBlocks;
|
||||
+ private int leaf$countTickingSections;
|
||||
+
|
||||
+ public final long leaf$randomTickChance() {
|
||||
+ return leaf$randomTickChance;
|
||||
@@ -57,15 +57,15 @@ index 624a177695580510c0a49d4503dee72da7fd7114..affe9fff1ff2f7e221f8cfe345d40d70
|
||||
+ public final void leaf$setRandomTickChance(long chance) {
|
||||
+ leaf$randomTickChance = chance;
|
||||
+ }
|
||||
+ public final long leaf$countTickingBlocks() {
|
||||
+ public final int leaf$countTickingBlocks() {
|
||||
+ return leaf$countTickingBlocks;
|
||||
+ }
|
||||
+ public final long leaf$countTickingSections() {
|
||||
+ public final int leaf$countTickingSections() {
|
||||
+ return leaf$countTickingSections;
|
||||
+ }
|
||||
+ public final void leaf$recompute() {
|
||||
+ long total1 = 0L;
|
||||
+ long total2 = 0L;
|
||||
+ int total1 = 0;
|
||||
+ int total2 = 0;
|
||||
+ for (LevelChunkSection section : sections) {
|
||||
+ total1 += section.moonrise$getTickingBlockList().size();
|
||||
+ if (section.isRandomlyTickingBlocks()) {
|
||||
|
||||
Reference in New Issue
Block a user