killed all the errors

This doesn't mean done as i'm sure there are bugs to smash plus i still
need to implement the new network system as well fix the pump.
This commit is contained in:
Rseifert 2013-03-14 06:28:19 -04:00
parent feceea5b7b
commit 74a7cce60e
72 changed files with 265 additions and 355 deletions

View file

@ -1,99 +0,0 @@
package fluidmech.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerRepair;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiReleaseValve extends GuiContainer
{
private ContainerRepair field_82327_o;
private InventoryPlayer field_82325_q;
public GuiReleaseValve(InventoryPlayer par1, World par2World, int par3, int par4, int par5)
{
super(new ContainerRepair(par1, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer));
this.field_82325_q = par1;
this.field_82327_o = (ContainerRepair)this.inventorySlots;
}
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
super.initGui();
Keyboard.enableRepeatEvents(true);
int width = (this.width - this.xSize) / 2;
int height = (this.height - this.ySize) / 2;
}
/**
* Called when the screen is unloaded. Used to disable keyboard repeat events
*/
public void onGuiClosed()
{
super.onGuiClosed();
Keyboard.enableRepeatEvents(false);
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
GL11.glDisable(GL11.GL_LIGHTING);
this.fontRenderer.drawString("Release Valve", 60, 6, 4210752);
GL11.glEnable(GL11.GL_LIGHTING);
}
/**
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
*/
protected void keyTyped(char par1, int par2)
{
super.keyTyped(par1, par2);
}
/**
* Called when the mouse is clicked.
*/
protected void mouseClicked(int par1, int par2, int par3)
{
super.mouseClicked(par1, par2, par3);
}
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
super.drawScreen(par1, par2, par3);
GL11.glDisable(GL11.GL_LIGHTING);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int tID = this.mc.renderEngine.getTexture("/gui/repair.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(tID);
int width = (this.width - this.xSize) / 2;
int height = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(width, height, 0, 0, this.xSize, this.ySize);
}
}

View file

@ -77,6 +77,8 @@ public class FluidMech extends DummyModContainer
public static final String ITEM_TEXTURE_FILE = RESOURCE_PATH + "items.png"; public static final String ITEM_TEXTURE_FILE = RESOURCE_PATH + "items.png";
public static final String LANGUAGE_PATH = RESOURCE_PATH + "lang/"; public static final String LANGUAGE_PATH = RESOURCE_PATH + "lang/";
public static final String TEXTURE_NAME_PREFIX = "fluidmechanics:";
private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" }; private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" };
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir() + "/UniversalElectricity/", NAME + ".cfg")); public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir() + "/UniversalElectricity/", NAME + ".cfg"));

View file

@ -0,0 +1,55 @@
package fluidmech.common.item;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import universalelectricity.components.common.BasicComponents;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fluidmech.common.FluidMech;
public class ItemBasic extends Item
{
protected List<Icon> icons = new ArrayList<Icon>();
public ItemBasic(String name, int id)
{
super(id);
this.setUnlocalizedName(name);
this.setCreativeTab(BasicComponents.TAB);
}
@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister iconRegister)
{
List<ItemStack> list = new ArrayList<ItemStack>();
this.getSubItems(this.itemID, this.getCreativeTab(), list);
if (list.size() > 0)
{
for (ItemStack itemStack : list)
{
this.icons.add(iconRegister.func_94245_a(this.getUnlocalizedName(itemStack).replace("item.", FluidMech.TEXTURE_NAME_PREFIX)));
}
}
else
{
this.iconIndex = iconRegister.func_94245_a(this.getUnlocalizedName().replace("item.", FluidMech.TEXTURE_NAME_PREFIX));
}
}
@Override
public Icon getIconFromDamage(int damage)
{
if (this.icons.size() > damage)
{
return icons.get(damage);
}
return super.getIconFromDamage(damage);
}
}

View file

@ -21,14 +21,8 @@ public class ItemLiquidMachine extends ItemBlock
} }
@Override @Override
public String getItemNameIS(ItemStack par1ItemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage()); return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
}
@Override
public String getItemName()
{
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
} }
} }

View file

@ -2,66 +2,45 @@ package fluidmech.common.item;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import fluidmech.common.FluidMech; import fluidmech.common.FluidMech;
import fluidmech.common.TabFluidMech; import fluidmech.common.TabFluidMech;
/** A metadata item containing parts of various machines in Liquid Mechanics Mod. /**
* A metadata item containing parts of various machines in Liquid Mechanics Mod.
* *
* @author Rs */ * @author Rs
public class ItemParts extends Item */
public class ItemParts extends ItemBasic
{ {
public enum Parts public enum Parts
{ {
Bronze("Bronze", 0), Bronze("BronzeTube"), Iron("IronTube"), Obby("ObbyTube"), Nether("NetherTube"), Seal("LeatherSeal"), SlimeSeal("SlimeSeal"), Tank("UnfinishedTank"), Valve("ValvePart");
Iron("Iron", 1),
Obby("Obby", 2),
Nether("Nether", 3),
Seal("Seal", 16),
SlimeSeal("Slime", 17),
Tank("Tank", 18),
Valve("Valve", 19);
public String name; public String name;
public int itemIndex;
private Parts(String name, int itemIndex) private Parts(String name)
{ {
this.name = name; this.name = name;
this.itemIndex = itemIndex;
} }
} }
public ItemParts(int par1) public ItemParts(int par1)
{ {
super(par1); super("lmPart", par1);
this.setHasSubtypes(true); this.setHasSubtypes(true);
this.setMaxDamage(0); this.setMaxDamage(0);
this.setMaxStackSize(64); this.setMaxStackSize(64);
this.setItemName("lmPart");
this.setCreativeTab(TabFluidMech.INSTANCE); this.setCreativeTab(TabFluidMech.INSTANCE);
} }
@Override @Override
public int getIconFromDamage(int par1) public String getUnlocalizedName(ItemStack itemStack)
{ {
if (par1 < Parts.values().length) { return Parts.values()[par1].itemIndex; } return "item." + Parts.values()[itemStack.getItemDamage()].name;
return par1;
}
@Override
public String getTextureFile()
{
return FluidMech.ITEM_TEXTURE_FILE;
}
@Override
public String getItemNameIS(ItemStack i)
{
int j = i.getItemDamage();
return i.getItem().getItemName() + "." + j;
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package fluidmech.common.item; package fluidmech.common.item;
import fluidmech.common.item.ItemParts.Parts;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -21,14 +22,8 @@ public class ItemPipe extends ItemBlock
} }
@Override @Override
public String getItemNameIS(ItemStack par1ItemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage()); return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
}
@Override
public String getItemName()
{
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
} }
} }

View file

@ -21,14 +21,8 @@ public class ItemReleaseValve extends ItemBlock
} }
@Override @Override
public String getItemNameIS(ItemStack par1ItemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage()); return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
}
@Override
public String getItemName()
{
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
} }
} }

View file

@ -21,14 +21,8 @@ public class ItemTank extends ItemBlock
} }
@Override @Override
public String getItemNameIS(ItemStack par1ItemStack) public String getUnlocalizedName(ItemStack itemStack)
{ {
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage()); return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
}
@Override
public String getItemName()
{
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
} }
} }

View file

@ -197,7 +197,7 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
int f = getFillTarget().fill(back, this.color.getLiquidData().getStack(), true); int f = getFillTarget().fill(back, this.color.getLiquidData().getStack(), true);
if (f > 0) if (f > 0)
{ {
worldObj.setBlockWithNotify(xCoord, yCoord - 1, zCoord, 0); worldObj.setBlockAndMetadataWithNotify(xCoord, yCoord - 1, zCoord, 0, 0, 3);
return true; return true;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View file

@ -9,6 +9,7 @@ import java.util.List;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.Vector3;
import universalelectricity.core.vector.VectorHelper;
import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.FMLLog;
/** /**
@ -42,10 +43,8 @@ public class HydraulicNetworkManager
/** /**
* Merges two connection lines together into one. * Merges two connection lines together into one.
* *
* @param networkA * @param networkA - The network to be merged into. This network will be kept.
* - The network to be merged into. This network will be kept. * @param networkB - The network to be merged. This network will be deleted.
* @param networkB
* - The network to be merged. This network will be deleted.
*/ */
public void mergeConnection(HydraulicNetwork networkA, HydraulicNetwork networkB) public void mergeConnection(HydraulicNetwork networkA, HydraulicNetwork networkB)
{ {
@ -68,14 +67,11 @@ public class HydraulicNetworkManager
} }
/** /**
* Separate one connection line into two different ones between two * Separate one connection line into two different ones between two conductors. This function
* conductors. This function does this by resetting all wires in the * does this by resetting all wires in the connection line and making them each reconnect.
* connection line and making them each reconnect.
* *
* @param conductorA * @param conductorA - existing conductor
* - existing conductor * @param conductorB - broken/invalid conductor
* @param conductorB
* - broken/invalid conductor
*/ */
public void splitConnection(IFluidPipe conductorA, IFluidPipe conductorB) public void splitConnection(IFluidPipe conductorA, IFluidPipe conductorB)
{ {
@ -96,7 +92,7 @@ public class HydraulicNetworkManager
for (byte i = 0; i < 6; i++) for (byte i = 0; i < 6; i++)
{ {
conductor.updateConnectionWithoutSplit(Vector3.getConnectorFromSide(((TileEntity) conductor).worldObj, new Vector3((TileEntity) conductor), ForgeDirection.getOrientation(i)), ForgeDirection.getOrientation(i)); conductor.updateConnectionWithoutSplit(VectorHelper.getConnectorFromSide(((TileEntity) conductor).worldObj, new Vector3((TileEntity) conductor), ForgeDirection.getOrientation(i)), ForgeDirection.getOrientation(i));
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 771 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

View file

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

View file

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 942 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 491 B

View file

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 742 B

View file

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 742 B

View file

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 742 B

View file

Before

Width:  |  Height:  |  Size: 770 B

After

Width:  |  Height:  |  Size: 770 B

View file

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 974 B

View file

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

View file

Before

Width:  |  Height:  |  Size: 967 B

After

Width:  |  Height:  |  Size: 967 B

View file

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 974 B

View file

Before

Width:  |  Height:  |  Size: 1,003 B

After

Width:  |  Height:  |  Size: 1,003 B

View file

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

View file

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 975 B

View file

Before

Width:  |  Height:  |  Size: 1,003 B

After

Width:  |  Height:  |  Size: 1,003 B

View file

Before

Width:  |  Height:  |  Size: 740 B

After

Width:  |  Height:  |  Size: 740 B

View file

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 762 B

View file

Before

Width:  |  Height:  |  Size: 810 B

After

Width:  |  Height:  |  Size: 810 B