Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ public void write(CompoundTag compound, HolderLookup.Provider registries, boolea
public void writeSafe(CompoundTag compound, HolderLookup.Provider registries) {
if (isController()) {
compound.putBoolean("Window", window);
compound.putInt("Size", width);
compound.putInt("Height", height);
compound.putInt("Size", 1);
compound.putInt("Height", 1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.simibubi.create.AllBlockEntityTypes;
import com.simibubi.create.api.connectivity.ConnectivityHandler;
import com.simibubi.create.api.packager.InventoryIdentifier;
import com.simibubi.create.api.schematic.nbt.PartialSafeNBT;
import com.simibubi.create.foundation.ICapabilityProvider;
import com.simibubi.create.foundation.blockEntity.IMultiBlockEntityContainer;
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
Expand Down Expand Up @@ -39,7 +40,7 @@
import net.neoforged.neoforge.items.IItemHandlerModifiable;
import net.neoforged.neoforge.items.ItemStackHandler;

public class ItemVaultBlockEntity extends SmartBlockEntity implements IMultiBlockEntityContainer.Inventory, Clearable {
public class ItemVaultBlockEntity extends SmartBlockEntity implements IMultiBlockEntityContainer.Inventory, Clearable, PartialSafeNBT {
protected ICapabilityProvider<IItemHandler> itemCapability = null;
protected InventoryIdentifier invId;

Expand Down Expand Up @@ -315,6 +316,14 @@ protected void write(CompoundTag compound, HolderLookup.Provider registries, boo
}
}

@Override
public void writeSafe(CompoundTag compound, HolderLookup.Provider registries) {
if (isController()) {
compound.putInt("Size", 1);
compound.putInt("Length", 1);
}
}

@Override
public void clearContent() {
((ItemStackHandlerAccessor) inventory).create$getStacks().clear();
Expand Down
Loading