use of org.spongepowered.common.inventory.adapter.impl.comp.EquipmentInventoryAdapter in project SpongeCommon by SpongePowered.
the class InventoryMixin_Inventory_API method equipment.
@Override
public EquipmentInventory equipment() {
if (this.api$equipment == null && ((InventoryAdapter) this).inventoryAdapter$getRootLens() instanceof PlayerInventoryLens) {
final Lens lens = ((InventoryAdapter) this).inventoryAdapter$getRootLens();
final Fabric fabric = ((InventoryAdapter) this).inventoryAdapter$getFabric();
this.api$equipment = (EquipmentInventoryAdapter) ((PlayerInventoryLens) lens).getEquipmentLens().getAdapter(fabric, this);
}
return this.api$equipment;
}
use of org.spongepowered.common.inventory.adapter.impl.comp.EquipmentInventoryAdapter 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;
}
Aggregations