diff --git a/src/main/java/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.java b/src/main/java/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.java index 59909bfb7..f92737692 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.java +++ b/src/main/java/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.java @@ -144,7 +144,7 @@ public class BlockEntityMatterCapacitorBank extends BlockEntityMattery implement private final LazyOptional resolver = LazyOptional.of(() -> matter); - public MatteryContainer matter_container = new MatteryContainer(this::setChanged, 6 * 2) { + public final MatteryContainer matter_container = new MatteryContainer(this::setChanged, 6 * 2) { @Override public void setChanged(int slot, ItemStack new_state, ItemStack old_state) { super.setChanged(slot, new_state, old_state); @@ -182,9 +182,7 @@ public class BlockEntityMatterCapacitorBank extends BlockEntityMattery implement @Override public void load(CompoundTag nbt) { - if (nbt.contains("matter_container") && nbt.get("matter_container") instanceof CompoundTag tag) - matter_container = MatteryContainer.of(this::setChanged, tag, matter_container.getContainerSize()); - + matter_container.deserializeNBT(nbt.get("matter_container")); super.load(nbt); }