Changed Creative Tab and Cleaned up inports

This commit is contained in:
DarkGuardsman 2013-07-19 09:58:20 -04:00
parent 4404f4feab
commit 2121a01e5a
17 changed files with 39 additions and 78 deletions

View file

@ -1,6 +1,5 @@
package dark.fluid.client.render;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;

View file

@ -6,11 +6,11 @@ import java.util.logging.Logger;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.oredict.OreDictionary;
@ -36,7 +36,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import dark.core.api.ColorCode;
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.fluid.common.item.ItemParts;
import dark.fluid.common.item.ItemParts.Parts;
import dark.fluid.common.item.ItemTools;
@ -146,7 +145,7 @@ public class FluidMech extends DummyModContainer
/* UPDATE NOTIFIER */
Modstats.instance().getReporter().registerMod(this);
MinecraftForge.EVENT_BUS.register(new FluidRestrictionHandler());
/* CONFIGS */
CONFIGURATION.load();
@ -246,8 +245,6 @@ public class FluidMech extends DummyModContainer
/* LOGGER */
FMLog.info("Finalizing...");
proxy.postInit();
/* TAB ITEM SET */
TabFluidMech.setItemStack(new ItemStack(blockPipe, 1, 4));
/* /******** RECIPES ************* */
@ -328,4 +325,13 @@ public class FluidMech extends DummyModContainer
FMLog.info("Done Loading");
}
public static final CreativeTabs TabFluidMech = new CreativeTabs("Fluid Mechanics")
{
public ItemStack getIconItemStack()
{
return new ItemStack(blockPipe, 1, 4);
}
};
}

View file

@ -1,35 +0,0 @@
package dark.fluid.common;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class TabFluidMech extends CreativeTabs
{
public static final TabFluidMech INSTANCE = new TabFluidMech();
private static ItemStack itemStack;
public TabFluidMech()
{
super(CreativeTabs.getNextID(), "FluidMechanics");
}
public static void setItemStack(ItemStack newItemStack)
{
if (itemStack == null)
{
itemStack = newItemStack;
}
}
@Override
public ItemStack getIconItemStack()
{
if (itemStack == null)
{
return new ItemStack(Block.blocksList[this.getTabIconItemIndex()]);
}
return itemStack;
}
}

View file

@ -10,7 +10,6 @@ import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
public class ItemBasic extends Item
{
@ -20,7 +19,7 @@ public class ItemBasic extends Item
{
super(id);
this.setUnlocalizedName(name);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
}
@SideOnly(Side.CLIENT)

View file

@ -2,9 +2,10 @@ package dark.fluid.common.item;
import java.util.List;
import dark.fluid.common.FluidMech;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import dark.fluid.common.TabFluidMech;
/** A metadata item containing parts of various machines in Liquid Mechanics Mod.
*
@ -36,7 +37,7 @@ public class ItemParts extends ItemBasic
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setMaxStackSize(64);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
}
@Override

View file

@ -11,7 +11,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import dark.core.api.IToolReadOut;
import dark.core.api.IToolReadOut.EnumTools;
import dark.fluid.common.TabFluidMech;
import dark.fluid.common.FluidMech;
public class ItemTools extends ItemBasic
{
@ -22,7 +22,7 @@ public class ItemTools extends ItemBasic
super("lmTool", id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setMaxStackSize(1);
}

View file

@ -9,7 +9,6 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.library.machine.BlockMachine;
public class BlockReleaseValve extends BlockMachine
@ -17,7 +16,7 @@ public class BlockReleaseValve extends BlockMachine
public BlockReleaseValve(int par1)
{
super(par1, Material.iron);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("eValve");
this.setHardness(1f);
this.setResistance(5f);

View file

@ -10,7 +10,7 @@ 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.TabFluidMech;
import dark.fluid.common.FluidMech;
import dark.helpers.MetaGroup;
import dark.library.machine.BlockMachine;
@ -20,7 +20,7 @@ public class BlockSink extends BlockMachine
{
super(par1, Material.iron);
this.setUnlocalizedName("lmSink");
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setResistance(4f);
this.setHardness(4f);
}

View file

@ -17,7 +17,7 @@ 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.TabFluidMech;
import dark.fluid.common.FluidMech;
import dark.library.machine.AutoCraftingManager;
import dark.library.machine.BlockMachine;
@ -27,7 +27,7 @@ public class BlockTank extends BlockMachine
public BlockTank(int id)
{
super(id, Material.rock);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("lmTank");
this.setHardness(1f);
this.setResistance(5f);

View file

@ -53,12 +53,7 @@ public class TileEntityTank extends TileEntityFluidStorage implements IFluidHand
/* NETWORK INSTANCE THAT THIS PIPE USES */
private NetworkFluidContainers fluidNetwork;
@Override
public void initiate()
{
this.refresh();
}
private int refreshRate = 1;
@Override
public void updateEntity()
@ -66,13 +61,20 @@ public class TileEntityTank extends TileEntityFluidStorage implements IFluidHand
super.updateEntity();
if (!worldObj.isRemote)
{
if (ticks % ((int) random.nextInt(5) * 40 + 20) == 0)
if (ticks % refreshRate == 0)
{
this.refreshRate = ((int) random.nextInt(5) * 40) + 20;
this.refresh();
}
}
}
@Override
public void initiate()
{
this.refresh();
}
@Override
public void invalidate()
{

View file

@ -14,7 +14,6 @@ import net.minecraftforge.fluids.IFluidTank;
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
import dark.fluid.api.INetworkPipe;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.library.machine.BlockMachine;
public class BlockPipe extends BlockMachine
@ -24,7 +23,7 @@ public class BlockPipe extends BlockMachine
super(id, Material.iron);
this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F);
this.setHardness(1f);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("lmPipe");
this.setResistance(3f);

View file

@ -77,7 +77,7 @@ public abstract class TileEntityFluidStorage extends TileEntityFluidDevice imple
{
if (this.tank != null)
{
return new FluidTankInfo[] { new FluidTankInfo(this.tank.getFluid(), this.tank.getCapacity()) };
return new FluidTankInfo[] { new FluidTankInfo(this.tank) };
}
return new FluidTankInfo[1];
}
@ -118,11 +118,7 @@ public abstract class TileEntityFluidStorage extends TileEntityFluidDevice imple
/** Is the internal tank full */
public boolean isFull()
{
if (this.tank.getFluid() == null || this.tank.getFluid().amount < this.tank.getCapacity())
{
return false;
}
return true;
return this.tank.getFluid() != null && this.tank.getFluid().amount >= this.tank.getCapacity();
}
/** gets the liquidStack stored in the internal tank */

View file

@ -18,7 +18,6 @@ import net.minecraftforge.common.ForgeDirection;
import dark.core.network.fluid.HydraulicNetworkHelper;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.library.machine.BlockMachine;
public class BlockConstructionPump extends BlockMachine
@ -30,7 +29,7 @@ public class BlockConstructionPump extends BlockMachine
{
super(id, Material.iron);
this.setUnlocalizedName("lmConPump");
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setHardness(1f);
this.setResistance(5f);

View file

@ -13,7 +13,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.library.machine.BlockMachine;
public class BlockDrain extends BlockMachine
@ -25,7 +24,7 @@ public class BlockDrain extends BlockMachine
public BlockDrain(int id)
{
super(id, Material.iron);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("lmDrain");
}

View file

@ -13,7 +13,6 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.helpers.MetaGroup;
import dark.library.machine.BlockMachine;
@ -24,7 +23,7 @@ public class BlockPumpMachine extends BlockMachine
{
super(id, Material.iron);
this.setUnlocalizedName("lmMachines");
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setHardness(1f);
this.setResistance(5f);
}

View file

@ -11,7 +11,6 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.library.machine.BlockMachine;
public class BlockGenerator extends BlockMachine
@ -21,7 +20,7 @@ public class BlockGenerator extends BlockMachine
{
super(id, Material.iron);
this.setUnlocalizedName("lmGen");
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setHardness(1f);
this.setResistance(5f);
}

View file

@ -10,7 +10,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import dark.fluid.client.render.BlockRenderHelper;
import dark.fluid.common.FluidMech;
import dark.fluid.common.TabFluidMech;
import dark.library.machine.BlockMachine;
public class BlockRod extends BlockMachine
@ -19,7 +18,7 @@ public class BlockRod extends BlockMachine
public BlockRod(int par1)
{
super(par1, Material.iron);
this.setCreativeTab(TabFluidMech.INSTANCE);
this.setCreativeTab(FluidMech.TabFluidMech);
this.setUnlocalizedName("MechanicRod");
this.setHardness(1f);
this.setResistance(5f);