mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-22 13:10:13 +00:00
#1397 Completed refactor splitting machines into no powered, power receivers, power generators and power handlers (power in and out)
This commit is contained in:
1 parent
10c928591e
commit
d4b5fd5a61
56 files changed
+458
-405
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public abstract class AbstractPowerConsumerEntity extends AbstractPoweredMachineEntity implements IInternalPowerReceiver {
|
||||
|
||||
public AbstractPowerConsumerEntity(SlotDefinition slotDefinition) {
|
||||
super(slotDefinition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
if(isSideDisabled(from.ordinal())) {
|
||||
return 0;
|
||||
}
|
||||
return PowerHandlerUtil.recieveInternal(this, maxReceive, from, simulate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return getMaxEnergyStored();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user