Skip to content

Commit

Permalink
fix: Fix warp plate contents not saving
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Jun 12, 2024
1 parent 2b592ac commit e643ecd
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ public boolean canExtractItem(int i) {
}
}

protected final Container container = new WaystoneContainer(5);

private final NonNullList<ItemStack> items = NonNullList.withSize(5, ItemStack.EMPTY);
protected final DefaultContainer container = new WaystoneContainer(5);

private boolean readyForAttunement;
protected boolean completedFirstAttunement;
Expand All @@ -100,7 +98,7 @@ public WaystoneBlockEntityBase(BlockEntityType<?> blockEntityType, BlockPos bloc

@Override
protected void saveAdditional(CompoundTag tag, HolderLookup.Provider provider) {
ContainerHelper.saveAllItems(tag, items, provider);
tag.put("Items", container.serialize(provider));

if (waystone.isValid()) {
tag.put("UUID", NbtUtils.createUUID(waystone.getWaystoneUid()));
Expand All @@ -114,7 +112,7 @@ protected void saveAdditional(CompoundTag tag, HolderLookup.Provider provider) {

@Override
public void loadAdditional(CompoundTag compound, HolderLookup.Provider provider) {
ContainerHelper.loadAllItems(compound, items, provider);
container.deserialize(compound.getCompound("Items"), provider);

if (compound.contains("UUID", Tag.TAG_INT_ARRAY)) {
waystoneUid = NbtUtils.loadUUID(Objects.requireNonNull(compound.get("UUID")));
Expand Down

0 comments on commit e643ecd

Please sign in to comment.