Skip to content

Commit

Permalink
Move clear behind server check
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers committed Oct 27, 2024
1 parent 9139646 commit 56db770
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,20 @@ protected ExportOnlyAEStockingItemList getAEItemHandler() {
@Override
public void update() {
super.update();
if (!getWorld().isRemote && isWorkingEnabled() && autoPull && getOffsetTimer() % 100 == 0) {
refreshList();
syncME();
}
if (!getWorld().isRemote) {
if (isWorkingEnabled() && autoPull && getOffsetTimer() % 100 == 0) {
refreshList();
syncME();
}

// Immediately clear cached items if the status changed, to prevent running recipes while offline
if (this.meStatusChanged && !this.isOnline) {
if (autoPull) {
clearInventory(0);
} else {
for (int i = 0; i < CONFIG_SIZE; i++) {
getAEItemHandler().getInventory()[i].setStack(null);
// Immediately clear cached items if the status changed, to prevent running recipes while offline
if (this.meStatusChanged && !this.isOnline) {
if (autoPull) {
clearInventory(0);
} else {
for (int i = 0; i < CONFIG_SIZE; i++) {
getAEItemHandler().getInventory()[i].setStack(null);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,21 @@ protected ExportOnlyAEStockingFluidList getAEFluidHandler() {
@Override
public void update() {
super.update();
if (!getWorld().isRemote && isWorkingEnabled() && autoPull && getOffsetTimer() % 100 == 0) {
refreshList();
syncME();
}
if (!getWorld().isRemote) {
if (isWorkingEnabled() && autoPull && getOffsetTimer() % 100 == 0) {
refreshList();
syncME();
}

// Immediately clear cached fluids if the status changed, to prevent running recipes while offline
if (this.meStatusChanged && !this.isOnline) {
if (autoPull) {
this.getAEFluidHandler().clearConfig();
} else {
for (int i = 0; i < CONFIG_SIZE; i++) {
getAEFluidHandler().getInventory()[i].setStack(null);
// Immediately clear cached fluids if the status changed, to prevent running recipes while offline
if (this.meStatusChanged && !this.isOnline) {
if (autoPull) {
this.getAEFluidHandler().clearConfig();
} else {
for (int i = 0; i < CONFIG_SIZE; i++) {
getAEFluidHandler().getInventory()[i].setStack(null);
}
}

}
}
}
Expand Down

0 comments on commit 56db770

Please sign in to comment.