Skip to content

Commit

Permalink
Fixed not being able to change the Exporter filter slot count with re…
Browse files Browse the repository at this point in the history
…gulator mode without closing and re-opening the container.
  • Loading branch information
raoulvdberge committed Nov 11, 2020
1 parent e87184d commit 8e8c1ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Fixed issue where Crafters may fail to recognize an inventory/tank for some patterns (Darkere)
- Fixed issue where the Crafter Manager can crash on invalid patterns (raoulvdberge)
- Fixed issue where alternatives in the Pattern Grid weren't being saved properly (raoulvdberge)
- Fixed not being able to change the Exporter filter slot count with regulator mode without closing and re-opening the container (raoulvdberge)

### 1.9.8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,33 @@

public class ExporterContainer extends BaseContainer {
private final ExporterTile exporter;
private boolean hasRegulatorMode;

public ExporterContainer(ExporterTile exporter, PlayerEntity player, int windowId) {
super(RSContainers.EXPORTER, exporter, player, windowId);

this.exporter = exporter;
this.hasRegulatorMode = hasRegulatorMode();

initSlots();
}

private boolean hasRegulatorMode() {
return exporter.getNode().getUpgrades().hasUpgrade(UpgradeItem.Type.REGULATOR);
}

@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();

boolean updatedHasRegulatorMode = hasRegulatorMode();
if (hasRegulatorMode != updatedHasRegulatorMode) {
hasRegulatorMode = updatedHasRegulatorMode;

initSlots();
}
}

public void initSlots() {
this.inventorySlots.clear();
this.inventoryItemStacks.clear();
Expand Down

0 comments on commit 8e8c1ab

Please sign in to comment.