use of com.minecolonies.api.colony.GraveData in project minecolonies by Minecolonies.
the class TileEntityGrave method load.
@Override
public void load(final BlockState state, final CompoundNBT compound) {
super.load(state, compound);
inventory = createInventory(DEFAULT_SIZE);
final ListNBT inventoryTagList = compound.getList(TAG_INVENTORY, TAG_COMPOUND);
for (int i = 0; i < inventoryTagList.size(); i++) {
final CompoundNBT inventoryCompound = inventoryTagList.getCompound(i);
if (!inventoryCompound.contains(TAG_EMPTY)) {
final ItemStack stack = ItemStack.of(inventoryCompound);
inventory.setStackInSlot(i, stack);
}
}
decay_timer = compound.contains(TAG_DECAY_TIMER) ? compound.getInt(TAG_DECAY_TIMER) : DEFAULT_DECAY_TIMER;
decayed = compound.contains(TAG_DECAYED) ? compound.getBoolean(TAG_DECAYED) : false;
if (compound.getAllKeys().contains(TAG_GRAVE_DATA)) {
graveData = new GraveData();
graveData.read(compound.getCompound(TAG_GRAVE_DATA));
} else
graveData = null;
}
Aggregations