man this tutorial level is really screwed up
todo??: - fix the id system [days since the universe was created is NOT a valid id] - fix literally everything else although thats probably caused by the discrepancy above
This commit is contained in:
@@ -142,7 +142,15 @@ void ChestTileEntity::load(CompoundTag *base)
|
||||
{
|
||||
CompoundTag *tag = inventoryList->get(i);
|
||||
unsigned int slot = tag->getByte(L"Slot") & 0xff;
|
||||
if (slot >= 0 && slot < items->length) (*items)[slot] = ItemInstance::fromTag(tag);
|
||||
if (slot < items->length)
|
||||
{
|
||||
shared_ptr<ItemInstance> loadedItem = ItemInstance::fromTag(tag);
|
||||
if (loadedItem == nullptr)
|
||||
{
|
||||
app.DebugPrintf("[ChestTileEntity] Missing chest item at %d,%d,%d slot=%u id=%d count=%d damage=%d\n", x, y, z, slot, tag->getShort(L"id"), tag->getByte(L"Count"), tag->getShort(L"Damage"));
|
||||
}
|
||||
(*items)[slot] = loadedItem;
|
||||
}
|
||||
}
|
||||
isBonusChest = base->getBoolean(L"bonus");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user