Fixed pipe max pressure material incorrect
This commit is contained in:
parent
e03aec6950
commit
1afcb6ae3d
5 changed files with 30 additions and 83 deletions
|
@ -22,7 +22,6 @@ import resonantinduction.mechanical.energy.turbine.TileWaterTurbine;
|
|||
import resonantinduction.mechanical.energy.turbine.TileWindTurbine;
|
||||
import resonantinduction.mechanical.fluid.pipe.EnumPipeMaterial;
|
||||
import resonantinduction.mechanical.fluid.pipe.ItemPipe;
|
||||
import resonantinduction.mechanical.fluid.transport.BlockPump;
|
||||
import resonantinduction.mechanical.fluid.transport.TilePump;
|
||||
import resonantinduction.mechanical.logistic.belt.BlockDetector;
|
||||
import resonantinduction.mechanical.logistic.belt.BlockManipulator;
|
||||
|
@ -119,7 +118,7 @@ public class Mechanical
|
|||
// blockRejector = contentRegistry.createTile(BlockRejector.class, TileRejector.class);
|
||||
blockSorter = contentRegistry.newBlock(TileSorter.class);
|
||||
|
||||
blockPump = contentRegistry.createTile(BlockPump.class, TilePump.class);
|
||||
blockPump = contentRegistry.newBlock(TilePump.class);
|
||||
|
||||
itemPipe = contentRegistry.createItem(ItemPipe.class);
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode
|
|||
protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
|
||||
private boolean markPacket = true;
|
||||
|
||||
public PartPipe(int typeID)
|
||||
public PartPipe()
|
||||
{
|
||||
super();
|
||||
material = EnumPipeMaterial.values()[typeID];
|
||||
material = EnumPipeMaterial.values()[0];
|
||||
requiresInsulation = false;
|
||||
|
||||
node = new FluidPressureNode(this)
|
||||
|
@ -109,21 +109,23 @@ public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode
|
|||
|
||||
return super.canConnect(from, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFlowRate()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
};
|
||||
|
||||
node.maxFlowRate = getMaterial().maxFlowRate;
|
||||
node.maxPressure = getMaterial().maxPressure;
|
||||
}
|
||||
|
||||
public PartPipe()
|
||||
@Override
|
||||
public void setMaterial(int i)
|
||||
{
|
||||
this(0);
|
||||
setMaterial(EnumPipeMaterial.values()[i]);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaterial(EnumPipeMaterial material)
|
||||
{
|
||||
this.material = material;
|
||||
node.maxFlowRate = getMaterial().maxFlowRate;
|
||||
node.maxPressure = getMaterial().maxPressure;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -172,12 +174,6 @@ public class PartPipe extends PartFramedNode<EnumPipeMaterial, FluidPressureNode
|
|||
RenderPipe.INSTANCE.render(this, pos.x, pos.y, pos.z, frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaterial(int i)
|
||||
{
|
||||
setMaterial(EnumPipeMaterial.values()[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack getItem()
|
||||
{
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package resonantinduction.mechanical.fluid.transport;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import resonantinduction.core.Reference;
|
||||
import universalelectricity.api.UniversalElectricity;
|
||||
import calclavia.lib.prefab.block.BlockRotatable;
|
||||
import calclavia.lib.render.block.BlockRenderingHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockPump extends BlockRotatable
|
||||
{
|
||||
public BlockPump(int id)
|
||||
{
|
||||
super(id, UniversalElectricity.machine);
|
||||
setTextureName(Reference.PREFIX + "material_steel");
|
||||
rotationMask = Byte.parseByte("111111", 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TilePump();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockRenderingHandler.ID;
|
||||
}
|
||||
|
||||
}
|
|
@ -7,10 +7,12 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.grid.Node;
|
||||
import resonantinduction.core.grid.fluid.IPressureNodeProvider;
|
||||
import resonantinduction.core.grid.fluid.FluidPressureNode;
|
||||
import resonantinduction.mechanical.energy.grid.TileMechanical;
|
||||
import universalelectricity.api.UniversalElectricity;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
|
||||
|
@ -20,6 +22,8 @@ public class TilePump extends TileMechanical implements IPressureNodeProvider, I
|
|||
|
||||
public TilePump()
|
||||
{
|
||||
super(UniversalElectricity.machine);
|
||||
|
||||
pressureNode = new FluidPressureNode(this)
|
||||
{
|
||||
@Override
|
||||
|
@ -29,11 +33,11 @@ public class TilePump extends TileMechanical implements IPressureNodeProvider, I
|
|||
{
|
||||
if (dir == getDirection())
|
||||
{
|
||||
return (int) Math.max(Math.abs(mechanicalNode.getTorque() / 1000d), 2);
|
||||
return (int) Math.max(Math.abs(mechanicalNode.getTorque() / 8000d), 2);
|
||||
}
|
||||
else if (dir == getDirection().getOpposite())
|
||||
{
|
||||
return (int) -Math.max(Math.abs(mechanicalNode.getTorque() / 1000d), 2);
|
||||
return (int) -Math.max(Math.abs(mechanicalNode.getTorque() / 8000d), 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +57,12 @@ public class TilePump extends TileMechanical implements IPressureNodeProvider, I
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
normalRender = false;
|
||||
isOpaqueCube = false;
|
||||
customItemRender = true;
|
||||
rotationMask = Byte.parseByte("111111", 2);
|
||||
textureName = "material_steel";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,18 +147,6 @@ public class TilePump extends TileMechanical implements IPressureNodeProvider, I
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getDirection()
|
||||
{
|
||||
return ForgeDirection.getOrientation(this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDirection(ForgeDirection direction)
|
||||
{
|
||||
this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, direction.ordinal(), 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank getPressureTank()
|
||||
{
|
||||
|
@ -167,6 +165,6 @@ public class TilePump extends TileMechanical implements IPressureNodeProvider, I
|
|||
@Override
|
||||
public void onFluidChanged()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ public class FluidPressureNode extends Node<IPressureNodeProvider, TickingGrid,
|
|||
{
|
||||
protected byte connectionMap = Byte.parseByte("111111", 2);
|
||||
private int pressure = 0;
|
||||
public int maxFlowRate = 10;
|
||||
public int maxPressure = 10;
|
||||
public int maxFlowRate = 20;
|
||||
public int maxPressure = 100;
|
||||
|
||||
public FluidPressureNode(IPressureNodeProvider parent)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue