Fixed pipes not connecting
This commit is contained in:
parent
7022b78945
commit
97064eab72
|
@ -17,7 +17,7 @@ public class MultipartMechanical implements IPartFactory
|
|||
public MultipartMechanical()
|
||||
{
|
||||
MultiPartRegistry.registerParts(this, PART_TYPES);
|
||||
MultipartGenerator.registerPassThroughInterface("resonantinduction.api.fluid.IFluidPipe");
|
||||
MultipartGenerator.registerPassThroughInterface("resonantinduction.api.mechanical.fluid.IFluidPipe");
|
||||
MultipartGenerator.registerTrait("resonantinduction.api.mechanical.IMechanical", "resonantinduction.mechanical.trait.TraitMechanical");
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import resonantinduction.core.ResonantInduction;
|
|||
import resonantinduction.core.prefab.fluid.PipeNetwork;
|
||||
import resonantinduction.core.prefab.part.PartFramedConnection;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import universalelectricity.api.energy.IConductor;
|
||||
import calclavia.lib.utility.WrenchUtility;
|
||||
import codechicken.lib.render.CCRenderState;
|
||||
import codechicken.lib.render.IconTransformation;
|
||||
|
@ -56,10 +57,13 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
@Override
|
||||
public void update()
|
||||
{
|
||||
super.update();
|
||||
|
||||
if (!world().isRemote)
|
||||
{
|
||||
if (isExtracting && getNetwork().getTank().getFluidAmount() < getNetwork().getTank().getCapacity())
|
||||
{
|
||||
|
||||
for (int i = 0; i < this.getConnections().length; i++)
|
||||
{
|
||||
Object obj = this.getConnections()[i];
|
||||
|
@ -77,6 +81,8 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
@Override
|
||||
public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item)
|
||||
{
|
||||
if (!world().isRemote)
|
||||
System.out.println(getNetwork());
|
||||
if (WrenchUtility.isUsableWrench(player, player.getCurrentEquippedItem(), x(), y(), z()))
|
||||
{
|
||||
if (!world().isRemote)
|
||||
|
@ -182,7 +188,10 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
@Override
|
||||
protected IFluidPipe getConnector(TileEntity tile)
|
||||
{
|
||||
return tile instanceof IFluidPipe ? (IFluidPipe) tile : null;
|
||||
if (tile instanceof IFluidPipe)
|
||||
return (IFluidPipe) ((IFluidPipe) tile).getInstance(ForgeDirection.UNKNOWN);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,7 @@ public class PipeNetwork extends FluidNetwork
|
|||
{
|
||||
stack.amount -= handler.fill(dir, FluidUtility.getStack(stack, Math.min(volPerSide, this.maxFlowRate)), true);
|
||||
}
|
||||
|
||||
|
||||
if (sideCount > 1)
|
||||
--sideCount;
|
||||
if (volPer <= 0)
|
||||
|
|
Loading…
Reference in a new issue