Recache OreDict Buses on RegEx changes & adjust visibility logic (#395)
This commit is contained in:
@@ -117,7 +117,7 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
|||||||
if (this.storageFilter == StorageFilter.EXTRACTABLE_ONLY) {
|
if (this.storageFilter == StorageFilter.EXTRACTABLE_ONLY) {
|
||||||
var stackList = this.internal.getAvailableItems(this.getChannel().createList());
|
var stackList = this.internal.getAvailableItems(this.getChannel().createList());
|
||||||
for (final T t : stackList) {
|
for (final T t : stackList) {
|
||||||
if (this.canExtract(t)) {
|
if (this.shouldItemBeAvailable(t)) {
|
||||||
out.add(t);
|
out.add(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,6 +198,10 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
|||||||
return this.hasReadAccess;
|
return this.hasReadAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shouldItemBeAvailable(T t) {
|
||||||
|
return this.hasReadAccess && this.passesBlackOrWhitelist(t);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean passesBlackOrWhitelist(T input) {
|
public boolean passesBlackOrWhitelist(T input) {
|
||||||
if (this.myPartitionList.isEmpty()) {
|
if (this.myPartitionList.isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -165,9 +165,7 @@ public class PartOreDicStorageBus extends PartStorageBus {
|
|||||||
this.oreExp = oreMatch;
|
this.oreExp = oreMatch;
|
||||||
|
|
||||||
this.priorityList = new OreDictPriorityList<>(OreHelper.INSTANCE.getMatchingOre(oreExp), oreExp);
|
this.priorityList = new OreDictPriorityList<>(OreHelper.INSTANCE.getMatchingOre(oreExp), oreExp);
|
||||||
if (this.handler != null) {
|
this.resetCache(true);
|
||||||
handler.setPartitionList(this.priorityList);
|
|
||||||
}
|
|
||||||
this.getHost().markForSave();
|
this.getHost().markForSave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
|||||||
return super.getInventoryByName(name);
|
return super.getInventoryByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetCache(final boolean fullReset) {
|
protected void resetCache(final boolean fullReset) {
|
||||||
if (this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost().getTile().getWorld().isRemote) {
|
if (this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost().getTile().getWorld().isRemote) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -319,7 +319,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
|||||||
return TickRateModulation.SLEEP;
|
return TickRateModulation.SLEEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetCache() {
|
protected void resetCache() {
|
||||||
final boolean fullReset = this.resetCacheLogic == 2;
|
final boolean fullReset = this.resetCacheLogic == 2;
|
||||||
this.resetCacheLogic = 0;
|
this.resetCacheLogic = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user