diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt index 268a80ee3..b15d52ed4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt @@ -19,6 +19,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.matter.* import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.formatMatter +import ru.dbotthepony.mc.otm.core.ifPresentK import javax.annotation.ParametersAreNonnullByDefault @ParametersAreNonnullByDefault @@ -140,11 +141,11 @@ class MatterCapacitorItem : Item { if (isCreative) { p_41423_.add(INFINITE_STORAGE) } else { - stack.getCapability(MatteryCapability.MATTER).ifPresent { cap: IMatterHandler -> + stack.getCapability(MatteryCapability.MATTER).ifPresentK { p_41423_.add( TranslatableComponent( "otm.item.matter.normal", - cap.storedMatter.formatMatter(), + it.storedMatter.formatMatter(), capacity.formatMatter() ).withStyle(ChatFormatting.GRAY) )