package com.thebrokenrail.energonrelics.api.block.entity.helper; import com.thebrokenrail.energonrelics.api.energy.Action; /** * Interface Of A Block That Generates Energy */ public interface EnergyGenerator { /** * Handle Propagated Action * @param action Action */ default void handlePropagatedActionWithGenerator(Action.PropagatedAction action) { long amount = Math.min(getEnergy(), action.amountOwed()); setEnergy(getEnergy() - amount); action.pay(amount); } /** * Get Current Energy level * @return Energy Level */ long getEnergy(); /** * Set New Energy Level * @param value New Energy Level */ void setEnergy(long value); /** * Get Energy To Be Displayed On Multimeter * @return Energy Level */ long getDisplayEnergy(); }