make the travel delay dynamically calculated

This commit is contained in:
asiekierka 2014-11-16 14:08:34 +01:00
parent 60ec37ee38
commit 0d84fa1e97
12 changed files with 3 additions and 13 deletions

View file

@ -36,8 +36,6 @@ public final class GuiIds {
public static final int FILTERED_BUFFER = 60; public static final int FILTERED_BUFFER = 60;
public static final int SCIENCE_BOOK = 70;
/** /**
* Deactivate constructor * Deactivate constructor
*/ */

View file

@ -12,6 +12,7 @@ import java.util.BitSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import buildcraft.core.utils.MathUtils;
import buildcraft.transport.pipes.PipeFluidsDiamond; import buildcraft.transport.pipes.PipeFluidsDiamond;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -176,7 +177,8 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler
} }
public void initFromPipe(Class<? extends Pipe> pipeClass) { public void initFromPipe(Class<? extends Pipe> pipeClass) {
flowRate = fluidCapacities.get(pipeClass); flowRate = fluidCapacities.get(pipeClass);
travelDelay = MathUtils.clamp(Math.round(16 / (flowRate / 10)), 1, 12);
} }
@Override @Override

View file

@ -26,7 +26,6 @@ public class PipeFluidsCobblestone extends Pipe<PipeTransportFluids> {
public PipeFluidsCobblestone(Item item) { public PipeFluidsCobblestone(Item item) {
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 12;
} }
@Override @Override

View file

@ -72,7 +72,6 @@ public class PipeFluidsDiamond extends Pipe<PipeTransportFluids> implements IDia
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 4;
} }
@Override @Override

View file

@ -38,7 +38,6 @@ public class PipeFluidsEmerald extends PipeFluidsWood implements IClientState {
solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal(); solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal();
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 4;
} }
public IInventory getFilters() { public IInventory getFilters() {

View file

@ -27,7 +27,6 @@ public class PipeFluidsGold extends Pipe<PipeTransportFluids> {
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 4;
} }
@Override @Override

View file

@ -52,7 +52,6 @@ public class PipeFluidsIron extends Pipe<PipeTransportFluids> {
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 8;
} }
@Override @Override

View file

@ -27,7 +27,6 @@ public class PipeFluidsQuartz extends Pipe<PipeTransportFluids> {
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 8;
} }
@Override @Override

View file

@ -32,7 +32,6 @@ public class PipeFluidsSandstone extends Pipe<PipeTransportFluids> implements IP
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 12;
} }
@Override @Override

View file

@ -27,7 +27,6 @@ public class PipeFluidsStone extends Pipe<PipeTransportFluids> {
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 12;
} }
@Override @Override

View file

@ -29,7 +29,6 @@ public class PipeFluidsVoid extends Pipe<PipeTransportFluids> implements IPipeTr
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 12;
} }
@Override @Override

View file

@ -64,7 +64,6 @@ public class PipeFluidsWood extends Pipe<PipeTransportFluids> implements IEnergy
super(new PipeTransportFluids(), item); super(new PipeTransportFluids(), item);
transport.initFromPipe(getClass()); transport.initFromPipe(getClass());
transport.travelDelay = 12;
} }
@Override @Override