Removed "constantly adding network"
This commit is contained in:
parent
cbec2db9c8
commit
16500fb538
7 changed files with 10 additions and 26 deletions
|
@ -45,7 +45,6 @@ public class TileGutter extends TileFluidNetwork implements IFluidPipe
|
|||
this.setRenderSide(side, true);
|
||||
connectedBlocks[side.ordinal()] = tileEntity;
|
||||
}
|
||||
getNetwork().markChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ public class PartMultimeter extends PartFace implements IConnector<MultimeterNet
|
|||
super.update();
|
||||
|
||||
this.ticks++;
|
||||
getNetwork().addConnector(this);
|
||||
|
||||
if (!world().isRemote)
|
||||
{
|
||||
|
|
|
@ -32,12 +32,16 @@ import universalelectricity.core.net.NetworkTickHandler;
|
|||
public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanical> implements IMechanicalNetwork, IUpdate
|
||||
{
|
||||
public static final float ACCELERATION = 0.2f;
|
||||
|
||||
/** The current rotation of the network */
|
||||
private float rotation = 0;
|
||||
|
||||
private long lastRotateTime;
|
||||
|
||||
/** The direction in which a conductor is placed relative to a specific conductor. */
|
||||
protected final HashMap<Object, EnumSet<ForgeDirection>> handlerDirectionMap = new LinkedHashMap<Object, EnumSet<ForgeDirection>>();
|
||||
/**
|
||||
* The cached connections of the mechanical network.
|
||||
*/
|
||||
private final HashMap<Object, EnumSet<ForgeDirection>> connectionMap = new LinkedHashMap<Object, EnumSet<ForgeDirection>>();
|
||||
|
||||
private boolean markUpdateRotation = true;
|
||||
|
||||
|
|
|
@ -67,8 +67,7 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
|
|||
i++;
|
||||
|
||||
System.out.println("Connected with: " + i + ":" + getNetwork());
|
||||
// efresh();
|
||||
|
||||
// refresh();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -77,9 +76,6 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
|
|||
@Override
|
||||
public void update()
|
||||
{
|
||||
// TODO: Fix gear network somehow tick while network is invalid.
|
||||
getNetwork().addConnector(this);
|
||||
|
||||
ticks++;
|
||||
angle += angularVelocity / 20;
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
sendFluidUpdate();
|
||||
markPacket = false;
|
||||
}
|
||||
|
||||
getNetwork().markChanged();
|
||||
}
|
||||
|
||||
public void sendFluidUpdate()
|
||||
|
@ -126,7 +124,6 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
if (doFill)
|
||||
{
|
||||
markPacket = true;
|
||||
getNetwork().markChanged();
|
||||
}
|
||||
|
||||
return tank.fill(resource, doFill);
|
||||
|
@ -142,7 +139,6 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
if (doDrain)
|
||||
{
|
||||
markPacket = true;
|
||||
getNetwork().markChanged();
|
||||
}
|
||||
|
||||
return tank.drain(resource.amount, doDrain);
|
||||
|
@ -158,7 +154,6 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
if (doDrain)
|
||||
{
|
||||
markPacket = true;
|
||||
getNetwork().markChanged();
|
||||
}
|
||||
|
||||
return tank.drain(maxDrain, doDrain);
|
||||
|
|
|
@ -57,6 +57,4 @@ public interface IFluidNetwork extends INodeNetwork<IFluidNetwork, IFluidConnect
|
|||
/** Information about the network's tank */
|
||||
FluidTankInfo[] getTankInfo();
|
||||
|
||||
void markChanged();
|
||||
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@ public abstract class FluidNetwork extends NodeNetwork<IFluidNetwork, IFluidConn
|
|||
@Override
|
||||
public void addConnector(IFluidConnector connector)
|
||||
{
|
||||
markChanged();
|
||||
super.addConnector(connector);
|
||||
NetworkTickHandler.addNetwork(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,8 +106,8 @@ public abstract class FluidNetwork extends NodeNetwork<IFluidNetwork, IFluidConn
|
|||
this.tankInfo[0] = null;
|
||||
}
|
||||
|
||||
this.distributeConnectors();
|
||||
markChanged();
|
||||
distributeConnectors();
|
||||
NetworkTickHandler.addNetwork(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -204,11 +204,4 @@ public abstract class FluidNetwork extends NodeNetwork<IFluidNetwork, IFluidConn
|
|||
{
|
||||
return super.toString() + " Vol:" + this.tank.getFluidAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markChanged()
|
||||
{
|
||||
NetworkTickHandler.addNetwork(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue