package com.thebrokenrail.energonrelics.block.entity; import com.thebrokenrail.energonrelics.api.block.entity.core.EnergyReceiverBlockEntity; import com.thebrokenrail.energonrelics.api.energy.Action; import com.thebrokenrail.energonrelics.block.SwitchBlock; import net.minecraft.block.entity.BlockEntityType; public class SwitchBlockEntity extends EnergyReceiverBlockEntity { public SwitchBlockEntity(BlockEntityType type) { super(type); } @Override protected void energyTick() { } @Override public boolean isEnergyProvider() { return true; } @Override protected void handlePropagatedAction(Action.PropagatedAction action) { super.handlePropagatedAction(action); // Propagate Action To Energy Providers if (isActive() && !hasSent(action)) { propagateAction(action); } else { action.pay(0); } } private boolean isActive() { return getCachedState().get(SwitchBlock.POWERED); } }