Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 8193954

Browse files
committed
ffs left an energy container instead of laser
1 parent 25b21d9 commit 8193954

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/main/java/net/htmlcsjs/htmlTech/common/laserpipe/net/LaserRoutePath.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.htmlcsjs.htmlTech.common.laserpipe.net;
22

3-
import gregtech.api.capability.GregtechCapabilities;
4-
import gregtech.api.capability.IEnergyContainer;
3+
import net.htmlcsjs.htmlTech.api.capability.HtmlTechCapabilities;
4+
import net.htmlcsjs.htmlTech.api.capability.ILaserContainer;
55
import net.htmlcsjs.htmlTech.common.laserpipe.tile.TileEntityLaserPipe;
66
import net.minecraft.tileentity.TileEntity;
77
import net.minecraft.util.EnumFacing;
@@ -43,10 +43,10 @@ public BlockPos getHandlerPos() {
4343
return destPipePos.offset(destFacing);
4444
}
4545

46-
public IEnergyContainer getHandler(World world) {
46+
public ILaserContainer getHandler(World world) {
4747
TileEntity tile = world.getTileEntity(getHandlerPos());
4848
if(tile != null) {
49-
return tile.getCapability(GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, destFacing.getOpposite());
49+
return tile.getCapability(HtmlTechCapabilities.LASER_CONTAINER, destFacing.getOpposite());
5050
}
5151
return null;
5252
}

src/main/java/net/htmlcsjs/htmlTech/common/laserpipe/net/PipeLaserContainer.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package net.htmlcsjs.htmlTech.common.laserpipe.net;
22

3-
import gregtech.api.capability.IEnergyContainer;
43
import gregtech.api.util.GTUtility;
54
import net.htmlcsjs.htmlTech.HtmlTech;
65
import net.htmlcsjs.htmlTech.api.capability.ILaserContainer;
@@ -44,23 +43,20 @@ public long acceptEnergyFromNetwork(EnumFacing side, long voltage, long amperage
4443

4544
long amperesUsed = 0L;
4645
List<LaserRoutePath> paths = net.getNetData(cable.getPos());
47-
outer:
4846
for (LaserRoutePath path : paths) {
4947
if (GTUtility.arePosEqual(cable.getPos(), path.getPipePos()) && side == path.getFaceToHandler()) {
5048
//Do not insert into source handler
5149
continue;
5250
}
53-
IEnergyContainer dest = path.getHandler(cable.getWorld());
51+
ILaserContainer dest = path.getHandler(cable.getWorld());
5452
EnumFacing facing = path.getFaceToHandler().getOpposite();
5553
if (dest == null || !dest.inputsEnergy(facing) || dest.getEnergyCanBeInserted() <= 0) continue;
5654
long amps = 0;
5755
if (voltage > 0) {
5856
amps = dest.acceptEnergyFromNetwork(facing, voltage, amperage - amperesUsed);
5957
}
60-
amperesUsed += amps;;
58+
amperesUsed += amps;
6159
for (TileEntityLaserPipe cable : path.getPath()) {
62-
if(voltage <= 0)
63-
break;
6460
cable.incrementAmperage(amps, voltage);
6561
}
6662

0 commit comments

Comments
 (0)