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.
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -77,6 +77,8 @@ public class FluidMech extends DummyModContainer
|
|||
public static final String ITEM_TEXTURE_FILE = RESOURCE_PATH + "items.png";
|
||||
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" };
|
||||
|
||||
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir() + "/UniversalElectricity/", NAME + ".cfg"));
|
||||
|
|
55
src/minecraft/fluidmech/common/item/ItemBasic.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -21,14 +21,8 @@ public class ItemLiquidMachine extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack par1ItemStack)
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
|
||||
return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,66 +2,45 @@ 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;
|
||||
|
||||
/** 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 */
|
||||
public class ItemParts extends Item
|
||||
* @author Rs
|
||||
*/
|
||||
public class ItemParts extends ItemBasic
|
||||
{
|
||||
public enum Parts
|
||||
{
|
||||
Bronze("Bronze", 0),
|
||||
Iron("Iron", 1),
|
||||
Obby("Obby", 2),
|
||||
Nether("Nether", 3),
|
||||
Seal("Seal", 16),
|
||||
SlimeSeal("Slime", 17),
|
||||
Tank("Tank", 18),
|
||||
Valve("Valve", 19);
|
||||
Bronze("BronzeTube"), Iron("IronTube"), Obby("ObbyTube"), Nether("NetherTube"), Seal("LeatherSeal"), SlimeSeal("SlimeSeal"), Tank("UnfinishedTank"), Valve("ValvePart");
|
||||
|
||||
public String name;
|
||||
public int itemIndex;
|
||||
|
||||
private Parts(String name, int itemIndex)
|
||||
private Parts(String name)
|
||||
{
|
||||
this.name = name;
|
||||
this.itemIndex = itemIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemParts(int par1)
|
||||
{
|
||||
super(par1);
|
||||
super("lmPart", par1);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
this.setItemName("lmPart");
|
||||
this.setCreativeTab(TabFluidMech.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconFromDamage(int par1)
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
if (par1 < Parts.values().length) { return Parts.values()[par1].itemIndex; }
|
||||
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;
|
||||
return "item." + Parts.values()[itemStack.getItemDamage()].name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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;
|
||||
|
@ -21,14 +22,8 @@ public class ItemPipe extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack par1ItemStack)
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
|
||||
return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,14 +21,8 @@ public class ItemReleaseValve extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack par1ItemStack)
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
|
||||
return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,14 +21,8 @@ public class ItemTank extends ItemBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getItemNameIS(ItemStack par1ItemStack)
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + "." + (par1ItemStack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemName()
|
||||
{
|
||||
return Block.blocksList[this.getBlockID()].getBlockName() + ".0";
|
||||
return "tile." + Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
|
|||
int f = getFillTarget().fill(back, this.color.getLiquidData().getStack(), true);
|
||||
if (f > 0)
|
||||
{
|
||||
worldObj.setBlockWithNotify(xCoord, yCoord - 1, zCoord, 0);
|
||||
worldObj.setBlockAndMetadataWithNotify(xCoord, yCoord - 1, zCoord, 0, 0, 3);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 7.7 KiB |
|
@ -9,6 +9,7 @@ import java.util.List;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
|
@ -42,10 +43,8 @@ public class HydraulicNetworkManager
|
|||
/**
|
||||
* Merges two connection lines together into one.
|
||||
*
|
||||
* @param networkA
|
||||
* - The network to be merged into. This network will be kept.
|
||||
* @param networkB
|
||||
* - The network to be merged. This network will be deleted.
|
||||
* @param networkA - The network to be merged into. This network will be kept.
|
||||
* @param networkB - The network to be merged. This network will be deleted.
|
||||
*/
|
||||
public void mergeConnection(HydraulicNetwork networkA, HydraulicNetwork networkB)
|
||||
{
|
||||
|
@ -68,14 +67,11 @@ public class HydraulicNetworkManager
|
|||
}
|
||||
|
||||
/**
|
||||
* Separate one connection line into two different ones between two
|
||||
* conductors. This function does this by resetting all wires in the
|
||||
* connection line and making them each reconnect.
|
||||
* Separate one connection line into two different ones between two conductors. This function
|
||||
* does this by resetting all wires in the connection line and making them each reconnect.
|
||||
*
|
||||
* @param conductorA
|
||||
* - existing conductor
|
||||
* @param conductorB
|
||||
* - broken/invalid conductor
|
||||
* @param conductorA - existing conductor
|
||||
* @param conductorB - broken/invalid conductor
|
||||
*/
|
||||
public void splitConnection(IFluidPipe conductorA, IFluidPipe conductorB)
|
||||
{
|
||||
|
@ -96,7 +92,7 @@ public class HydraulicNetworkManager
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
BIN
src/mods/fluidmechanics/textures/items/BronzeTube.png
Normal file
After Width: | Height: | Size: 340 B |
BIN
src/mods/fluidmechanics/textures/items/GuardKit.png
Normal file
After Width: | Height: | Size: 430 B |
BIN
src/mods/fluidmechanics/textures/items/IronTube.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
src/mods/fluidmechanics/textures/items/LeatherSeal.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
src/mods/fluidmechanics/textures/items/NetherTube.png
Normal file
After Width: | Height: | Size: 363 B |
BIN
src/mods/fluidmechanics/textures/items/ObbyTube.png
Normal file
After Width: | Height: | Size: 344 B |
BIN
src/mods/fluidmechanics/textures/items/PipeGuage.png
Normal file
After Width: | Height: | Size: 349 B |
BIN
src/mods/fluidmechanics/textures/items/SlimeSeal.png
Normal file
After Width: | Height: | Size: 271 B |
BIN
src/mods/fluidmechanics/textures/items/UnfinishedTank.png
Normal file
After Width: | Height: | Size: 281 B |
BIN
src/mods/fluidmechanics/textures/items/ValvePart.png
Normal file
After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 771 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 942 B After Width: | Height: | Size: 942 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 770 B After Width: | Height: | Size: 770 B |
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 974 B |
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 990 B |
Before Width: | Height: | Size: 967 B After Width: | Height: | Size: 967 B |
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 974 B |
Before Width: | Height: | Size: 1,003 B After Width: | Height: | Size: 1,003 B |
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
Before Width: | Height: | Size: 975 B After Width: | Height: | Size: 975 B |
Before Width: | Height: | Size: 1,003 B After Width: | Height: | Size: 1,003 B |
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 740 B |
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 762 B |
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 810 B |