From 30b877240971a7c1007974e6ac0d6e7a0e5a0f2a Mon Sep 17 00:00:00 2001 From: CPearl0 <1269596929@qq.com> Date: Sun, 4 Feb 2024 17:11:52 +0800 Subject: [PATCH 1/3] Add sieve interval --- .../exdeorum/blockentity/MechanicalSieveBlockEntity.java | 2 +- .../exdeorum/blockentity/SieveBlockEntity.java | 5 +++-- .../exdeorum/blockentity/logic/SieveLogic.java | 9 ++++++++- src/main/java/thedarkcolour/exdeorum/config/EConfig.java | 5 ++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java index 37de00f4..c19b1999 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/MechanicalSieveBlockEntity.java @@ -83,7 +83,7 @@ public class MechanicalSieveBlockEntity extends AbstractMachineBlockEntity Date: Sun, 4 Feb 2024 15:44:31 -0800 Subject: [PATCH 2/3] minor style changes --- .../exdeorum/blockentity/logic/SieveLogic.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java index 36f6c024..ac6225f6 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/logic/SieveLogic.java @@ -75,10 +75,11 @@ public class SieveLogic { // Do not call on the client side public void sift(float incrementProgress, long time) { - if (time < lastTime + minInterval) + if (time < this.lastTime + this.minInterval) { return; - lastTime = time; - + } + + this.lastTime = time; this.progress += incrementProgress * this.efficiency; // Need epsilon because floating point decimals suck From 2b3c1a0cd5ce1b4a872a67b5fb657b2059ce3317 Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Sun, 4 Feb 2024 15:47:28 -0800 Subject: [PATCH 3/3] Change config option description --- src/main/java/thedarkcolour/exdeorum/config/EConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java index e4547dd2..76fd968d 100644 --- a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java +++ b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java @@ -189,7 +189,7 @@ public class EConfig { .comment("The amount of FE/t a tick consumed by the mechanical hammer when crushing a block.") .defineInRange("mechanical_hammer_energy_consumption", 20, 0, Integer.MAX_VALUE); this.sieveIntervalTicks = builder - .comment("The minimum interval ticks between two sifting operation. Only for handy sifting. 0 means no limit.") + .comment("The minimum number of ticks a player must wait between two sifting operations. Only affects sifting by hand. 0 means no limit.") .defineInRange("sieve_interval", 1, 0, Integer.MAX_VALUE); builder.pop(); }