Actually register the capabilities to the items and feed the transfer rate

This commit is contained in:
Mrbysco 2024-08-11 20:32:27 +02:00
parent ca68c2703a
commit 902b27914d

View file

@ -244,7 +244,8 @@ public final class ActuallyItems {
for (DeferredHolder<Item, ? extends Item> holder : ITEMS.getEntries()) { for (DeferredHolder<Item, ? extends Item> holder : ITEMS.getEntries()) {
if (holder.get() instanceof ItemEnergy energyItem) { if (holder.get() instanceof ItemEnergy energyItem) {
event.registerItem(Capabilities.EnergyStorage.ITEM, (stack, context) -> event.registerItem(Capabilities.EnergyStorage.ITEM, (stack, context) ->
new ComponentEnergyStorage(stack, ActuallyComponents.ENERGY_STORAGE.get(), energyItem.maxPower) new ComponentEnergyStorage(stack, ActuallyComponents.ENERGY_STORAGE.get(), energyItem.maxPower, energyItem.transfer),
energyItem
); );
} }
} }