blob: 48cf330bdb98608b3de6218fdd9eb6fe2f1babb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package gregtech.api.graphs.consumers;
import java.util.ArrayList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import gregtech.api.graphs.paths.PowerNodePath;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
// this is here to apply voltage to dead ends
public class EmptyPowerConsumer extends ConsumerNode {
public EmptyPowerConsumer(int aNodeValue, TileEntity aTileEntity, ForgeDirection side,
ArrayList<ConsumerNode> aConsumers) {
super(aNodeValue, aTileEntity, side, aConsumers);
}
@Override
public boolean needsEnergy() {
return false;
}
@Override
public int injectEnergy(long aVoltage, long aMaxAmps) {
BaseMetaPipeEntity tPipe = (BaseMetaPipeEntity) mTileEntity;
PowerNodePath tPath = (PowerNodePath) tPipe.getNodePath();
tPath.applyVoltage(aVoltage, true);
return 0;
}
}
|