Search in sources :

Example 1 with UserInventory

use of org.spongepowered.api.item.inventory.entity.UserInventory in project SpongeCommon by SpongePowered.

the class SpongeUserData method loadInventory.

private UserInventory loadInventory() {
    if (this.inventory == null) {
        this.inventory = new SpongeUserInventory(this);
        final ListTag listNBT = this.compound.getList(Constants.Entity.Player.INVENTORY, 10);
        this.inventory.readList(listNBT);
        this.inventory.currentItem = this.compound.getInt(Constants.Entity.Player.SELECTED_ITEM_SLOT);
    }
    return (UserInventory) this.inventory;
}
Also used : ListTag(net.minecraft.nbt.ListTag) UserInventory(org.spongepowered.api.item.inventory.entity.UserInventory)

Aggregations

ListTag (net.minecraft.nbt.ListTag)1 UserInventory (org.spongepowered.api.item.inventory.entity.UserInventory)1