Skip to content

Commit

Permalink
Just subclass the filter for the cell dock
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Nov 16, 2024
1 parent 9195a78 commit 2c32ea2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/java/gripe/_90/megacells/item/part/CellDockPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ public class CellDockPart extends AEBasePart
@PartModels
private static final IPartModel MODEL = new PartModel(MEGACells.makeId("part/cell_dock"));

private static final IAEItemFilter FILTER = new IAEItemFilter() {
@Override
public boolean allowInsert(InternalInventory inv, int slot, ItemStack stack) {
return StorageCells.isCellHandled(stack);
}
};

private final AppEngCellInventory cellInventory = new AppEngCellInventory(this, 1);
private DriveWatcher cellWatcher;
private boolean isCached = false;
Expand All @@ -88,7 +81,7 @@ public CellDockPart(IPartItem<?> partItem) {
.setIdlePowerUsage(0.5)
.setFlags(GridFlags.REQUIRE_CHANNEL)
.addService(IStorageProvider.class, this);
cellInventory.setFilter(FILTER);
cellInventory.setFilter(new Filter());
}

@Override
Expand Down Expand Up @@ -377,4 +370,11 @@ public void renderDynamic(

poseStack.popPose();
}

private static class Filter implements IAEItemFilter {
@Override
public boolean allowInsert(InternalInventory inv, int slot, ItemStack stack) {
return StorageCells.isCellHandled(stack);
}
}
}

0 comments on commit 2c32ea2

Please sign in to comment.