From 570ae2870cbcc282421d16027e7e548538e082e8 Mon Sep 17 00:00:00 2001 From: Gugle Date: Fri, 20 Dec 2024 16:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9B=86=E7=94=B5=E5=99=A8?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=94=B5=E7=BD=91=E5=81=9C=E6=91=86=E5=90=8E=E4=B8=8D=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E7=94=B5=E7=BD=91=E5=88=BB=E9=80=BB=E8=BE=91=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fixed #1381 --- .../java/dev/dubhe/anvilcraft/api/power/PowerGrid.java | 7 ++----- .../block/entity/ChargeCollectorBlockEntity.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java b/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java index 6c2733244..977219bb6 100644 --- a/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java +++ b/src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java @@ -121,11 +121,8 @@ protected void tick() { storages.add(storage); if (need <= 0) break; } - if (need > 0) { - this.update(false); - return; - } - for (IPowerStorage storage : storages) { + if (need > 0) this.update(false); + else for (IPowerStorage storage : storages) { this.generate += storage.extract(this.consume - this.generate); } } diff --git a/src/main/java/dev/dubhe/anvilcraft/block/entity/ChargeCollectorBlockEntity.java b/src/main/java/dev/dubhe/anvilcraft/block/entity/ChargeCollectorBlockEntity.java index 659811615..8ab4ceeae 100644 --- a/src/main/java/dev/dubhe/anvilcraft/block/entity/ChargeCollectorBlockEntity.java +++ b/src/main/java/dev/dubhe/anvilcraft/block/entity/ChargeCollectorBlockEntity.java @@ -98,7 +98,7 @@ public void saveAdditional(@NotNull CompoundTag tag, HolderLookup.@NotNull Provi @Override public void gridTick() { - if (this.cooldownCount >= 1) { + if (this.cooldownCount > 1) { this.cooldownCount -= 1; return; }