use of org.spongepowered.common.inventory.adapter.InventoryAdapter in project SpongeCommon by SpongePowered.
the class InventoryMixin_Inventory_API method armor.
@Override
public EquipmentInventory armor() {
if (this.api$armor == null && ((InventoryAdapter) this).inventoryAdapter$getRootLens() instanceof PlayerInventoryLens) {
final Lens lens = ((InventoryAdapter) this).inventoryAdapter$getRootLens();
final Fabric fabric = ((InventoryAdapter) this).inventoryAdapter$getFabric();
this.api$armor = (EquipmentInventoryAdapter) ((PlayerInventoryLens) lens).getArmorLens().getAdapter(fabric, this);
}
return this.api$armor;
}
use of org.spongepowered.common.inventory.adapter.InventoryAdapter in project SpongeCommon by SpongePowered.
the class InventoryMixin_Inventory_API method primary.
@Override
public PrimaryPlayerInventory primary() {
if (this.api$primary == null && ((InventoryAdapter) this).inventoryAdapter$getRootLens() instanceof PlayerInventoryLens) {
final Lens lens = ((InventoryAdapter) this).inventoryAdapter$getRootLens();
final Fabric fabric = ((InventoryAdapter) this).inventoryAdapter$getFabric();
this.api$primary = (PrimaryPlayerInventoryAdapter) ((PlayerInventoryLens) lens).getPrimaryInventoryLens().getAdapter(fabric, this);
}
return this.api$primary;
}
Aggregations