Skip to content

Commit

Permalink
Correct config name
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jan 17, 2024
1 parent 92078d2 commit 8db96ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions patches/server/0044-Optimize-item-updates-in-fluid-check.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ index 3cf07a2d82ec9f0d6666fb27aee9acc9d9823ead..3aa0ad4fad1b44817f484cce13642ed7
this.clearFire();
} else if (this.remainingFireTicks > 0) {
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 7fce419490b39409f876914ce306f77d11e659b7..065f63825627466ddd59bc68edfa72cd2ceef1c7 100644
index 7fce419490b39409f876914ce306f77d11e659b7..2e15896df321c076cf1c3ef78e67cea9188e9ddb 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -130,6 +130,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
Expand All @@ -43,7 +43,7 @@ index 7fce419490b39409f876914ce306f77d11e659b7..065f63825627466ddd59bc68edfa72cd
+ // Leaf start - Optimize item updates in fluid check
+ public static boolean isInLiquid = false;
+ public static void checkInLiquid(Entity e) {
+ if (e.tickCount % org.dreeam.leaf.LeafConfig.optimizeItemsInFluidUpdateTickCount == 0) {
+ if (e.tickCount % org.dreeam.leaf.LeafConfig.optimizeItemsInFluidUpdateInterval == 0) {
+ isInLiquid = e.isInLiquid();
+ }
+ }
Expand All @@ -69,15 +69,15 @@ index 7fce419490b39409f876914ce306f77d11e659b7..065f63825627466ddd59bc68edfa72cd
double d0 = this.getDeltaMovement().subtract(vec3d).lengthSqr();

diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 53bde816ca9bf8b704fb2e9794de260a9eba402f..98723f55a5557f10b75a299c586bf2caf31887f3 100644
index 53bde816ca9bf8b704fb2e9794de260a9eba402f..82e51da38a66826feb58fd28b39858ef91ddf7ab 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -202,6 +202,8 @@ public class LeafConfig {
public static int asyncPathfindingMaxThreads = 0;
public static int asyncPathfindingKeepalive = 60;
public static boolean cacheMinecartCollision = false;
+ public static boolean optimizeItemsInFluidUpdateEnabled = false;
+ public static int optimizeItemsInFluidUpdateTickCount = 20;
+ public static int optimizeItemsInFluidUpdateInterval = 20;
private static void performance() {
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
"Whether or not asynchronous mob spawning should be enabled.",
Expand All @@ -86,7 +86,7 @@ index 53bde816ca9bf8b704fb2e9794de260a9eba402f..98723f55a5557f10b75a299c586bf2ca
"Cache the minecart collision result to prevent massive stacked minecart lag the server.",
"The known issue: entity can't enter the minecart after enabling this!");
+ optimizeItemsInFluidUpdateEnabled = getBoolean("performance.optimize-items-in-fluid-update.enabled", optimizeItemsInFluidUpdateEnabled);
+ optimizeItemsInFluidUpdateTickCount = getInt("performance.optimize-items-in-fluid-update.tick-count", optimizeItemsInFluidUpdateTickCount);
+ optimizeItemsInFluidUpdateInterval = getInt("performance.optimize-items-in-fluid-update.interval", optimizeItemsInFluidUpdateInterval);
+
}

Expand Down

0 comments on commit 8db96ab

Please sign in to comment.