Split into internal and external inventories.

Fixes Charger not being able to load inventories that violated the filter.
This commit is contained in:
Sebastian Hartte
2020-08-24 00:01:05 +02:00
parent 7df5bf4076
commit d28f33d198
2 changed files with 17 additions and 3 deletions
@@ -59,6 +59,13 @@ public abstract class AEBaseInvBlockEntity extends AEBaseBlockEntity implements
public abstract @Nonnull FixedItemInv getInternalInventory();
/**
* Inventory offered to other mods accessing this block externally.
*/
public @Nonnull FixedItemInv getExternalInventory() {
return getInternalInventory();
}
@Override
public CompoundTag toTag(final CompoundTag data) {
super.toTag(data);
@@ -95,7 +102,7 @@ public abstract class AEBaseInvBlockEntity extends AEBaseBlockEntity implements
ItemStack added);
protected @Nonnull FixedItemInv getItemHandlerForSide(@Nonnull Direction side) {
return this.getInternalInventory();
return this.getExternalInventory();
}
@Override
@@ -107,7 +114,7 @@ public abstract class AEBaseInvBlockEntity extends AEBaseBlockEntity implements
private void offerItemInventory(AttributeList<?> to) {
Direction searchDirection = to.getSearchDirection();
if (searchDirection == null) {
to.offer(getInternalInventory());
to.offer(getExternalInventory());
} else {
Direction side = searchDirection.getOpposite();
to.offer(getItemHandlerForSide(side));