Added pipe gauge from Fluid Mechanics

The work to add it was actually implemented a while ago but i'm just now
getting around to registering the new tool class for it.
This commit is contained in:
DarkGuardsman 2013-08-26 14:01:03 -04:00
parent cd5f64d05e
commit e0bd6c3796
5 changed files with 67 additions and 29 deletions

View file

@ -20,7 +20,7 @@ public class TileEntityInfLoad extends TileEntity implements IElectrical
{ {
if(receive != null) if(receive != null)
{ {
System.out.print("Burning off "+receive.getWatts()+" watts of energy"); System.out.println("Burning off "+receive.getWatts()+" watts of energy");
} }
return this.canConnect(from) && receive != null ? receive.getWatts() : 0; return this.canConnect(from) && receive != null ? receive.getWatts() : 0;
} }

View file

@ -1,6 +1,25 @@
package dark.common.transmit; package dark.common.transmit;
public class BlockWire import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import dark.core.blocks.BlockMachine;
public class BlockWire extends BlockMachine
{ {
public BlockWire(Configuration config, int blockID)
{
super("DMWire", config, blockID, Material.cloth);
this.setCreativeTab(CreativeTabs.tabRedstone);
this.setBlockBounds(0, 0, 0, 1, .3f, 1);
}
@Override
public TileEntity createNewTileEntity(World world)
{
return new TileEntityWire();
}
} }

View file

@ -4,25 +4,28 @@ import net.minecraft.block.Block;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.FurnaceRecipes;
import dark.core.RecipeLoader.RecipeGrid;
import dark.core.items.EnumMeterials; import dark.core.items.EnumMeterials;
import dark.core.items.EnumOreParts; import dark.core.items.EnumOreParts;
import dark.core.items.ItemTools;
import dark.core.items.ItemWrench; import dark.core.items.ItemWrench;
public class CoreRecipeLoader extends RecipeLoader public class CoreRecipeLoader extends RecipeLoader
{ {
/* BLOCKS */ /* BLOCKS */
public static Block blockOre, blockDebug; public static Block blockOre, blockDebug, blockWire;
/* ITEMS */ /* ITEMS */
public static Item itemMetals; public static Item itemMetals, battery, itemTool;
public static ItemWrench wrench; public static ItemWrench wrench;
public static Item battery;
@Override @Override
public void loadRecipes() public void loadRecipes()
{ {
super.loadRecipes(); super.loadRecipes();
new RecipeGrid(new ItemStack(itemTool, 1, 0), 3, 2).setRowOne("ironTube", "valvePart", "ironTube").setRowTwo(null, "ironTube", null).RegisterRecipe();
loadSmeltingRecipes(); loadSmeltingRecipes();
} }

View file

@ -25,6 +25,8 @@ import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import dark.common.debug.BlockDebug; import dark.common.debug.BlockDebug;
import dark.common.debug.BlockDebug.debugBlocks; import dark.common.debug.BlockDebug.debugBlocks;
import dark.common.transmit.BlockWire;
import dark.common.transmit.TileEntityWire;
import dark.core.blocks.BlockMulti; import dark.core.blocks.BlockMulti;
import dark.core.blocks.BlockOre; import dark.core.blocks.BlockOre;
import dark.core.blocks.TileEntityMulti; import dark.core.blocks.TileEntityMulti;
@ -34,6 +36,7 @@ import dark.core.items.ItemBattery;
import dark.core.items.ItemBlockHolder; import dark.core.items.ItemBlockHolder;
import dark.core.items.ItemOre; import dark.core.items.ItemOre;
import dark.core.items.ItemOreDirv; import dark.core.items.ItemOreDirv;
import dark.core.items.ItemTools;
import dark.core.items.ItemWrench; import dark.core.items.ItemWrench;
/** @author HangCow, DarkGuardsman */ /** @author HangCow, DarkGuardsman */
@ -104,6 +107,24 @@ public class DarkMain extends ModPrefab
if (CoreRecipeLoader.blockOre != null) if (CoreRecipeLoader.blockOre != null)
{ {
GameRegistry.registerBlock(CoreRecipeLoader.blockOre, ItemOre.class, "DMOre"); GameRegistry.registerBlock(CoreRecipeLoader.blockOre, ItemOre.class, "DMOre");
BlockOre.regiserOreNames();
for (int i = 0; i < EnumMeterials.values().length; i++)
{
if (EnumMeterials.values()[i].doWorldGen)
{
OreGenReplaceStone gen = EnumMeterials.values()[i].getGeneratorSettings();
if (gen != null && gen.shouldGenerate)
{
OreGenerator.addOre(gen);
}
}
}
}
if (CoreRecipeLoader.blockWire != null)
{
GameRegistry.registerBlock(CoreRecipeLoader.blockWire, ItemBlockHolder.class, "DMWire");
GameRegistry.registerTileEntity(TileEntityWire.class, "DMWire");
} }
if (CoreRecipeLoader.blockDebug != null) if (CoreRecipeLoader.blockDebug != null)
{ {
@ -113,23 +134,10 @@ public class DarkMain extends ModPrefab
GameRegistry.registerTileEntity(debugBlocks.values()[i].clazz, "DMDebug" + i); GameRegistry.registerTileEntity(debugBlocks.values()[i].clazz, "DMDebug" + i);
} }
} }
//TODO look at possibility of having this only be enabled if needed but still no option to disable manually
GameRegistry.registerBlock(blockMulti, "multiBlock"); GameRegistry.registerBlock(blockMulti, "multiBlock");
GameRegistry.registerTileEntity(TileEntityMulti.class, "DMMultiBlock"); GameRegistry.registerTileEntity(TileEntityMulti.class, "DMMultiBlock");
BlockOre.regiserOreNames();
for (int i = 0; i < EnumMeterials.values().length; i++)
{
if (EnumMeterials.values()[i].doWorldGen)
{
OreGenReplaceStone gen = EnumMeterials.values()[i].getGeneratorSettings();
if (gen != null && gen.shouldGenerate)
{
OreGenerator.addOre(gen);
}
}
}
proxy.init(); proxy.init();
} }
@ -156,18 +164,15 @@ public class DarkMain extends ModPrefab
CONFIGURATION.load(); CONFIGURATION.load();
/* BLOCKS */ /* BLOCKS */
blockMulti = new BlockMulti(DarkMain.CONFIGURATION.getBlock("MultiBlock", getNextID()).getInt()); blockMulti = new BlockMulti(DarkMain.CONFIGURATION.getBlock("MultiBlock", getNextID()).getInt());
if (CONFIGURATION.get("general", "EnableBattery", true).getBoolean(true))
{
CoreRecipeLoader.battery = new ItemBattery("Battery", ITEM_ID_PREFIX++);
}
if (CONFIGURATION.get("general", "EnableWrench", true).getBoolean(true))
{
CoreRecipeLoader.wrench = new ItemWrench(ITEM_ID_PREFIX++, DarkMain.CONFIGURATION);
}
if (CONFIGURATION.get("general", "LoadOre", true).getBoolean(true)) if (CONFIGURATION.get("general", "LoadOre", true).getBoolean(true))
{ {
CoreRecipeLoader.blockOre = new BlockOre(getNextID(), CONFIGURATION); CoreRecipeLoader.blockOre = new BlockOre(getNextID(), CONFIGURATION);
} }
if (CONFIGURATION.get("general", "EnableWires", true).getBoolean(true))
{
CoreRecipeLoader.blockWire = new BlockWire(CONFIGURATION, getNextID());
}
if (CONFIGURATION.get("general", "enableDebugBlocks", false).getBoolean(false)) if (CONFIGURATION.get("general", "enableDebugBlocks", false).getBoolean(false))
{ {
CoreRecipeLoader.blockDebug = new BlockDebug(getNextID(), CONFIGURATION); CoreRecipeLoader.blockDebug = new BlockDebug(getNextID(), CONFIGURATION);
@ -177,6 +182,18 @@ public class DarkMain extends ModPrefab
{ {
CoreRecipeLoader.itemMetals = new ItemOreDirv(ITEM_ID_PREFIX++, CONFIGURATION); CoreRecipeLoader.itemMetals = new ItemOreDirv(ITEM_ID_PREFIX++, CONFIGURATION);
} }
if (CONFIGURATION.get("general", "EnableBattery", true).getBoolean(true))
{
CoreRecipeLoader.battery = new ItemBattery("Battery", ITEM_ID_PREFIX++);
}
if (CONFIGURATION.get("general", "EnableWrench", true).getBoolean(true))
{
CoreRecipeLoader.wrench = new ItemWrench(ITEM_ID_PREFIX++, DarkMain.CONFIGURATION);
}
if (CONFIGURATION.get("general", "EnableWrench", true).getBoolean(true))
{
CoreRecipeLoader.itemTool = new ItemTools(ITEM_ID_PREFIX++, DarkMain.CONFIGURATION);
}
CONFIGURATION.save(); CONFIGURATION.save();
/* CONFIG END */ /* CONFIG END */

View file

@ -1,6 +1,5 @@
package dark.core.items; package dark.core.items;
import java.util.HashMap;
import java.util.List; import java.util.List;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@ -82,7 +81,7 @@ public class ItemTools extends ItemBasic
FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(ForgeDirection.getOrientation(side)); FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(ForgeDirection.getOrientation(side));
if (tanks != null) if (tanks != null)
{ {
player.sendChatToPlayer(ChatMessageComponent.func_111066_d("FluidHandler> Side:"+ForgeDirection.getOrientation(side).toString()+" Tanks:" + tanks.length)); player.sendChatToPlayer(ChatMessageComponent.func_111066_d("FluidHandler> Side:" + ForgeDirection.getOrientation(side).toString() + " Tanks:" + tanks.length));
for (FluidStack stack : FluidHelper.getFluidList(tanks)) for (FluidStack stack : FluidHelper.getFluidList(tanks))
{ {
player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Fluid>" + stack.amount + "mb of " + stack.getFluid().getName())); player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Fluid>" + stack.amount + "mb of " + stack.getFluid().getName()));