use of org.spongepowered.common.inventory.adapter.impl.comp.PrimaryPlayerInventoryAdapter 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