cleanup and reformating

trying to save myself grief later with the hydraulic system for when
other use it. I've split it into two parts api for working with FM and
core for using the pipe network system.
This commit is contained in:
Rseifert 2013-03-14 08:42:11 -04:00
parent 99578a289f
commit 8c110124e4
43 changed files with 105 additions and 155 deletions

View file

@ -1 +1 @@
27
31

2
info1.5.0.txt Normal file
View file

@ -0,0 +1,2 @@
@ Fluid-Mechanics_v0.3.0.30.jar hydraulic_v0.3.0.30_api.zip
@ Fluid-Mechanics_v0.3.0.31.jar hydraulic_v0.3.0.31_api.zip

View file

@ -1 +1 @@
0.2.8
0.3.0

View file

@ -1,6 +1,6 @@
package fluidmech.client.render;
import hydraulic.core.implement.ColorCode;
import hydraulic.api.ColorCode;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

View file

@ -1,6 +1,6 @@
package fluidmech.client.render;
import hydraulic.core.implement.ColorCode;
import hydraulic.api.ColorCode;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,7 +1,7 @@
package fluidmech.client.render;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode;
import hydraulic.api.ColorCode;
import hydraulic.helpers.connectionHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.liquids.LiquidContainerRegistry;

View file

@ -5,13 +5,13 @@ import fluidmech.common.block.BlockReleaseValve;
import fluidmech.common.block.BlockSink;
import fluidmech.common.block.BlockTank;
import fluidmech.common.block.liquids.BlockWasteLiquid;
import fluidmech.common.item.ItemTools;
import fluidmech.common.item.ItemBlockLiquidMachine;
import fluidmech.common.item.ItemParts;
import fluidmech.common.item.ItemParts.Parts;
import fluidmech.common.item.ItemBlockPipe;
import fluidmech.common.item.ItemBlockReleaseValve;
import fluidmech.common.item.ItemBlockTank;
import fluidmech.common.item.ItemParts;
import fluidmech.common.item.ItemParts.Parts;
import fluidmech.common.item.ItemTools;
import fluidmech.common.machines.TileEntityMinorPump;
import fluidmech.common.machines.TileEntityReleaseValve;
import fluidmech.common.machines.TileEntitySink;
@ -22,8 +22,8 @@ import fluidmech.common.machines.mech.TileEntityGenerator;
import fluidmech.common.machines.mech.TileEntityRod;
import fluidmech.common.machines.pipes.BlockPipe;
import fluidmech.common.machines.pipes.TileEntityPipe;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.api.ColorCode;
import hydraulic.core.liquidNetwork.LiquidHandler;
import java.io.File;
import java.util.logging.Logger;
@ -65,7 +65,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class FluidMech extends DummyModContainer
{
// TODO Change in Version Release
public static final String VERSION = "0.2.7";
public static final String VERSION = "0.3.0";
// Constants
public static final String NAME = "Fluid_Mechanics";

View file

@ -1,6 +1,6 @@
package fluidmech.common.block;
import hydraulic.core.helpers.MetaGroup;
import hydraulic.helpers.MetaGroup;
import java.util.List;
@ -13,8 +13,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import universalelectricity.components.common.BasicComponents;
import universalelectricity.components.common.block.BlockBasicMachine;
import universalelectricity.prefab.block.BlockAdvanced;
import universalelectricity.prefab.tile.TileEntityAdvanced;
import fluidmech.client.render.BlockRenderHelper;

View file

@ -1,7 +1,7 @@
package fluidmech.common.block;
import hydraulic.core.helpers.MetaGroup;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.core.liquidNetwork.LiquidHandler;
import hydraulic.helpers.MetaGroup;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;

View file

@ -1,11 +1,9 @@
package fluidmech.common.block;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.core.liquidNetwork.LiquidHandler;
import java.util.List;
import universalelectricity.prefab.block.BlockAdvanced;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@ -17,6 +15,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import universalelectricity.prefab.block.BlockAdvanced;
import fluidmech.client.render.BlockRenderHelper;
import fluidmech.common.TabFluidMech;
import fluidmech.common.machines.TileEntityTank;

View file

@ -1,6 +1,5 @@
package fluidmech.common.item;
import fluidmech.common.item.ItemParts.Parts;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

View file

@ -2,11 +2,8 @@ package fluidmech.common.item;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import fluidmech.common.FluidMech;
import fluidmech.common.TabFluidMech;
/**

View file

@ -1,6 +1,6 @@
package fluidmech.common.item;
import hydraulic.core.implement.IReadOut;
import hydraulic.api.IReadOut;
import java.util.List;
@ -11,7 +11,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import fluidmech.common.TabFluidMech;
import fluidmech.common.item.ItemParts.Parts;
public class ItemTools extends ItemBasic
{

View file

@ -1,15 +1,12 @@
package fluidmech.common.machines;
import fluidmech.common.FluidMech;
import hydraulic.core.helpers.MetaGroup;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler;
import java.util.EnumSet;
import hydraulic.api.ColorCode;
import hydraulic.api.IPsiCreator;
import hydraulic.api.IReadOut;
import hydraulic.core.liquidNetwork.LiquidData;
import hydraulic.core.liquidNetwork.LiquidHandler;
import hydraulic.helpers.MetaGroup;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;

View file

@ -1,13 +1,12 @@
package fluidmech.common.machines;
import fluidmech.common.machines.pipes.TileEntityPipe;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IColorCoded;
import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.api.ColorCode;
import hydraulic.api.IColorCoded;
import hydraulic.api.IPsiCreator;
import hydraulic.api.IReadOut;
import hydraulic.core.liquidNetwork.LiquidHandler;
import hydraulic.helpers.connectionHelper;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,9 +1,9 @@
package fluidmech.common.machines;
import fluidmech.common.FluidMech;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IColorCoded;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.api.ColorCode;
import hydraulic.api.IColorCoded;
import hydraulic.core.liquidNetwork.LiquidHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;

View file

@ -2,13 +2,13 @@ package fluidmech.common.machines;
import fluidmech.common.FluidMech;
import fluidmech.common.machines.pipes.TileEntityPipe;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IColorCoded;
import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.api.ColorCode;
import hydraulic.api.IColorCoded;
import hydraulic.api.IPsiCreator;
import hydraulic.api.IReadOut;
import hydraulic.core.liquidNetwork.LiquidData;
import hydraulic.core.liquidNetwork.LiquidHandler;
import hydraulic.helpers.connectionHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;

View file

@ -11,7 +11,6 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import universalelectricity.prefab.block.BlockAdvanced;
import universalelectricity.prefab.implement.IRedstoneReceptor;
import fluidmech.client.render.BlockRenderHelper;
import fluidmech.common.FluidMech;
import fluidmech.common.TabFluidMech;

View file

@ -1,6 +1,5 @@
package fluidmech.common.machines.mech;
import universalelectricity.prefab.block.BlockAdvanced;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
@ -10,6 +9,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.prefab.block.BlockAdvanced;
import fluidmech.client.render.BlockRenderHelper;
import fluidmech.common.FluidMech;
import fluidmech.common.TabFluidMech;

View file

@ -1,11 +1,8 @@
package fluidmech.common.machines.mech;
import hydraulic.core.helpers.MetaGroup;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.IReadOut;
import java.util.EnumSet;
import hydraulic.api.IReadOut;
import hydraulic.helpers.MetaGroup;
import hydraulic.helpers.connectionHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
@ -24,7 +21,6 @@ import universalelectricity.prefab.tile.TileEntityElectrical;
import com.google.common.io.ByteArrayDataInput;
import fluidmech.api.mech.IForce;
import fluidmech.common.FluidMech;
public class TileEntityGenerator extends TileEntityElectrical implements IPacketReceiver, IForce, IReadOut, IRedstoneReceptor
{

View file

@ -1,6 +1,6 @@
package fluidmech.common.machines.mech;
import hydraulic.core.implement.IReadOut;
import hydraulic.api.IReadOut;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;

View file

@ -2,14 +2,13 @@ package fluidmech.common.machines.pipes;
import java.util.List;
import universalelectricity.prefab.block.BlockAdvanced;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import universalelectricity.prefab.block.BlockAdvanced;
import fluidmech.common.FluidMech;
import fluidmech.common.TabFluidMech;

View file

@ -1,18 +1,15 @@
package fluidmech.common.machines.pipes;
import fluidmech.common.machines.TileEntityTank;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IColorCoded;
import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IReadOut;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.api.ColorCode;
import hydraulic.api.IColorCoded;
import hydraulic.api.IPsiCreator;
import hydraulic.api.IReadOut;
import hydraulic.core.liquidNetwork.LiquidHandler;
import hydraulic.helpers.connectionHelper;
import java.util.Random;
import universalelectricity.prefab.tile.TileEntityAdvanced;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
@ -23,6 +20,7 @@ import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.liquids.LiquidTank;
import universalelectricity.prefab.tile.TileEntityAdvanced;
public class TileEntityPipe extends TileEntityAdvanced implements ITankContainer, IReadOut, IColorCoded
{

View file

@ -0,0 +1,15 @@
package hydraulic;
public class INFO
{
/**
* I would place a txt file here but the reob would just ignore it
*
* Anyways if you use the hydraulics system to make your mod more compatible with fluid
* mechanics you only need the api file. However, if you wish to make your own pipes you need
* the core folder as well. As well you will need to register your mod threw the Hydraulics
* class to activate it.
*
*
*/
}

View file

@ -1,7 +1,7 @@
package hydraulic.core.implement;
package hydraulic.api;
import hydraulic.core.liquids.LiquidData;
import hydraulic.core.liquids.LiquidHandler;
import hydraulic.core.liquidNetwork.LiquidData;
import hydraulic.core.liquidNetwork.LiquidHandler;
import java.util.ArrayList;
import java.util.List;
@ -101,7 +101,7 @@ public enum ColorCode
{
return true;
}
if (stack == null)
else if (stack == null)
{
return false;
}

View file

@ -1,4 +1,4 @@
package hydraulic.core.implement;
package hydraulic.api;
public interface IColorCoded

View file

@ -1,6 +1,6 @@
package hydraulic.core.implement;
package hydraulic.api;
import hydraulic.core.liquids.HydraulicNetwork;
import hydraulic.core.liquidNetwork.HydraulicNetwork;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidStack;
@ -21,24 +21,22 @@ public interface IFluidPipe extends IColorCoded
public void setNetwork(HydraulicNetwork network);
/**
* The UE tile entities that this conductor is connected to.
* The tileEntities surrounding the block
*
* @return
*/
public TileEntity[] getConnectedBlocks();
/**
* Gets the resistance the pipes too the liquid going threw it
*
* @return The amount of Ohm's of resistance.
* The max amount of liquid that can flow per request
*/
public int getMaxFlowRate(LiquidStack stack);
/**
* gets the devices pressure from a given side
*/
public double getMaxPressure(ForgeDirection side);
* gets the pipe's max pressure before bursting
*/
public double getMaxPressure();
/**
* Called when the pressure on the pipe passes max
*/

View file

@ -1,4 +1,4 @@
package hydraulic.core.implement;
package hydraulic.api;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package hydraulic.core.implement;
package hydraulic.api;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.LiquidStack;

View file

@ -1,4 +1,4 @@
package hydraulic.core.implement;
package hydraulic.api;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package hydraulic.core.implement;
package hydraulic.api;
public interface IPsiReciever extends IPsiMachine
{

View file

@ -1,4 +1,4 @@
package hydraulic.core.implement;
package hydraulic.api;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,6 +1,6 @@
package hydraulic.core;
import hydraulic.core.liquids.HydraulicNetworkManager;
import hydraulic.core.liquidNetwork.HydraulicNetworkManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent;

View file

@ -1,27 +0,0 @@
package hydraulic.core.implement;
import net.minecraft.tileentity.TileEntity;
/**
* Applied to TileEntities.
*
* @author Calclavia
*
*/
public interface ILiquidConnectionProvider extends ILiquidConnector
{
/**
* Gets a list of all the connected TileEntities that this conductor is connected to. The
* array's length should be always the 6 adjacent wires.
*
* @return
*/
public TileEntity[] getAdjacentConnections();
/**
* Instantly refreshes all connected blocks around the conductor, recalculating the connected
* blocks.
*/
public void updateAdjacentConnections();
}

View file

@ -1,18 +0,0 @@
package hydraulic.core.implement;
import net.minecraftforge.common.ForgeDirection;
/**
* Applied to TileEntities that can connect to an electrical network.
*
* @author Calclavia
*
*/
public interface ILiquidConnector
{
/**
* @return If the connection is possible.
*/
public boolean canConnect(ForgeDirection direction);
}

View file

@ -1,4 +1,4 @@
package hydraulic.core.liquids;
package hydraulic.core.liquidNetwork;
/**
* An easy way to display information on electricity.

View file

@ -1,10 +1,10 @@
package hydraulic.core.liquids;
package hydraulic.core.liquidNetwork;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.core.implement.ColorCode;
import hydraulic.core.implement.IFluidPipe;
import hydraulic.core.implement.IPsiCreator;
import hydraulic.core.implement.IPsiMachine;
import hydraulic.api.ColorCode;
import hydraulic.api.IFluidPipe;
import hydraulic.api.IPsiCreator;
import hydraulic.api.IPsiMachine;
import hydraulic.helpers.connectionHelper;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,6 +1,6 @@
package hydraulic.core.liquids;
package hydraulic.core.liquidNetwork;
import hydraulic.core.implement.IFluidPipe;
import hydraulic.api.IFluidPipe;
import java.util.ArrayList;
import java.util.Iterator;

View file

@ -1,6 +1,6 @@
package hydraulic.core.liquids;
package hydraulic.core.liquidNetwork;
import hydraulic.core.implement.ColorCode;
import hydraulic.api.ColorCode;
import net.minecraftforge.liquids.LiquidStack;
public class LiquidData

View file

@ -1,6 +1,6 @@
package hydraulic.core.liquids;
package hydraulic.core.liquidNetwork;
import hydraulic.core.implement.ColorCode;
import hydraulic.api.ColorCode;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,6 +1,6 @@
package hydraulic.core.path;
import hydraulic.core.helpers.connectionHelper;
import hydraulic.helpers.connectionHelper;
import java.util.ArrayList;
import java.util.List;

View file

@ -1,4 +1,4 @@
package hydraulic.core.helpers;
package hydraulic.helpers;
public class MetaGroup

View file

@ -1,4 +1,4 @@
package hydraulic.core.helpers;
package hydraulic.helpers;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;