Split into internal and external inventories.
Fixes Charger not being able to load inventories that violated the filter.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -56,6 +56,7 @@ import appeng.util.Platform;
|
||||
import appeng.util.inv.InvOperation;
|
||||
import appeng.util.inv.filter.IAEItemFilter;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ChargerBlockEntity extends AENetworkPowerBlockEntity implements ICrankable, IGridTickable {
|
||||
private static final int POWER_MAXIMUM_AMOUNT = 1600;
|
||||
@@ -137,6 +138,12 @@ public class ChargerBlockEntity extends AENetworkPowerBlockEntity implements ICr
|
||||
|
||||
@Override
|
||||
public FixedItemInv getInternalInventory() {
|
||||
return inv;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FixedItemInv getExternalInventory() {
|
||||
return externalInv;
|
||||
}
|
||||
|
||||
@@ -255,7 +262,7 @@ public class ChargerBlockEntity extends AENetworkPowerBlockEntity implements ICr
|
||||
return true;
|
||||
}
|
||||
|
||||
private class ChargerInvFilter implements IAEItemFilter {
|
||||
private static class ChargerInvFilter implements IAEItemFilter {
|
||||
@Override
|
||||
public boolean allowInsert(FixedItemInv inv, final int i, final ItemStack itemstack) {
|
||||
final IItemDefinition cert = Api.instance().definitions().materials().certusQuartzCrystal();
|
||||
|
||||
Reference in New Issue
Block a user