changed block structure

Creative tab and configs are now done in a main block class to reduce
lines of code
This commit is contained in:
DarkGuardsman 2013-07-19 11:39:25 -04:00
parent 2121a01e5a
commit c21700e633
36 changed files with 164 additions and 143 deletions

View file

@ -1,4 +1,4 @@
package dark.fluid.api;
package dark.api.fluid;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fluids.Fluid;

View file

@ -1,4 +1,4 @@
package dark.fluid.api;
package dark.api.fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;

View file

@ -1,4 +1,4 @@
package dark.fluid.api;
package dark.api.fluid;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.Fluid;

View file

@ -1,4 +1,4 @@
package dark.fluid.api.mech;
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package dark.fluid.api.mech;
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package dark.fluid.api.mech;
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;

View file

@ -1,4 +1,4 @@
package dark.fluid.api.mech;
package dark.api.mech;
import net.minecraftforge.common.ForgeDirection;

View file

@ -5,9 +5,9 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.IFluidHandler;
import universalelectricity.core.vector.Vector3;
import universalelectricity.core.vector.VectorHelper;
import dark.api.fluid.IDrain;
import dark.core.api.INetworkPart;
import dark.core.tile.network.NetworkTileEntities;
import dark.fluid.api.IDrain;
public class HydraulicNetworkHelper
{

View file

@ -6,10 +6,10 @@ import java.util.List;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import dark.api.fluid.INetworkFluidPart;
import dark.core.api.ColorCode;
import dark.core.api.INetworkPart;
import dark.core.tile.network.NetworkTileEntities;
import dark.fluid.api.INetworkFluidPart;
/** Side note: the network should act like this when done {@link http
* ://www.e4training.com/hydraulic_calculators/B1.htm} as well as stay compatible with the forge

View file

@ -13,12 +13,12 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.IFluidHandler;
import universalelectricity.core.path.Pathfinder;
import universalelectricity.core.vector.Vector3;
import dark.api.fluid.INetworkFluidPart;
import dark.core.api.ColorCode;
import dark.core.api.INetworkPart;
import dark.core.hydraulic.helpers.FluidHelper;
import dark.core.tile.network.NetworkPathFinder;
import dark.core.tile.network.NetworkTileEntities;
import dark.fluid.api.INetworkFluidPart;
import dark.helpers.ConnectionHelper;
public class NetworkFluidTiles extends NetworkTileEntities

View file

@ -9,12 +9,12 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import dark.api.fluid.INetworkPipe;
import dark.core.api.ColorCode;
import dark.core.api.INetworkPart;
import dark.core.hydraulic.helpers.FluidHelper;
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.core.tile.network.NetworkTileEntities;
import dark.fluid.api.INetworkPipe;
import dark.helpers.ConnectionHelper;
/** Side note: the network should act like this when done {@link http

View file

@ -41,7 +41,7 @@ public class BlockRenderHelper implements ISimpleBlockRenderingHandler
GL11.glTranslatef((float) 0.0F, (float) 1.1F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "pumps/WaterPump.png"));
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "pumps/WaterPump.png"));
modelPump.render(0.0725F);
modelPump.renderMotion(0.0725F, 0);
}
@ -49,7 +49,7 @@ public class BlockRenderHelper implements ISimpleBlockRenderingHandler
{
GL11.glTranslatef((float) 0.0F, (float) .8F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "Sink.png"));
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "Sink.png"));
sink.render(0.0565F);
}
else if (block.blockID == FluidMech.blockTank.blockID)
@ -68,21 +68,21 @@ public class BlockRenderHelper implements ISimpleBlockRenderingHandler
{
GL11.glTranslatef((float) 0.0F, (float) 1.5F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "mechanical/GearRod.png"));
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "mechanical/GearRod.png"));
modelRod.render(0.0825F, 0);
}
else if (block.blockID == FluidMech.blockGenerator.blockID)
{
GL11.glTranslatef((float) 0.0F, (float) 1.0F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "mechanical/Generator.png"));
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "mechanical/Generator.png"));
modelGen.render(null);
}
else if (block.blockID == FluidMech.blockConPump.blockID && metadata < 4)
{
GL11.glTranslatef((float) 0.0F, (float) 1.2F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "ConstructionPump.png"));
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "ConstructionPump.png"));
conPump.render(0.0725F);
conPump.renderMotor(0.0725F);

View file

@ -88,7 +88,7 @@ public class ItemRenderHelper implements IItemRenderer
pipe.SixPipe.renderBack();
pipe.SixPipe.renderMiddle();
}
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "ReleaseValve.png"));
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "ReleaseValve.png"));
GL11.glRotatef(180f, 0f, 0f, 1f);
if (!equ)
{

View file

@ -58,7 +58,7 @@ public class RenderConstructionPump extends RenderMachine
@Override
public ResourceLocation getTexture(int block, int meta)
{
return new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "ConstructionPump.png");
return new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "ConstructionPump.png");
}
}

View file

@ -64,7 +64,7 @@ public class RenderPump extends RenderMachine
@Override
public ResourceLocation getTexture(int block, int meta)
{
return new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "pumps/WaterPump.png");
return new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "pumps/WaterPump.png");
}
}

View file

@ -51,7 +51,7 @@ public class RenderReleaseValve extends RenderMachine
if (ents[4] != null)
SixPipe.renderLeft();
SixPipe.renderMiddle();
bindTextureByName(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "ReleaseValve.png");
bindTextureByName(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "ReleaseValve.png");
if (ents[1] == null)
valve.render();
GL11.glPopMatrix();
@ -72,6 +72,6 @@ public class RenderReleaseValve extends RenderMachine
@Override
public ResourceLocation getTexture(int block, int meta)
{
return new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "pipes/" + ColorCode.get(15).getName() + "Pipe.png");
return new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "pipes/" + ColorCode.get(15).getName() + "Pipe.png");
}
}

View file

@ -82,7 +82,7 @@ public class RenderSink extends RenderMachine
@Override
public ResourceLocation getTexture(int block, int meta)
{
return new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "Sink.png");
return new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "Sink.png");
}
}

View file

@ -94,7 +94,7 @@ public class RenderPipe extends RenderMachine
{
name = ColorCode.get(meta).getName();
}
return new ResourceLocation(FluidMech.DOMAIN, FluidMech.MODEL_DIRECTORY + "pipes/" + name + "Pipe.png");
return new ResourceLocation(FluidMech.instance.DOMAIN, FluidMech.MODEL_DIRECTORY + "pipes/" + name + "Pipe.png");
}
public void render(int blockID, int meta, boolean[] side)

View file

@ -0,0 +1,15 @@
package dark.fluid.common;
import net.minecraft.block.material.Material;
import dark.library.machine.BlockMachine;
public abstract class BlockFM extends BlockMachine
{
public BlockFM(String name, int blockID, Material material)
{
super(name, FluidMech.CONFIGURATION, blockID, material);
this.setCreativeTab(FluidMech.TabFluidMech);
}
}

View file

@ -35,6 +35,7 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import dark.core.ModPrefab;
import dark.core.api.ColorCode;
import dark.fluid.common.item.ItemParts;
import dark.fluid.common.item.ItemParts.Parts;
@ -65,7 +66,7 @@ import dark.mech.common.machines.BlockRod;
@ModstatInfo(prefix = "fluidmech")
@Mod(modid = FluidMech.MOD_ID, name = FluidMech.MOD_NAME, version = FluidMech.VERSION, useMetadata = true)
@NetworkMod(channels = { FluidMech.CHANNEL }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketManager.class)
public class FluidMech extends DummyModContainer
public class FluidMech extends ModPrefab
{
// @Mod Prerequisites
@ -78,36 +79,19 @@ public class FluidMech extends DummyModContainer
public static final String MOD_ID = "FluidMech";
public static final String MOD_NAME = "Fluid_Mechanics";
public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVIS_VERSION + "." + BUILD_VERSION;
public static final String DOMAIN = "fm";
public static final String PREFIX = DOMAIN + ":";
// @NetworkMod
public static final String CHANNEL = "FluidMech";
@Metadata(FluidMech.MOD_ID)
public static ModMetadata meta;
/* RESOURCE FILE PATHS */
public static final String DIRECTORY_NO_SLASH = "assets/" + DOMAIN + "/";
public static final String DIRECTORY = "/" + DIRECTORY_NO_SLASH;
public static final String LANGUAGE_PATH = DIRECTORY + "languages/";
public static final String SOUND_PATH = DIRECTORY + "audio/";
public static final String TEXTURE_DIRECTORY = "textures/";
public static final String BLOCK_DIRECTORY = TEXTURE_DIRECTORY + "blocks/";
public static final String ITEM_DIRECTORY = TEXTURE_DIRECTORY + "items/";
public static final String MODEL_DIRECTORY = TEXTURE_DIRECTORY + "models/";
public static final String GUI_DIRECTORY = TEXTURE_DIRECTORY + "gui/";
/* SUPPORTED LANGS */
private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US", "de_DE" };
/* CONFIG FILE */
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir() + "/Dark/", FluidMech.MOD_NAME + ".cfg"));
/* START IDS */
public final static int BLOCK_ID_PREFIX = 3100;
public final static int ITEM_ID_PREFIX = 13200;
/* BLOCKS */
public static Block blockPipe;
public static Block blockGenPipe;
@ -134,6 +118,12 @@ public class FluidMech extends DummyModContainer
/* LOGGER - EXTENDS FORGE'S LOG SYSTEM */
public static Logger FMLog = Logger.getLogger(FluidMech.MOD_NAME);
public FluidMech()
{
super("fm");
// TODO Auto-generated constructor stub
}
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
@ -146,32 +136,6 @@ public class FluidMech extends DummyModContainer
/* UPDATE NOTIFIER */
Modstats.instance().getReporter().registerMod(this);
/* CONFIGS */
CONFIGURATION.load();
/* LIQUID DIRECTORY CALL */
Fluid waste = new Fluid("waste").setBlockID(FluidMech.CONFIGURATION.getBlock("WasteLiquid", BLOCK_ID_PREFIX + 7).getInt());
/* BLOCK DECLARATION -- CONFIG LOADER */
blockGenPipe = new BlockPipe(FluidMech.CONFIGURATION.getBlock("Pipes", BLOCK_ID_PREFIX).getInt());
blockMachine = new BlockPumpMachine(FluidMech.CONFIGURATION.getBlock("Machines", BLOCK_ID_PREFIX + 1).getInt());
blockRod = new BlockRod(FluidMech.CONFIGURATION.getBlock("MechRod", BLOCK_ID_PREFIX + 3).getInt());
blockGenerator = new BlockGenerator((FluidMech.CONFIGURATION.getBlock("Generator", BLOCK_ID_PREFIX + 4).getInt()));
blockReleaseValve = new BlockReleaseValve((FluidMech.CONFIGURATION.getBlock("ReleaseValve", BLOCK_ID_PREFIX + 5).getInt()));
blockTank = new BlockTank(FluidMech.CONFIGURATION.getBlock("Tank", BLOCK_ID_PREFIX + 6).getInt());
blockWasteLiquid = new BlockFluidFinite(waste.getBlockID(), waste, Material.water);
blockSink = new BlockSink(FluidMech.CONFIGURATION.getBlock("Sink", BLOCK_ID_PREFIX + 8).getInt());
blockDrain = new BlockDrain(FluidMech.CONFIGURATION.getBlock("Drain", BLOCK_ID_PREFIX + 9).getInt());
blockConPump = new BlockConstructionPump(FluidMech.CONFIGURATION.getBlock("ConstructionPump", BLOCK_ID_PREFIX + 10).getInt());
blockPipe = new BlockPipe(FluidMech.CONFIGURATION.getBlock("RestrictedPipes", BLOCK_ID_PREFIX + 11).getInt());
/* ITEM DECLARATION -- COFNGI LOADER */
itemParts = new ItemParts(FluidMech.CONFIGURATION.getItem("Parts", ITEM_ID_PREFIX).getInt());
itemGauge = new ItemTools(FluidMech.CONFIGURATION.getItem("PipeGuage", ITEM_ID_PREFIX + 3).getInt());
if (CONFIGURATION.hasChanged())
{
CONFIGURATION.save();
}
/* CONFIG END */
proxy.preInit();
@ -193,18 +157,6 @@ public class FluidMech extends DummyModContainer
@EventHandler
public void Init(FMLInitializationEvent event)
{
/* MCMOD.INFO FILE BUILDER? */
meta.modId = FluidMech.MOD_ID;
meta.name = FluidMech.MOD_NAME;
meta.description = "Fluid Mechanics is a combination between supporting fluid handling and mechanical energy handling system. " + "Its designed to help other mods move there liquids to using a universal liquid system managed by forge. As a bonus it also " + "comes with suppot to help mods move energy by means of mechanics motion along rods. This mod by itself doesn't offer much more " + "than basic liquid storage, placement, and removel in the world. Its suggest to download other mods that supports the Forge's " + "LiquidDictionary. " + "\n" + "Suported Power systems: Universal Electric ";
meta.url = "http://www.universalelectricity.com/fluidmechanics";
meta.logoFile = FluidMech.TEXTURE_DIRECTORY + "FM_Banner.png";
meta.version = FluidMech.VERSION;
meta.authorList = Arrays.asList(new String[] { "DarkGuardsman AKA DarkCow" });
meta.credits = "Please see the website.";
meta.autogenerated = false;
/* LOGGER */
FMLog.info("Loading...");
@ -326,6 +278,56 @@ public class FluidMech extends DummyModContainer
FMLog.info("Done Loading");
}
@Override
public void loadConfig()
{
/* CONFIGS */
CONFIGURATION.load();
/* LIQUID DIRECTORY CALL */
Fluid waste = new Fluid("waste").setBlockID(FluidMech.CONFIGURATION.getBlock("WasteLiquid", BLOCK_ID_PREFIX++).getInt());
/* BLOCK DECLARATION -- CONFIG LOADER */
blockGenPipe = new BlockPipe(FluidMech.CONFIGURATION.getBlock("Pipes", BLOCK_ID_PREFIX).getInt());
blockMachine = new BlockPumpMachine(FluidMech.CONFIGURATION.getBlock("Machines", BLOCK_ID_PREFIX + 1).getInt());
blockRod = new BlockRod(FluidMech.CONFIGURATION.getBlock("MechRod", BLOCK_ID_PREFIX + 3).getInt());
blockGenerator = new BlockGenerator((FluidMech.CONFIGURATION.getBlock("Generator", BLOCK_ID_PREFIX + 4).getInt()));
blockReleaseValve = new BlockReleaseValve((FluidMech.CONFIGURATION.getBlock("ReleaseValve", BLOCK_ID_PREFIX + 5).getInt()));
blockTank = new BlockTank(FluidMech.CONFIGURATION.getBlock("Tank", BLOCK_ID_PREFIX + 6).getInt());
blockWasteLiquid = new BlockFluidFinite(waste.getBlockID(), waste, Material.water);
blockSink = new BlockSink(FluidMech.CONFIGURATION.getBlock("Sink", BLOCK_ID_PREFIX + 8).getInt());
blockDrain = new BlockDrain(FluidMech.CONFIGURATION.getBlock("Drain", BLOCK_ID_PREFIX + 9).getInt());
blockConPump = new BlockConstructionPump(FluidMech.CONFIGURATION.getBlock("ConstructionPump", BLOCK_ID_PREFIX + 10).getInt());
blockPipe = new BlockPipe(FluidMech.CONFIGURATION.getBlock("RestrictedPipes", BLOCK_ID_PREFIX + 11).getInt());
/* ITEM DECLARATION */
itemParts = new ItemParts(FluidMech.CONFIGURATION.getItem("Parts", ITEM_ID_PREFIX).getInt());
itemGauge = new ItemTools(FluidMech.CONFIGURATION.getItem("PipeGuage", ITEM_ID_PREFIX + 3).getInt());
if (CONFIGURATION.hasChanged())
{
CONFIGURATION.save();
}
}
@Override
public void loadModMeta()
{
/* MCMOD.INFO FILE BUILDER? */
meta.modId = FluidMech.MOD_ID;
meta.name = FluidMech.MOD_NAME;
meta.description = "Fluid Mechanics is a combination between supporting fluid handling and mechanical energy handling system. " + "Its designed to help other mods move there liquids using a universal liquid system managed by forge. As a bonus it also " + "comes with suppot to help mods move energy by means of mechanics motion along rods. This mod by itself doesn't offer much more " + "than basic liquid storage, placement, and removel in the world. Its suggest to download other mods that supports the Forge's " + "Fluid System. " + "\n\n" + "Suported Power systems: Universal Electric, BuildCraft, IndustrialCraft ";
meta.url = "http://www.universalelectricity.com/fluidmechanics";
meta.logoFile = FluidMech.TEXTURE_DIRECTORY + "FM_Banner.png";
meta.version = FluidMech.VERSION;
meta.authorList = Arrays.asList(new String[] { "DarkGuardsman AKA DarkCow" });
meta.credits = "Please see the website.";
meta.autogenerated = false;
}
public static final CreativeTabs TabFluidMech = new CreativeTabs("Fluid Mechanics")
{

View file

@ -33,7 +33,7 @@ public class ItemBasic extends Item
{
for (ItemStack itemStack : list)
{
this.icons[list.indexOf(itemStack)] = iconRegister.registerIcon(this.getUnlocalizedName(itemStack).replace("item.", FluidMech.PREFIX));
this.icons[list.indexOf(itemStack)] = iconRegister.registerIcon(this.getUnlocalizedName(itemStack).replace("item.", FluidMech.instance.PREFIX));
}
}
}

View file

@ -8,16 +8,14 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.library.machine.BlockMachine;
public class BlockReleaseValve extends BlockMachine
public class BlockReleaseValve extends BlockFM
{
public BlockReleaseValve(int par1)
{
super(par1, Material.iron);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("eValve");
super("ReleaseValve",par1, Material.iron);
this.setHardness(1f);
this.setResistance(5f);
}

View file

@ -10,17 +10,14 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import universalelectricity.prefab.tile.TileEntityAdvanced;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.FluidMech;
import dark.fluid.common.BlockFM;
import dark.helpers.MetaGroup;
import dark.library.machine.BlockMachine;
public class BlockSink extends BlockMachine
public class BlockSink extends BlockFM
{
public BlockSink(int par1)
{
super(par1, Material.iron);
this.setUnlocalizedName("lmSink");
this.setCreativeTab(FluidMech.TabFluidMech);
super("FluidSink", par1, Material.iron);
this.setResistance(4f);
this.setHardness(4f);
}

View file

@ -17,18 +17,15 @@ import dark.core.api.INetworkPart;
import dark.core.hydraulic.helpers.FluidHelper;
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.FluidMech;
import dark.fluid.common.BlockFM;
import dark.library.machine.AutoCraftingManager;
import dark.library.machine.BlockMachine;
public class BlockTank extends BlockMachine
public class BlockTank extends BlockFM
{
public BlockTank(int id)
{
super(id, Material.rock);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("lmTank");
super("FluidTank", id, Material.rock);
this.setHardness(1f);
this.setResistance(5f);
}

View file

@ -10,12 +10,12 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
import dark.api.fluid.INetworkPipe;
import dark.core.api.ColorCode;
import dark.core.api.IColorCoded;
import dark.core.api.ITileConnector;
import dark.core.api.IToolReadOut;
import dark.core.network.fluid.NetworkPipes;
import dark.fluid.api.INetworkPipe;
import dark.fluid.common.prefab.TileEntityFluidDevice;
import dark.helpers.ConnectionHelper;

View file

@ -31,6 +31,8 @@ import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.api.fluid.INetworkFluidPart;
import dark.api.fluid.INetworkPipe;
import dark.core.api.ColorCode;
import dark.core.api.IColorCoded;
import dark.core.api.IToolReadOut;
@ -38,8 +40,6 @@ import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.core.network.fluid.NetworkFluidContainers;
import dark.core.network.fluid.NetworkFluidTiles;
import dark.core.tile.network.NetworkTileEntities;
import dark.fluid.api.INetworkFluidPart;
import dark.fluid.api.INetworkPipe;
import dark.fluid.common.FluidMech;
import dark.fluid.common.prefab.TileEntityFluidStorage;

View file

@ -11,20 +11,18 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.fluids.IFluidTank;
import dark.api.fluid.INetworkPipe;
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.fluid.api.INetworkPipe;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.library.machine.BlockMachine;
public class BlockPipe extends BlockMachine
public class BlockPipe extends BlockFM
{
public BlockPipe(int id)
{
super(id, Material.iron);
super("FluidPipe", id, Material.iron);
this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F);
this.setHardness(1f);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("lmPipe");
this.setResistance(3f);
}

View file

@ -33,6 +33,7 @@ import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.api.fluid.INetworkPipe;
import dark.core.api.ColorCode;
import dark.core.api.IColorCoded;
import dark.core.api.ITileConnector;
@ -40,7 +41,6 @@ import dark.core.api.IToolReadOut;
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.core.network.fluid.NetworkPipes;
import dark.core.tile.network.NetworkTileEntities;
import dark.fluid.api.INetworkPipe;
import dark.fluid.common.FluidMech;
import dark.fluid.common.pipes.addon.IPipeExtention;

View file

@ -1,6 +1,6 @@
package dark.fluid.common.pipes.tele;
import dark.fluid.api.INetworkPipe;
import dark.api.fluid.INetworkPipe;
/** Used by IFluidNetworkPart to signal this block is remotely connected to another network. It will
* cause that network to seak out all other connected network and try to merge them */

View file

@ -17,19 +17,17 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import dark.core.network.fluid.HydraulicNetworkHelper;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.library.machine.BlockMachine;
public class BlockConstructionPump extends BlockMachine
public class BlockConstructionPump extends BlockFM
{
Icon inputIcon;
Icon outputIcon;
public BlockConstructionPump(int id)
{
super(id, Material.iron);
this.setUnlocalizedName("lmConPump");
this.setCreativeTab(FluidMech.TabFluidMech);
super("ConstructionPump", id, Material.iron);
this.setHardness(1f);
this.setResistance(5f);
@ -38,9 +36,9 @@ public class BlockConstructionPump extends BlockMachine
@Override
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon(FluidMech.PREFIX + "ironMachineSide");
this.inputIcon = par1IconRegister.registerIcon(FluidMech.PREFIX + "inputMachineSide");
this.outputIcon = par1IconRegister.registerIcon(FluidMech.PREFIX + "outputMachineSide");
this.blockIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "ironMachineSide");
this.inputIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "inputMachineSide");
this.outputIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "outputMachineSide");
}
@Override

View file

@ -12,10 +12,10 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.library.machine.BlockMachine;
public class BlockDrain extends BlockMachine
public class BlockDrain extends BlockFM
{
private Icon blockIcon;
private Icon drainIcon;
@ -23,9 +23,7 @@ public class BlockDrain extends BlockMachine
public BlockDrain(int id)
{
super(id, Material.iron);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("lmDrain");
super("FluidDrain", id, Material.iron);
}
@Override
@ -37,9 +35,9 @@ public class BlockDrain extends BlockMachine
@Override
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon(FluidMech.PREFIX + "ironMachineSide");
this.drainIcon = par1IconRegister.registerIcon(FluidMech.PREFIX + "drain");
this.fillIcon = par1IconRegister.registerIcon(FluidMech.PREFIX + "drain2");
this.blockIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "ironMachineSide");
this.drainIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "drain");
this.fillIcon = par1IconRegister.registerIcon(FluidMech.instance.PREFIX + "drain2");
}
@Override

View file

@ -12,18 +12,16 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.helpers.MetaGroup;
import dark.library.machine.BlockMachine;
public class BlockPumpMachine extends BlockMachine
public class BlockPumpMachine extends BlockFM
{
public BlockPumpMachine(int id)
{
super(id, Material.iron);
this.setUnlocalizedName("lmMachines");
this.setCreativeTab(FluidMech.TabFluidMech);
super("FluidMachine", id, Material.iron);
this.setHardness(1f);
this.setResistance(5f);
}
@ -87,6 +85,13 @@ public class BlockPumpMachine extends BlockMachine
}
}
@Override
public TileEntity createNewTileEntity(World world)
{
// TODO Auto-generated method stub
return null;
}
@Override
public TileEntity createTileEntity(World var1, int meta)
{
@ -135,4 +140,5 @@ public class BlockPumpMachine extends BlockMachine
}
return true;
}
}

View file

@ -10,10 +10,10 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import universalelectricity.core.vector.Vector3;
import universalelectricity.core.vector.VectorHelper;
import dark.api.fluid.INetworkPipe;
import dark.core.api.ITileConnector;
import dark.core.network.fluid.HydraulicNetworkHelper;
import dark.core.network.fluid.NetworkFluidTiles;
import dark.fluid.api.INetworkPipe;
import dark.helpers.MetaGroup;
import dark.library.machine.TileEntityRunnableMachine;

View file

@ -19,9 +19,9 @@ import net.minecraftforge.fluids.IFluidHandler;
import universalelectricity.core.vector.Vector2;
import universalelectricity.core.vector.Vector3;
import universalelectricity.core.vector.VectorHelper;
import dark.api.fluid.IDrain;
import dark.api.fluid.INetworkPipe;
import dark.core.hydraulic.helpers.FluidHelper;
import dark.fluid.api.IDrain;
import dark.fluid.api.INetworkPipe;
import dark.fluid.common.prefab.TileEntityFluidDevice;
public class TileEntityDrain extends TileEntityFluidDevice implements IFluidHandler, IDrain

View file

@ -6,21 +6,20 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.library.machine.BlockMachine;
public class BlockGenerator extends BlockMachine
public class BlockGenerator extends BlockFM
{
public BlockGenerator(int id)
{
super(id, Material.iron);
this.setUnlocalizedName("lmGen");
this.setCreativeTab(FluidMech.TabFluidMech);
super("MechanicalGenerator", id, Material.iron);
this.setHardness(1f);
this.setResistance(5f);
}
@ -85,4 +84,11 @@ public class BlockGenerator extends BlockMachine
super.onNeighborBlockChange(par1World, x, y, z, side);
}
@Override
public TileEntity createNewTileEntity(World world)
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -4,22 +4,21 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.BlockFM;
import dark.fluid.common.FluidMech;
import dark.library.machine.BlockMachine;
public class BlockRod extends BlockMachine
public class BlockRod extends BlockFM
{
public BlockRod(int par1)
{
super(par1, Material.iron);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("MechanicRod");
super("MechanicalRod", par1, Material.iron);
this.setHardness(1f);
this.setResistance(5f);
}
@ -99,4 +98,11 @@ public class BlockRod extends BlockMachine
return BlockRenderHelper.renderID;
}
@Override
public TileEntity createNewTileEntity(World world)
{
// TODO Auto-generated method stub
return null;
}
}