use of org.spongepowered.common.inventory.lens.impl.slot.BasicSlotLens in project SpongeCommon by SpongePowered.
the class SlotMixin_Lens_Inventory method lensGeneratorBridge$generateLens.
@Override
public Lens lensGeneratorBridge$generateLens(SlotLensProvider slotLensProvider) {
try {
final Lens rootLens = ((InventoryAdapter) this.container).inventoryAdapter$getRootLens();
SlotLens lens = rootLens.getSlotLens(this.inventoryAdapter$getFabric(), this.slot);
if (lens != null) {
return lens;
}
} catch (Exception ignored) {
}
// this works as a fallback but removes Inventory Property Support completely
return new BasicSlotLens(0);
}
Aggregations