Skip to content

Commit

Permalink
修复集电器周期问题,修复电网停摆后不执行电网刻逻辑的问题
Browse files Browse the repository at this point in the history
- fixed #1381
  • Loading branch information
Gu-ZT committed Dec 20, 2024
1 parent ff4bf67 commit 570ae28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/main/java/dev/dubhe/anvilcraft/api/power/PowerGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 570ae28

Please sign in to comment.