Skip to content

Commit

Permalink
show button only for ICellRestriction
Browse files Browse the repository at this point in the history
  • Loading branch information
lordIcocain committed Jan 24, 2025
1 parent eb1e61c commit 7c32862
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected void handleButtonVisibility() {
}
this.fuzzyMode.setVisibility(!hasOreFilter && hasFuzzy);
this.oreFilter.setVisibility(hasOreFilter);
this.cellRestriction.setVisibility(this.workbench.haveCell());
this.cellRestriction.setVisibility(this.workbench.haveCellRestrictAble());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import appeng.container.slot.OptionalSlotRestrictedInput;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.helpers.ICellRestriction;
import appeng.tile.inventory.AppEngNullInventory;
import appeng.tile.misc.TileCellWorkbench;
import appeng.util.IterationCounter;
Expand Down Expand Up @@ -182,6 +183,10 @@ public boolean haveCell() {
return this.workBench.getCell() != null;
}

public boolean haveCellRestrictAble() {
return haveCell() && this.workBench.getCell() instanceof ICellRestriction;
}

@Override
public void onUpdate(final String field, final Object oldValue, final Object newValue) {
if (field.equals("copyMode")) {
Expand Down

0 comments on commit 7c32862

Please sign in to comment.