Skip to content

Commit

Permalink
Disable extracting invisible items from Storage Buses altogether
Browse files Browse the repository at this point in the history
Reverts d82cdab, closes #408
Allows Cells to report/extract lingering unpartitioned items
  • Loading branch information
NotMyWing committed May 27, 2024
1 parent c814fe5 commit 7fa7b72
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ public void detectAndSendChanges() {
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;
}
o = items.extractItems(o, Actionable.SIMULATE, this.getActionSource());

if (o == null) {
o = m.copy();
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/appeng/me/storage/BasicCellInventoryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,14 @@ public IncludeExclude getIncludeExcludeMode() {
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();
}
}
15 changes: 12 additions & 3 deletions src/main/java/appeng/me/storage/MEInventoryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -195,11 +204,11 @@ public void setSticky(boolean isSticky) {
}

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) {
Expand Down

0 comments on commit 7fa7b72

Please sign in to comment.