fix InvWrapper Lens not adjusting to changing Inventory size
fixes
protected SlotCollection slots;
protected List<Inventory> children = new ArrayList<Inventory>();
@Nullable protected Iterable<Slot> slotIterator;
- private Fabric fabric;
+ private Fabric fabric = new IItemHandlerFabric(((InvWrapper) (Object) this));
+
@Nullable protected Lens lens = null;
private List<SlotTransaction> capturedTransactions = new ArrayList<>();
- private boolean initalized = false;
+ private int initializedSize;
private void init() {
- if (!this.initalized) {
- this.initalized = true;
- this.fabric = new IItemHandlerFabric(((InvWrapper) (Object) this));
+ if (this.initializedSize != this.fabric.getSize()) {
+ this.initializedSize = this.fabric.getSize();
this.slots = new SlotCollection.Builder().add(this.fabric.getSize()).build();
this.lens = new OrderedInventoryLensImpl(0, this.fabric.getSize(), 1, this.slots);
}
