Disable extracting invisible items from Storage Buses altogether

Reverts d82cdabc6d, closes #408
Allows Cells to report/extract lingering unpartitioned items
This commit is contained in:
NotMyWing
2024-05-27 20:41:15 +11:00
parent c814fe591d
commit 7fa7b726f2
3 changed files with 23 additions and 8 deletions
@@ -218,11 +218,7 @@ public class ContainerCraftConfirm extends AEBaseContainer {
IAEItemStack m = null;
if (c != null && this.result.isSimulation()) {
m = o.copy();
if (items.getStorageList().findPrecise(o) != null) {
o = items.extractItems(o, Actionable.SIMULATE, this.getActionSource());
} else {
o = null;
}
if (o == null) {
o = m.copy();
@@ -134,4 +134,14 @@ public class BasicCellInventoryHandler<T extends IAEStack<T>> extends MEInventor
NBTTagCompound openNbtData() {
return Platform.openNbtData(this.getCellInv().getItemStack());
}
@Override
protected boolean canExtract(T request) {
return this.hasReadAccess();
}
@Override
protected boolean shouldItemBeAvailable(T request) {
return this.hasReadAccess();
}
}
@@ -43,6 +43,15 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
private IPartitionList<T> myPartitionList;
private AccessRestriction cachedAccessRestriction;
protected final boolean hasReadAccess() {
return hasReadAccess;
}
protected final boolean hasWriteAccess() {
return hasWriteAccess;
}
private boolean hasReadAccess;
private boolean hasWriteAccess;
private boolean isSticky;
@@ -195,11 +204,11 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
}
protected boolean canExtract(T request) {
return this.hasReadAccess;
return this.hasReadAccess && this.passesBlackOrWhitelist(request);
}
private boolean shouldItemBeAvailable(T t) {
return this.hasReadAccess && this.passesBlackOrWhitelist(t);
protected boolean shouldItemBeAvailable(T request) {
return this.hasReadAccess && this.passesBlackOrWhitelist(request);
}
public boolean passesBlackOrWhitelist(T input) {