Get rid of two redundant factory methods.

This commit is contained in:
Ben Spiers 2014-08-17 04:18:34 +01:00
parent 0ac4494049
commit 090bd9b9c3
5 changed files with 0 additions and 97 deletions

View file

@ -421,31 +421,6 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
return true;
}
@Override
protected GasNetwork create(IGridTransmitter<GasNetwork>... varTransmitters)
{
GasNetwork network = new GasNetwork(varTransmitters);
network.refGas = refGas;
if(gasStored != null)
{
if(network.gasStored == null)
{
network.gasStored = gasStored;
}
else {
network.gasStored.amount += gasStored.amount;
}
}
network.gasScale = network.getScale();
gasScale = 0;
refGas = null;
gasStored = null;
return network;
}
@Override
protected GasNetwork create(Collection<IGridTransmitter<GasNetwork>> collection)
{
@ -468,12 +443,6 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
return network;
}
@Override
protected GasNetwork create(Set<GasNetwork> networks)
{
return new GasNetwork(networks);
}
@Override
public TransmissionType getTransmissionType()
{

View file

@ -42,12 +42,8 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
protected boolean needsUpdate = false;
protected abstract ITransmitterNetwork<A, N> create(IGridTransmitter<N>... varTransmitters);
protected abstract ITransmitterNetwork<A, N> create(Collection<IGridTransmitter<N>> collection);
protected abstract ITransmitterNetwork<A, N> create(Set<N> networks);
protected void clearAround(IGridTransmitter<N> transmitter)
{
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)

View file

@ -429,18 +429,6 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
return jouleBufferLastTick * 20;
}
@Override
protected EnergyNetwork create(IGridTransmitter<EnergyNetwork>... varTransmitters)
{
EnergyNetwork network = new EnergyNetwork(varTransmitters);
network.clientEnergyScale = clientEnergyScale;
network.jouleBufferLastTick = jouleBufferLastTick;
network.joulesTransmitted = joulesTransmitted;
network.lastPowerScale = lastPowerScale;
network.electricityStored += electricityStored;
return network;
}
@Override
protected EnergyNetwork create(Collection<IGridTransmitter<EnergyNetwork>> collection)
{
@ -454,12 +442,6 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
return network;
}
@Override
protected EnergyNetwork create(Set<EnergyNetwork> networks)
{
return new EnergyNetwork(networks);
}
@Override
public TransmissionType getTransmissionType()
{

View file

@ -405,32 +405,6 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
return "[FluidNetwork] " + transmitters.size() + " transmitters, " + possibleAcceptors.size() + " acceptors.";
}
@Override
protected FluidNetwork create(IGridTransmitter<FluidNetwork>... varTransmitters)
{
FluidNetwork network = new FluidNetwork(varTransmitters);
network.refFluid = refFluid;
if(fluidStored != null)
{
if(network.fluidStored == null)
{
network.fluidStored = fluidStored;
}
else {
network.fluidStored.amount += fluidStored.amount;
}
}
network.fluidScale = network.getScale();
fluidScale = 0;
refFluid = null;
fluidStored = null;
return network;
}
@Override
protected FluidNetwork create(Collection<IGridTransmitter<FluidNetwork>> collection)
{
@ -480,12 +454,6 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
return true;
}
@Override
protected FluidNetwork create(Set<FluidNetwork> networks)
{
return new FluidNetwork(networks);
}
@Override
public TransmissionType getTransmissionType()
{

View file

@ -157,24 +157,12 @@ public class InventoryNetwork extends DynamicNetwork<IInventory, InventoryNetwor
return "[FluidNetwork] " + transmitters.size() + " transmitters, " + possibleAcceptors.size() + " acceptors.";
}
@Override
protected InventoryNetwork create(IGridTransmitter<InventoryNetwork>... varTransmitters)
{
return new InventoryNetwork(varTransmitters);
}
@Override
protected InventoryNetwork create(Collection<IGridTransmitter<InventoryNetwork>> collection)
{
return new InventoryNetwork(collection);
}
@Override
protected InventoryNetwork create(Set<InventoryNetwork> networks)
{
return new InventoryNetwork(networks);
}
@Override
public TransmissionType getTransmissionType()
{