diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:52:45 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:52:45 +0300 |
| commit | 0427ab89f1753a44b30cbc35ce021cbbdc845109 (patch) | |
| tree | abe418ff5ec174e712fe8dedd434548a945b15a3 /src/main/java/ihl/items_blocks | |
| parent | 877312184c472d9845e5ef1008bc538f4634059f (diff) | |
fix missing source folder
Diffstat (limited to 'src/main/java/ihl/items_blocks')
| -rw-r--r-- | src/main/java/ihl/items_blocks/FiberItem.java | 109 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/FlexibleCableItem.java | 434 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/FlexiblePipeItem.java | 107 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/IHLBucketHandler.java | 20 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/IHLFluidBlock.java | 120 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/IHLItemBlock.java | 219 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/IHLTool.java | 444 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/ItemSubstance.java | 413 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/MachineBaseBlock.java | 662 | ||||
| -rw-r--r-- | src/main/java/ihl/items_blocks/RecipeInputs.java | 25 |
10 files changed, 2553 insertions, 0 deletions
diff --git a/src/main/java/ihl/items_blocks/FiberItem.java b/src/main/java/ihl/items_blocks/FiberItem.java new file mode 100644 index 0000000..79e50f9 --- /dev/null +++ b/src/main/java/ihl/items_blocks/FiberItem.java @@ -0,0 +1,109 @@ +package ihl.items_blocks;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ihl.IHLCreativeTab;
+import ihl.IHLModInfo;
+import ihl.interfaces.IWire;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+public class FiberItem extends Item implements IWire {
+
+ protected String info;
+ protected FiberMaterial material;
+ private String registryName;
+
+ public FiberItem(FiberMaterial material1, int leadsNum1, String registryName1)
+ {
+ super();
+ this.registryName=registryName1;
+ this.material=material1;
+ this.info=material.description;
+ this.setCreativeTab(IHLCreativeTab.tab);
+ this.setMaxStackSize(1);
+ this.setUnlocalizedName(registryName);
+ }
+
+ public FiberItem()
+ {
+ super();
+ }
+
+ public static void init()
+ {
+ FiberMaterial[] var1 = FiberMaterial.values();
+ for(int i=0;i<var1.length;i++)
+ {
+ String registryName = "fiber"+var1[i].description;
+ GameRegistry.registerItem(new FiberItem(var1[i],1,registryName),registryName);
+ }
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList)
+ {
+ ItemStack stack = new ItemStack(item);
+ stack.stackTagCompound=new NBTTagCompound();
+ stack.stackTagCompound.setInteger("fullLength", 1024);
+ stack.stackTagCompound.setInteger("length", 1024);
+ itemList.add(stack);
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
+ {
+ if(itemStack.stackTagCompound!=null)
+ {
+ info.add("Length " + itemStack.stackTagCompound.getInteger("length") +"m");
+ }
+ info.add(this.info);
+ }
+
+ @Override
+ public String getTag()
+ {
+ return "length";
+ }
+
+ @Override
+ public String getTagSecondary()
+ {
+ return "fullLength";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister)
+ {
+ this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":"+this.registryName);
+ }
+
+ public static enum FiberMaterial
+ {
+ Glass("Glass");
+ FiberMaterial(String description1)
+ {
+ description=description1;
+ }
+ public String description;
+ }
+
+
+ @Override
+ public boolean isSameWire(ItemStack stack1,ItemStack stack2)
+ {
+ return stack1.getItem()==stack2.getItem();
+ }
+
+}
diff --git a/src/main/java/ihl/items_blocks/FlexibleCableItem.java b/src/main/java/ihl/items_blocks/FlexibleCableItem.java new file mode 100644 index 0000000..d5d8eda --- /dev/null +++ b/src/main/java/ihl/items_blocks/FlexibleCableItem.java @@ -0,0 +1,434 @@ +package ihl.items_blocks;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ic2.api.energy.tile.IEnergyTile;
+import ihl.IHLCreativeTab;
+import ihl.IHLMod;
+import ihl.IHLModInfo;
+import ihl.flexible_cable.AnchorTileEntity;
+import ihl.flexible_cable.NodeEntity;
+import ihl.flexible_cable.PowerCableNodeEntity;
+import ihl.interfaces.ICableHolder;
+import ihl.interfaces.IEnergyNetNode;
+import ihl.interfaces.IMultiPowerCableHolder;
+import ihl.interfaces.IWire;
+import ihl.utils.IHLUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class FlexibleCableItem extends Item implements IWire {
+
+ public static FlexibleCableItem instance;
+ public final Set<String> yellowColoredWires = new HashSet<String>(3);
+
+ public FlexibleCableItem() {
+ super();
+ yellowColoredWires.add("Gold");
+ yellowColoredWires.add("Copper");
+ yellowColoredWires.add("Bronze");
+ this.setCreativeTab(IHLCreativeTab.tab);
+ this.setMaxStackSize(1);
+ this.setFull3D();
+ instance = this;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList) {
+ itemList.add(IHLUtils.getUninsulatedWire("Copper", 160, 15));
+ itemList.add(IHLUtils.getUninsulatedWire("Copper", 160, 240));
+ itemList.add(IHLUtils.getUninsulatedWire("Steel", 160, 15));
+ itemList.add(IHLUtils.getUninsulatedWire("Steel", 160, 240));
+ itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 15, "RawRubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 240, "RawRubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 15, "RawRubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 240, "RawRubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 15, "Rubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Copper", 160, 240, "Rubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 15, "Rubber", 100));
+ itemList.add(IHLUtils.getInsulatedWire("Steel", 160, 240, "Rubber", 100));
+ }
+
+ public static void init() {
+ GameRegistry.registerItem(new FlexibleCableItem(), "copperWire");
+ }
+
+ @Override
+ public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7,
+ float par8, float par9, float par10) {
+ TileEntity t = world.getTileEntity(x, y, z);
+ short facing = IHLUtils.getFacingFromPlayerView(player, true);
+ if (!world.isRemote && t instanceof IEnergyTile && !(t instanceof IMultiPowerCableHolder)
+ && !(t instanceof ICableHolder)) {
+ ForgeDirection direction = ForgeDirection.getOrientation(facing);
+ x += direction.offsetX;
+ y += direction.offsetY;
+ z += direction.offsetZ;
+ t = world.getTileEntity(x, y, z);
+ if (IHLUtils.isBlockCanBeReplaced(world, x, y, z)) {
+ world.setBlock(x, y, z, IHLMod.cableAnchorBlock);
+ } else if (!(t instanceof AnchorTileEntity)) {
+ return false;
+ }
+ t = world.getTileEntity(x, y, z);
+ }
+ if (world.isRemote)
+ world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, "step.stone", 1.0F, 0.8F);
+ if (!world.isRemote && t != null
+ && ((t instanceof IEnergyNetNode)
+ || (t instanceof IMultiPowerCableHolder))
+ && stack.stackTagCompound.getInteger("fullLength") >= 1) {
+ double ppx, ppy, ppz;
+ ICableHolder te;
+ if (t instanceof IMultiPowerCableHolder) {
+ facing = ((IMultiPowerCableHolder) t).getSide(player);
+ if (facing == -1) {
+ return false;
+ } else {
+ te = ((IMultiPowerCableHolder) t).getEnergyNetNode(facing);
+ }
+ } else {
+ te = (ICableHolder) t;
+ }
+ ppx = te.getPortPos(player)[0];
+ ppy = te.getPortPos(player)[1];
+ ppz = te.getPortPos(player)[2];
+ if (stack.stackTagCompound.getBoolean("firstConnection")) {
+ int x1 = stack.stackTagCompound.getInteger("connectorX");
+ int y1 = stack.stackTagCompound.getInteger("connectorY");
+ int z1 = stack.stackTagCompound.getInteger("connectorZ");
+ int l1 = stack.stackTagCompound.getInteger("fullLength");
+ int l2 = stack.stackTagCompound.getInteger("length");
+ if (x == x1 && y == y1 && z == z1) {
+ this.cleanUp(stack.stackTagCompound.getInteger("chainUID"));
+ stack.stackTagCompound.setBoolean("firstConnection", false);
+ stack.stackTagCompound.setInteger("length", l1);
+ return true;
+ }
+ int t2DimensionId = stack.stackTagCompound.getInteger("connectorDimensionId");
+ short facing2 = stack.stackTagCompound.getShort("connectorFacing");
+ TileEntity t2 = MinecraftServer.getServer().worldServerForDimension(t2DimensionId).getTileEntity(x1, y1,
+ z1);
+ if (t2 == null) {
+ stack.stackTagCompound.setBoolean("firstConnection", false);
+ return false;
+ } else {
+ if (t instanceof IMultiPowerCableHolder) {
+ facing = ((IMultiPowerCableHolder) t).getSide(player);
+ if (facing == -1) {
+ return false;
+ } else {
+ te = ((IMultiPowerCableHolder) t).getEnergyNetNode(facing);
+ }
+ } else {
+ te = (ICableHolder) t;
+ }
+ te.setCableCheck(true);
+ }
+ this.connect(t, facing, t2, facing2, stack);
+ stack.stackTagCompound.setInteger("fullLength", l2);
+ if (l2 <= 0) {
+ stack.stackSize--;
+ }
+ stack.stackTagCompound.setBoolean("firstConnection", false);
+ stack.stackTagCompound.setInteger("chainArrangeNumber",
+ stack.stackTagCompound.getInteger("chainArrangeNumber") + 1);
+ x = x1;
+ y = y1;
+ z = z1;
+ } else {
+ te.setCableCheck(false);
+ stack.stackTagCompound.setBoolean("firstConnection", true);
+ stack.stackTagCompound.setInteger("connectorX", x);
+ stack.stackTagCompound.setInteger("connectorY", y);
+ stack.stackTagCompound.setInteger("connectorZ", z);
+ stack.stackTagCompound.setShort("connectorFacing", facing);
+ stack.stackTagCompound.setInteger("connectorDimensionId", world.provider.dimensionId);
+ stack.stackTagCompound.setInteger("prevDimensionId", world.provider.dimensionId);
+ stack.stackTagCompound.setInteger("chainArrangeNumber", 0);
+ stack.stackTagCompound.setInteger("chainUID", world.rand.nextInt());
+ stack.stackTagCompound.setDouble("prevNodePosX", ppx);
+ stack.stackTagCompound.setDouble("prevNodePosY", ppy);
+ stack.stackTagCompound.setDouble("prevNodePosZ", ppz);
+ stack.stackTagCompound.setInteger("length", stack.stackTagCompound.getInteger("length")-1);
+ }
+ NodeEntity node = newNode(world, player.posX, player.posY, player.posZ, stack,
+ stack.stackTagCompound.getInteger("chainArrangeNumber"), x, y, z);
+ node.virtualNodePosX = ppx;
+ node.virtualNodePosY = ppy;
+ node.virtualNodePosZ = ppz;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected void connect(TileEntity t1, short facing, TileEntity t2, short facing2, ItemStack stack) {
+ IEnergyNetNode te;
+ IEnergyNetNode te1;
+ if (t1 instanceof IEnergyNetNode) {
+ te = (IEnergyNetNode) t1;
+ } else {
+ te = ((IMultiPowerCableHolder) t1).getEnergyNetNode(facing);
+ }
+ if (t2 instanceof IEnergyNetNode) {
+ te1 = (IEnergyNetNode) t2;
+ } else {
+ te1 = ((IMultiPowerCableHolder) t2).getEnergyNetNode(facing2);
+ }
+ int newGridID = IHLMod.enet.mergeGrids(te.getGridID(), te1.getGridID());
+ int l1 = stack.stackTagCompound.getInteger("fullLength");
+ int l2 = stack.stackTagCompound.getInteger("length");
+ NBTTagCompound cable = (NBTTagCompound) stack.stackTagCompound.copy();
+ cable.setInteger("length", l1 - l2);
+ cable.setBoolean("firstConnection", false);
+ cable.setInteger("connectorX1", t1.xCoord);
+ cable.setInteger("connectorY1", t1.yCoord);
+ cable.setInteger("connectorZ1", t1.zCoord);
+ cable.setShort("connectorFacing1", facing);
+ cable.setInteger("connectorDimensionId1", t1.getWorldObj().provider.dimensionId);
+ te.addCable(cable);
+ te1.addCable(cable);
+ te.setGrid(newGridID);
+ te1.setGrid(newGridID);
+ }
+
+ private int getTransverseSection(ItemStack stack) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ return stack.stackTagCompound.getInteger("transverseSection");
+ }
+
+ public String getMaterial(ItemStack stack) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ return stack.stackTagCompound.getString("material");
+ }
+
+ public int getVoltageLimit(ItemStack stack) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ if (stack.stackTagCompound.hasKey("maxVoltage")) {
+ return stack.stackTagCompound.getInteger("maxVoltage");
+ }
+ return 0;
+ }
+
+ private long getResistance(ItemStack stack) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ return IHLUtils.getResistance(stack.stackTagCompound);
+ }
+
+ private void cleanUp(int uid) {
+ Set<NodeEntity> cs = IHLMod.proxy.nodeEntityRegistry.get(uid);
+ if (cs != null) {
+ for (NodeEntity ne : cs) {
+ if (ne != null) {
+ ne.setDead();
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem) {
+ if (!world.isRemote && stack.stackTagCompound != null) {
+ if (stack.stackTagCompound.getBoolean("firstConnection")) {
+ int leight = stack.stackTagCompound.getInteger("length");
+ if (leight > 0) {
+ double pnpx = stack.stackTagCompound.getDouble("prevNodePosX");
+ double pnpy = stack.stackTagCompound.getDouble("prevNodePosY");
+ double pnpz = stack.stackTagCompound.getDouble("prevNodePosZ");
+ double ppx = entity.posX;
+ double ppy = entity.posY;
+ double ppz = entity.posZ;
+
+ if (pnpx != 0D && pnpy != 0D && pnpz != 0D) {
+ double sqd = (ppx - pnpx) * (ppx - pnpx) + (ppy - pnpy) * (ppy - pnpy)
+ + (ppz - pnpz) * (ppz - pnpz);
+ if (sqd > 2D) {
+ int can = stack.stackTagCompound.getInteger("chainArrangeNumber") + 1;
+ int cx = stack.stackTagCompound.getInteger("connectorX");
+ int cy = stack.stackTagCompound.getInteger("connectorY");
+ int cz = stack.stackTagCompound.getInteger("connectorZ");
+ NodeEntity node = newNode(world, ppx, ppy, ppz, stack, can, cx, cy, cz);
+ node.shouldFollowPlayer = true;
+ node.virtualNodePosX = ppx + (ppx - pnpx) * 2;
+ node.virtualNodePosY = ppy + (ppy - pnpy) * 2;
+ node.virtualNodePosZ = ppz + (ppz - pnpz) * 2;
+ stack.stackTagCompound.setInteger("chainArrangeNumber", can);
+ stack.stackTagCompound.setDouble("prevNodePosX", ppx);
+ stack.stackTagCompound.setDouble("prevNodePosY", ppy);
+ stack.stackTagCompound.setDouble("prevNodePosZ", ppz);
+ stack.stackTagCompound.setInteger("length", --leight);
+ stack.stackTagCompound.setInteger("prevDimensionId", world.provider.dimensionId);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void onPlayerTeleport(PlayerChangedDimensionEvent event) {
+ EntityPlayer player = event.player;
+ for (ItemStack stack : player.inventory.mainInventory) {
+ if (stack != null && stack.getItem() instanceof FlexibleCableItem) {
+ if (stack.stackTagCompound.getBoolean("firstConnection")) {
+ int can = -1;
+ Set<NodeEntity> ns = IHLMod.proxy.nodeEntityRegistry
+ .get(stack.stackTagCompound.getInteger("chainUID"));
+ if (ns != null) {
+ NodeEntity lastNode = null;
+ for (NodeEntity node : ns) {
+ node.shouldFollowPlayer = false;
+ if (node.chainArrangeNumber > can) {
+ lastNode = node;
+ can = node.chainArrangeNumber;
+ }
+ }
+ if (lastNode != null) {
+ lastNode.setVirtualNodePosToNearestPortal();
+ }
+ }
+ double[] cc = IHLUtils.tracePlayerView(player);
+ can = stack.stackTagCompound.getInteger("chainArrangeNumber") + 1;
+ int cx = stack.stackTagCompound.getInteger("connectorX");
+ int cy = stack.stackTagCompound.getInteger("connectorY");
+ int cz = stack.stackTagCompound.getInteger("connectorZ");
+ int leight = stack.stackTagCompound.getInteger("length");
+ NodeEntity node = newNode(MinecraftServer.getServer().worldServerForDimension(event.toDim), cc[0],
+ player.posY, cc[2], stack, can, cx, cy, cz);
+ node.setVirtualNodePosToNearestPortal();
+ stack.stackTagCompound.setInteger("chainArrangeNumber", can);
+ stack.stackTagCompound.setDouble("prevNodePosX", cc[0]);
+ stack.stackTagCompound.setDouble("prevNodePosY", cc[1]);
+ stack.stackTagCompound.setDouble("prevNodePosZ", cc[2]);
+ stack.stackTagCompound.setInteger("length", --leight);
+ stack.stackTagCompound.setInteger("prevDimensionId", event.toDim);
+ }
+ }
+ }
+ }
+
+ protected NodeEntity newNode(World world, double ppx, double ppy, double ppz, ItemStack stack, int can, int x,
+ int y, int z) {
+ PowerCableNodeEntity node = new PowerCableNodeEntity(world);
+ node.setPosition(ppx, ppy, ppz);
+ node.setChainUniqueID(stack.stackTagCompound.getInteger("chainUID"));
+ short facing = stack.stackTagCompound.getShort("connectorFacing");
+ int dimensionId = stack.stackTagCompound.getInteger("connectorDimensionId");
+ node.setAnchor(x, y, z, facing, dimensionId);
+ node.chainArrangeNumber = can;
+ node.colorIndex = this.getColor(stack);
+ node.addCable((NBTTagCompound) stack.stackTagCompound.copy());
+ if (stack.stackTagCompound.hasKey("insulationMaterial")) {
+ node.type = 1;
+ } else {
+ node.type = 0;
+ }
+ world.spawnEntityInWorld(node);
+ return node;
+ }
+
+ private int getColor(ItemStack stack) {
+ if (!stack.stackTagCompound.hasKey("insulationMaterial")) {
+ if (yellowColoredWires.contains(this.getMaterial(stack))) {
+ return 0xFF9900;
+ } else {
+ return 0xAAAABB;
+ }
+ }
+ return 0xFFFFFF;
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) {
+ if (itemStack.stackTagCompound != null) {
+ info.add(StatCollector.translateToLocal("ihl.lenght")+": " + itemStack.stackTagCompound.getInteger("length") + " m");
+ info.add(StatCollector.translateToLocal("ihl.wire_material")+": " + this.getMaterial(itemStack));
+ info.add(StatCollector.translateToLocal("ihl.resistivity")+": " + this.getResistance(itemStack) / 1000F + " V^2/(EU*m)");
+ info.add(StatCollector.translateToLocal("ihl.transverse_section")+": " + this.getTransverseSection(itemStack) / 10F + " sq. mm.");
+ if (itemStack.stackTagCompound.hasKey("insulationMaterial")) {
+ info.add(StatCollector.translateToLocal("ihl.insulation_material")+": " + this.getInsulationMaterial(itemStack));
+ info.add(StatCollector.translateToLocal("ihl.insulation_thickness")+": " + this.getInsulationThickness(itemStack) / 10f + " mm");
+ info.add(StatCollector.translateToLocal("ihl.insulation_beakdown_voltage")+": " + this.getVoltageLimit(itemStack) / 1000 + " kV");
+ }
+ info.add(StatCollector.translateToLocal("ihl.powerCableTooltip"));
+ }
+ }
+
+ @Override
+ public String getTag() {
+ return "length";
+ }
+
+ @Override
+ public String getTagSecondary() {
+ return "fullLength";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":copperWire");
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ if (stack.stackTagCompound != null && !this.getInsulationMaterial(stack).equals("null")) {
+ return "cable";
+ }
+ return "wire";
+ }
+
+ @Override
+ public boolean isSameWire(ItemStack stack1, ItemStack stack2) {
+ if (stack1.getItem() == stack2.getItem() && stack1.getItemDamage() == stack2.getItemDamage()) {
+ if (stack1.stackTagCompound != null && stack2.stackTagCompound != null) {
+ return this.getMaterial(stack1).equals(this.getMaterial(stack2))
+ && this.getTransverseSection(stack1) == this.getTransverseSection(stack2)
+ && this.getInsulationMaterial(stack1).equals(this.getInsulationMaterial(stack2))
+ && this.getInsulationThickness(stack1) == this.getInsulationThickness(stack2);
+ }
+ }
+ return false;
+ }
+
+ public String getInsulationMaterial(ItemStack stack) {
+ if (stack.stackTagCompound.hasKey("insulationMaterial")) {
+ return stack.stackTagCompound.getString("insulationMaterial");
+ }
+ return "null";
+ }
+
+ public int getInsulationThickness(ItemStack stack) {
+ if (stack.stackTagCompound.hasKey("insulationThickness")) {
+ return stack.stackTagCompound.getInteger("insulationThickness");
+ }
+ return 0;
+ }
+}
diff --git a/src/main/java/ihl/items_blocks/FlexiblePipeItem.java b/src/main/java/ihl/items_blocks/FlexiblePipeItem.java new file mode 100644 index 0000000..f5bb3fd --- /dev/null +++ b/src/main/java/ihl/items_blocks/FlexiblePipeItem.java @@ -0,0 +1,107 @@ +package ihl.items_blocks;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ihl.IHLCreativeTab;
+import ihl.IHLModInfo;
+import ihl.utils.IHLUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.IIcon;
+
+public class FlexiblePipeItem extends Item {
+
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+
+ public FlexiblePipeItem()
+ {
+ super();
+ this.setCreativeTab(IHLCreativeTab.tab);
+ this.setMaxStackSize(1);
+ this.setUnlocalizedName("flexiblePipe");
+ }
+
+ public static void init()
+ {
+ FlexiblePipeItem item = new FlexiblePipeItem();
+ Type[] var1 = Type.values();
+ GameRegistry.registerItem(item,item.getUnlocalizedName());
+ for(int i=0;i<var1.length;i++)
+ {
+ nameMap.put(var1[i].damage,var1[i].unLocalizedName);
+ IHLUtils.registerLocally(var1[i].unLocalizedName, new ItemStack(item,1,var1[i].damage));
+ }
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList)
+ {
+ Type[] var1 = Type.values();
+ for(int i=0;i<var1.length;i++)
+ {
+ ItemStack stack = IHLUtils.getThisModItemStack(var1[i].unLocalizedName);
+ stack.stackTagCompound=new NBTTagCompound();
+ stack.stackTagCompound.setInteger("fullLength", 16);
+ stack.stackTagCompound.setInteger("length", 16);
+ itemList.add(stack);
+ }
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
+ {
+ if(itemStack.stackTagCompound!=null)
+ {
+ info.add("Length " + itemStack.stackTagCompound.getInteger("length") +"m");
+ }
+ }
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister register)
+ {
+ Type[] var1 = Type.values();
+ for(int i=0;i<var1.length;i++)
+ {
+ iconMap.put(var1[i].damage, register.registerIcon(IHLModInfo.MODID + ":"+var1[i].unLocalizedName));
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int i)
+ {
+ return iconMap.get(i);
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack)
+ {
+ return nameMap.get(stack.getItemDamage());
+ }
+
+ public static enum Type
+ {
+ VulcanizedRubber(1, "pipeVulcanizedRubber"),
+ RubberWithSulfurPipe(0, "pipeRubberWithSulfur");
+ Type(int damage1, String unLocalizedName1)
+ {
+ damage=damage1;
+ unLocalizedName=unLocalizedName1;
+ }
+ public int damage;
+ public String unLocalizedName;
+ }
+}
diff --git a/src/main/java/ihl/items_blocks/IHLBucketHandler.java b/src/main/java/ihl/items_blocks/IHLBucketHandler.java new file mode 100644 index 0000000..9f3a7b8 --- /dev/null +++ b/src/main/java/ihl/items_blocks/IHLBucketHandler.java @@ -0,0 +1,20 @@ +package ihl.items_blocks;
+
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import net.minecraft.block.Block;
+import net.minecraftforge.event.entity.player.FillBucketEvent;
+
+public class IHLBucketHandler
+{
+ public IHLBucketHandler() {}
+ @SubscribeEvent
+ public void onBucketFill(FillBucketEvent event)
+ {
+ Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ);
+ if (block instanceof IHLFluidBlock && event.isCancelable())
+ {
+ event.setCanceled(true);
+ }
+ }
+
+}
diff --git a/src/main/java/ihl/items_blocks/IHLFluidBlock.java b/src/main/java/ihl/items_blocks/IHLFluidBlock.java new file mode 100644 index 0000000..7ad7730 --- /dev/null +++ b/src/main/java/ihl/items_blocks/IHLFluidBlock.java @@ -0,0 +1,120 @@ +package ihl.items_blocks;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ihl.IHLModInfo;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.BlockFluidClassic;
+import net.minecraftforge.fluids.Fluid;
+
+public class IHLFluidBlock extends BlockFluidClassic {
+
+ private String textureName = "fluidRubberTreeSap";
+ @SideOnly(Side.CLIENT)
+ protected IIcon stillIcon;
+ @SideOnly(Side.CLIENT)
+ protected IIcon flowingIcon;
+ private boolean flammable;
+
+ public IHLFluidBlock(Fluid fluid, Material material, String textureName1, String registryName1) {
+ super(fluid, material);
+ textureName = textureName1;
+ GameRegistry.registerBlock(this, registryName1);
+ }
+
+ @Override
+ public int getLightValue(IBlockAccess world, int x, int y, int z)
+ {
+ return this.blockMaterial==Material.lava?15:0;
+ }
+
+ public IHLFluidBlock setFlammable(boolean flammable)
+ {
+ this.flammable = flammable;
+ return this;
+ }
+
+ @Override
+ public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
+ return flammable ? 300 : 0;
+ }
+
+ @Override
+ public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
+ return flammable ? 5 : 0;
+ }
+
+ @Override
+ public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
+ return flammable;
+ }
+
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return (side == 0 || side == 1)? stillIcon : flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister register) {
+ stillIcon = register.registerIcon(IHLModInfo.MODID + ":" + textureName + "Still");
+ flowingIcon = register.registerIcon(IHLModInfo.MODID + ":" + textureName + "Flowing");
+ }
+
+ @Override
+ public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.canDisplace(world, x, y, z);
+ }
+
+ @Override
+ public boolean displaceIfPossible(World world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.displaceIfPossible(world, x, y, z);
+ }
+
+ @Override
+ public int onBlockPlaced(World world, int x, int y, int z, int meta, float xF, float yF, float zF, int meta2)
+ {
+ int var = super.onBlockPlaced(world, x, y, z, meta, xF, yF, zF, meta2);
+ if(!world.isRemote && this.isAirCompound())
+ {
+ world.setBlockToAir(x, y, z);
+ }
+ return var;
+ }
+
+ @Override
+ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack)
+ {
+ super.onBlockPlacedBy(world, x, y, z, player, itemStack);
+ if(!world.isRemote && this.isAirCompound())
+ {
+ world.setBlockToAir(x, y, z);
+ }
+ }
+
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ super.onNeighborBlockChange(world, x, y, z, block);
+ if(!world.isRemote && this.isAirCompound())
+ {
+ world.setBlockToAir(x, y, z);
+ }
+ }
+
+ private boolean isAirCompound()
+ {
+ return this.fluidName.equals("air") || this.fluidName.equals("nitrogen") || this.fluidName.equals("oxygen");
+ }
+}
diff --git a/src/main/java/ihl/items_blocks/IHLItemBlock.java b/src/main/java/ihl/items_blocks/IHLItemBlock.java new file mode 100644 index 0000000..ff61070 --- /dev/null +++ b/src/main/java/ihl/items_blocks/IHLItemBlock.java @@ -0,0 +1,219 @@ +package ihl.items_blocks;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ic2.api.tile.IWrenchable;
+import ic2.core.IC2;
+import ihl.IHLCreativeTab;
+import ihl.IHLModInfo;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+
+public class IHLItemBlock extends ItemBlock {
+ public Map<Integer, String> nameMap = new HashMap<Integer, String>();
+
+ public IHLItemBlock(Block block1) {
+ super(block1);
+ this.setFull3D();
+ this.setHasSubtypes(true);
+ this.setCreativeTab(IHLCreativeTab.tab);
+ }
+
+ @Override
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, int x, int y, int z, int par7,
+ float par8, float par9, float par10) {
+ Block block = world.getBlock(x, y, z);
+
+ if (block == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) {
+ par7 = 1;
+ } else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush) {
+ if (par7 == 0) {
+ --y;
+ }
+
+ if (par7 == 1) {
+ ++y;
+ }
+
+ if (par7 == 2) {
+ --z;
+ }
+
+ if (par7 == 3) {
+ ++z;
+ }
+
+ if (par7 == 4) {
+ --x;
+ }
+
+ if (par7 == 5) {
+ ++x;
+ }
+ }
+
+ if (par1ItemStack.stackSize == 0) {
+ return false;
+ } else if (!player.canPlayerEdit(x, y, z, par7, par1ItemStack)) {
+ return false;
+ } else if (y == 255) {
+ return false;
+ } else if (world.canPlaceEntityOnSide(this.field_150939_a, x, y, z, false, par7, player, par1ItemStack)) {
+ int metadata = par1ItemStack.getItemDamage();
+ int var13 = this.field_150939_a.onBlockPlaced(world, x, y, z, par7, par8, par9, par10, metadata);
+
+ if (world.setBlock(x, y, z, this.field_150939_a, var13, 3)) {
+ if (world.getBlock(x, y, z) == this.field_150939_a) {
+ this.field_150939_a.onBlockPlacedBy(world, x, y, z, player, par1ItemStack);
+ this.field_150939_a.onPostBlockPlaced(world, x, y, z, var13);
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if (tile instanceof IWrenchable && IC2.platform.isSimulating()) {
+ IWrenchable te = (IWrenchable) tile;
+ int var6 = MathHelper.floor_double(player.rotationPitch * 4.0F / 360.0F + 0.5D) & 3;
+ int l = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ te.setFacing((short) 0);
+ boolean allDPlacing = te.getFacing()==0;
+ if (player.isSneaking()) {
+ if (var6 == 1 && allDPlacing) {
+ te.setFacing((short) 0);
+ } else if (var6 == 3 && allDPlacing) {
+ te.setFacing((short) 1);
+ } else {
+
+ switch (l) {
+ case 0:
+ te.setFacing((short) 3);
+ break;
+
+ case 1:
+ te.setFacing((short) 4);
+ break;
+
+ case 2:
+ te.setFacing((short) 2);
+ break;
+
+ case 3:
+ te.setFacing((short) 5);
+ }
+ }
+ } else {
+ if (var6 == 1 && allDPlacing) {
+ te.setFacing((short) 1);
+ } else if (var6 == 3 && allDPlacing) {
+ te.setFacing((short) 0);
+ } else {
+
+ switch (l) {
+ case 0:
+ te.setFacing((short) 2);
+ break;
+
+ case 1:
+ te.setFacing((short) 5);
+ break;
+
+ case 2:
+ te.setFacing((short) 3);
+ break;
+
+ case 3:
+ te.setFacing((short) 4);
+ }
+ }
+ }
+ }
+ }
+
+ world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, "step.stone", 1.0F, 0.8F);
+ --par1ItemStack.stackSize;
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister) {
+ this.itemIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":sackItem");
+ }
+
+ public Block getBlockContained() {
+ return this.field_150939_a;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public CreativeTabs getCreativeTab() {
+ return this.field_150939_a.getCreativeTabToDisplayOn();
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ if (!nameMap.isEmpty() && nameMap.containsKey(stack.getItemDamage())) {
+ return nameMap.get(stack.getItemDamage());
+ } else {
+ return this.field_150939_a.getUnlocalizedName();
+ }
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) {
+ if (itemStack.stackTagCompound != null) {
+ if (itemStack.stackTagCompound.hasKey("resultSuffix")) {
+ String result_suffix = itemStack.stackTagCompound.getString("resultSuffix");
+ if (StatCollector.canTranslate("ihl." + result_suffix)) {
+ result_suffix = StatCollector.translateToLocal("ihl." + result_suffix);
+ }
+ info.add(StatCollector.translateToLocal("result_of_molding") + result_suffix);
+ if (itemStack.stackTagCompound.hasKey("isContainStearin")
+ && itemStack.stackTagCompound.getBoolean("isContainStearin")) {
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 1: "
+ + StatCollector.translateToLocal("remove_wax_using_muffle_furnace"));
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 2: "
+ + StatCollector.translateToLocal("fill_from_top_with_molten_metal"));
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 3: "
+ + StatCollector.translateToLocal("wait_for_10_seconds"));
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 4: "
+ + StatCollector.translateToLocal("destroy_mold_to_get_results"));
+
+ } else {
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 1: "
+ + StatCollector.translateToLocal("fill_from_top_with_molten_metal"));
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 2: "
+ + StatCollector.translateToLocal("wait_for_10_seconds"));
+ info.add(StatCollector.translateToLocal("ihl.tooltip.step") + " 3: "
+ + StatCollector.translateToLocal("destroy_mold_to_get_results"));
+ }
+
+ }
+ if (itemStack.stackTagCompound.hasKey("detonator_delay")) {
+ info.add(StatCollector.translateToLocal("ihl.detonator_delay") + " "
+ + itemStack.stackTagCompound.getInteger("detonator_delay") + " "
+ + StatCollector.translateToLocal("ihl.seconds"));
+ }
+ if (itemStack.stackTagCompound.hasKey("explosionPower")) {
+ info.add(StatCollector.translateToLocal("ihl.explosionPower") + " "
+ + itemStack.stackTagCompound.getInteger("explosionPower") + " "
+ + StatCollector.translateToLocal("ihl.mTNT"));
+ }
+ }
+ }
+}
diff --git a/src/main/java/ihl/items_blocks/IHLTool.java b/src/main/java/ihl/items_blocks/IHLTool.java new file mode 100644 index 0000000..eb23ff5 --- /dev/null +++ b/src/main/java/ihl/items_blocks/IHLTool.java @@ -0,0 +1,444 @@ +package ihl.items_blocks;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ic2.api.energy.tile.IEnergySink;
+import ic2.api.reactor.IReactor;
+import ihl.IHLCreativeTab;
+import ihl.IHLModInfo;
+import ihl.flexible_cable.SetOfDiesMiniGUI;
+import ihl.interfaces.IEnergyNetNode;
+import ihl.interfaces.IItemHasMiniGUI;
+import ihl.interfaces.IMultiPowerCableHolder;
+import ihl.interfaces.ItemMiniGUI;
+import ihl.utils.IHLUtils;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.passive.EntitySheep;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.stats.AchievementList;
+import net.minecraft.stats.StatList;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.oredict.OreDictionary;
+public class IHLTool extends Item implements IItemHasMiniGUI{
+
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+ private static Map<Integer, String> hintMap = new HashMap<Integer, String>();
+ private static Map<Integer, Boolean> isWeaponMap = new HashMap<Integer, Boolean>();
+ private static Map<Integer, Float> damageVersusEntityMap = new HashMap<Integer, Float>();
+ public static Item instance;
+
+ private IIcon dice240;
+
+ public IHLTool()
+ {
+ super();
+ this.setMaxDamage(0);
+ this.setNoRepair();
+ this.setHasSubtypes(true);
+ this.setCreativeTab(IHLCreativeTab.tab);
+ this.setUnlocalizedName("ihlTool");
+ this.setMaxStackSize(1);
+ instance=this;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
+ {
+ if(itemStack.getItemDamage()!=19 || world.isRemote)
+ {
+ return itemStack;
+ }
+ MovingObjectPosition movingobjectposition = IHLUtils.returnMOPFromPlayer(entityPlayer, world);
+ if(movingobjectposition!=null)
+ {
+ int x=movingobjectposition.blockX;
+ int y=movingobjectposition.blockY;
+ int z=movingobjectposition.blockZ;
+ TileEntity te = world.getTileEntity(x, y, z);
+ if(te instanceof IReactor)
+ {
+ this.setThermometerTemperature(itemStack, entityPlayer, ((IReactor)te).getHeat()+273);
+ }
+ if(te instanceof IEnergySink)
+ {
+ System.out.println("demanded="+((IEnergySink)te).getDemandedEnergy());
+ }
+ IEnergyNetNode node = null;
+ if(te instanceof IMultiPowerCableHolder)
+ {
+ node = ((IMultiPowerCableHolder)te).getEnergyNetNode((short) 0);
+ for(short i=0;i<6;i++){
+ if(((IMultiPowerCableHolder)te).getEnergyNetNode(i).getGridID()!=-1)
+ node = ((IMultiPowerCableHolder)te).getEnergyNetNode(i);
+ }
+ }
+ if(te instanceof IEnergyNetNode)
+ {
+ node = ((IEnergyNetNode)te);
+ }
+ if(node!=null){
+ System.out.println("gridId="+node.getGridID());
+ if(node.getGridID()!=-1){
+ System.out.println("grid energy="+node.getGrid().energy);
+ System.out.println("getEnergyAmountThisNodeWant()="+node.getEnergyAmountThisNodeWant());
+ }
+ }
+ }
+ return itemStack;
+ }
+
+ @Override
+ public final ItemStack getContainerItem(ItemStack stack)
+ {
+ ItemStack outStack = stack.copy();
+ IHLUtils.damageItemViaNBTTag(outStack, 100);
+ if(outStack.stackSize<=0)
+ {
+ return null;
+ }
+ else
+ {
+ return outStack;
+ }
+ }
+
+ @Override
+ public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack)
+ {
+ return false;
+ }
+
+ @Override
+ public final boolean hasContainerItem(ItemStack aStack)
+ {
+ return true;
+ }
+
+ public static void init()
+ {
+ IHLTool item = new IHLTool();
+ GameRegistry.registerItem(item,item.getUnlocalizedName());
+ Type[] var1 = Type.values();
+ for(int i=0;i<var1.length;i++)
+ {
+ nameMap.put(var1[i].itemDamage,var1[i].unLocalizedName);
+ ItemStack stack = new ItemStack(item,1,var1[i].itemDamage);
+ stack.stackTagCompound = new NBTTagCompound();
+ NBTTagCompound stats = new NBTTagCompound();
+ stats.setInteger("MaxDamage", var1[i].maxToolDamage);
+ stack.stackTagCompound.setTag("GT.ToolStats", stats);
+ if(var1[i].equals(Type.SetOfDies1_5sqmm))
+ {
+ stack.stackTagCompound.setInteger("transverseSection",15);
+ }
+ IHLUtils.registerLocally(var1[i].unLocalizedName, stack);
+ if(var1[i].hint!=null)
+ {
+ hintMap.put(var1[i].itemDamage, var1[i].hint);
+ }
+ isWeaponMap.put(var1[i].itemDamage, var1[i].isWeapon);
+ damageVersusEntityMap.put(var1[i].itemDamage, var1[i].damageVersusEntity);
+ if(var1[i].oreDictName!=null && var1[i].oreDictName.length>0)
+ {
+ for(int i1=0;i1<var1[i].oreDictName.length;i1++)
+ {
+ OreDictionary.registerOre(var1[i].oreDictName[i1], stack);
+ }
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList)
+ {
+ Type[] var1 = Type.values();
+ for(int i=0;i<var1.length;i++)
+ {
+ ItemStack stack = IHLUtils.getThisModItemStack(var1[i].unLocalizedName);
+ itemList.add(stack);
+ if(var1[i].equals(Type.SetOfDies1_5sqmm))
+ {
+ stack = IHLUtils.getItemStackWithTag(var1[i].unLocalizedName, "transverseSection",240);
+ itemList.add(stack);
+ }
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack)
+ {
+ return nameMap.get(stack.getItemDamage());
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister register)
+ {
+ Type[] var1 = Type.values();
+ for(int i=0;i<var1.length;i++)
+ {
+ iconMap.put(var1[i].itemDamage, register.registerIcon(IHLModInfo.MODID + ":"+var1[i].unLocalizedName));
+ }
+ dice240 = register.registerIcon(IHLModInfo.MODID + ":setOfDies24sqmm");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(ItemStack stack, int i)
+ {
+ if(stack.stackTagCompound!=null && stack.stackTagCompound.hasKey("transverseSection"))
+ {
+ if(stack.stackTagCompound.getInteger("transverseSection")>=240)
+ {
+ return dice240;
+ }
+ }
+ return this.getIconFromDamage(stack.getItemDamage());
+ }
+
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int i)
+ {
+ return iconMap.get(i);
+ }
+
+ public enum Type
+ {
+ Thermometer("mercuryThermometer",19,1,0.1f,false,null,(String[])null),
+ FiberGlassDie("fiberGlassDieSteel",18,20000,0.5f,false,null,(String[])null),
+ SharpenedCarvingKnifeBronze("sharpenedCarvingKnifeBronze",17,2000,3.5f, true, "ihl.mutton_drop_hint", "craftingToolBlade", "craftingToolKnife"),
+ GlassBlowingTube("glassBlowingTubeSteel",16,2000,0.5f,false,null,(String[])null),
+ PolishingPucks("polishingPucksSteel",15,2000,0.5f,false,null,(String[])null),
+ GravelSteel("graverSteelHardened",14,10,0.5f,false,null,(String[])null),
+ DiceM10Steel("diceM10x1SteelHardened",13,2000,0.5f,false,null,(String[])null),
+ TapM10("tapM10x1SteelHardened",12,2000,0.5f,false,null,(String[])null),
+ Vise("viseSteel",11,200000,0.5f,false,null,(String[])null),
+ SetOfFiles("setOfFilesSteel",10,20000,1.5f,false,null,"craftingToolFile"),
+ HandDrillBronze("handDrillBronze",9,20000,0.5f,false,null,(String[])null),
+ HackSawSteel("hackSawSteel",8,200,0.5f,false,null,"craftingToolSaw"),
+ DrillSteel("drillSteelHardened",7,200,0.5f,false,null,(String[])null),
+ NeedleFile("needleFile",6,2000,0.1f,false,null,(String[])null),
+ Chisel("chisel",5,2000,1.5f,false,null,"craftingToolChisel"),
+ Grindstone("grindstone",4,2000,0.5f,false,null,(String[])null),
+ Hammer("hammer",3,20000,2.5f,false,null,"craftingToolHardHammer","craftingToolForgeHammer"),
+ TinSnipsSteel("tinSnipsSteel",2,2000,0.5f,false,null,"craftingToolWireCutter"),
+ SetOfDies1_5sqmm("setOfDies1_5sqmm",0,2000,0.5f,false,"ihl.setOfDiesHint",(String[])null);
+ Type(String unlocalizedName1,int itemDamage1, int maxToolDamage1, float damageVersusEntity1, boolean isWeapon1, String hint1, String... oreDictName1)
+ {
+ unLocalizedName=unlocalizedName1;
+ itemDamage=itemDamage1;
+ maxToolDamage=maxToolDamage1;
+ damageVersusEntity=damageVersusEntity1;
+ isWeapon=isWeapon1;
+ hint=hint1;
+ oreDictName=oreDictName1;
+ }
+ public final String unLocalizedName;
+ public final String[] oreDictName;
+ public final int itemDamage;
+ public final int maxToolDamage;
+ public final float damageVersusEntity;
+ public final boolean isWeapon;
+ public final String hint;
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag)
+ {
+ info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.durability") +EnumChatFormatting.GREEN + (IHLUtils.getMaxDamageValueViaNBTTag(itemStack) - IHLUtils.getDamageValueViaNBTTag(itemStack))+" / "+IHLUtils.getMaxDamageValueViaNBTTag(itemStack));
+ info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.attack_damage") +EnumChatFormatting.DARK_BLUE + damageVersusEntityMap.get(itemStack.getItemDamage()));
+ if(hintMap.containsKey(itemStack.getItemDamage()))
+ {
+ info.add(EnumChatFormatting.RED+StatCollector.translateToLocal(hintMap.get(itemStack.getItemDamage())));
+ }
+ if(itemStack.stackTagCompound.hasKey("transverseSection"))
+ {
+ info.add(EnumChatFormatting.WHITE+StatCollector.translateToLocal("ihl.transversesection") +EnumChatFormatting.GREEN + (itemStack.stackTagCompound.getInteger("transverseSection")/10f)+" sq. mm.");
+ }
+ }
+
+ @Override
+ public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
+ {
+ IHLUtils.damageItemViaNBTTag(stack, 1);
+ if(target!=null && target instanceof EntitySheep && !target.isChild() && target.getHealth()<=0F)
+ {
+ target.entityDropItem(IHLUtils.getThisModItemStackWithSize("muttonLard", target.worldObj.rand.nextInt(2)+2), 1F);
+ }
+ return true;
+ }
+
+ @Override//That was taken from Gregtech. I think Greg wouldn't mind.
+ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
+ {
+ if (entity.canAttackWithItem() && !entity.hitByEntity(player))
+ {
+ float tMagicDamage = entity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(player, (EntityLivingBase)entity) : 0.0F;
+ float tDamage = (float)player.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + damageVersusEntityMap.get(stack.getItemDamage());
+
+ if (tDamage + tMagicDamage > 0.0F)
+ {
+ boolean tCriticalHit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null && entity instanceof EntityLivingBase;
+
+ if (tCriticalHit && tDamage > 0.0F)
+ {
+ tDamage *= 1.5F;
+ }
+
+ tDamage += tMagicDamage;
+
+ if (entity.attackEntityFrom(DamageSource.generic, tDamage))
+ {
+ if (entity instanceof EntityLivingBase)
+ {
+ entity.setFire(EnchantmentHelper.getFireAspectModifier(player) * 4);
+ }
+
+ int tKnockcack = (player.isSprinting() ? 1 : 0) + (entity instanceof EntityLivingBase ? EnchantmentHelper.getKnockbackModifier(player, (EntityLivingBase)entity) : 0);
+
+ if (tKnockcack > 0)
+ {
+ entity.addVelocity(-MathHelper.sin(player.rotationYaw * (float)Math.PI / 180.0F) * tKnockcack * 0.5F, 0.1D, MathHelper.cos(player.rotationYaw * (float)Math.PI / 180.0F) * tKnockcack * 0.5F);
+ player.motionX *= 0.6D;
+ player.motionZ *= 0.6D;
+ player.setSprinting(false);
+ }
+
+ if (tCriticalHit)
+ {
+ player.onCriticalHit(entity);
+ }
+
+ if (tMagicDamage > 0.0F)
+ {
+ player.onEnchantmentCritical(entity);
+ }
+
+ if (tDamage >= 18.0F)
+ {
+ player.triggerAchievement(AchievementList.overkill);
+ }
+
+ player.setLastAttacker(entity);
+
+ if (entity instanceof EntityLivingBase)
+ {
+ EnchantmentHelper.func_151384_a((EntityLivingBase)entity, player);
+ }
+
+ EnchantmentHelper.func_151385_b(player, entity);
+
+ if (entity instanceof EntityLivingBase)
+ {
+ player.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F));
+ }
+ entity.hurtResistantTime = isWeaponMap.get(stack.getItemDamage())?0:1;
+ if(entity!=null && entity instanceof EntitySheep && !((EntityLivingBase) entity).isChild() && ((EntityLivingBase) entity).getHealth()<=0F && isWeaponMap.get(stack.getItemDamage()))
+ {
+ entity.entityDropItem(IHLUtils.getThisModItemStackWithSize("muttonLard", entity.worldObj.rand.nextInt(2)+1), 1F);
+ }
+ player.addExhaustion(0.3F);
+ IHLUtils.damageItemViaNBTTag(stack, 1);
+ }
+ }
+ }
+ if (stack.stackSize <= 0)
+ {
+ player.destroyCurrentEquippedItem();
+ }
+ return true;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ return ((double)IHLUtils.getDamageValueViaNBTTag(stack))/(double)IHLUtils.getMaxDamageValueViaNBTTag(stack);
+ }
+
+ @Override
+ public void onUpdate(ItemStack stack, World world, Entity entity, int slotIndex, boolean isCurrentItem)
+ {
+ if(stack.stackTagCompound!=null && !world.isRemote)
+ {
+ if(stack.stackTagCompound.hasKey("showTemperature"))
+ {
+ byte timerDelay = stack.stackTagCompound.getByte("showTemperature");
+ if(timerDelay>0)
+ {
+ timerDelay--;
+ if(Math.abs(stack.stackTagCompound.getDouble("playerPosX")-entity.prevPosX)>0.2d ||
+ Math.abs(stack.stackTagCompound.getDouble("playerPosY")-entity.prevPosY)>0.2d ||
+ Math.abs(stack.stackTagCompound.getDouble("playerPosZ")-entity.prevPosZ)>0.2d)
+ {
+ timerDelay=0;
+ }
+ stack.stackTagCompound.setByte("showTemperature",timerDelay);
+ if(timerDelay==0 && entity instanceof EntityPlayer)
+ {
+ ((EntityPlayer)entity).inventoryContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ private void setThermometerTemperature(ItemStack itemStack, EntityPlayer entityPlayer, long l)
+ {
+ if(itemStack.stackTagCompound==null)
+ {
+ itemStack.stackTagCompound=new NBTTagCompound();
+ }
+ itemStack.stackTagCompound.setLong("temperature", l);
+ itemStack.stackTagCompound.setByte("showTemperature", (byte) 60);
+ itemStack.stackTagCompound.setDouble("playerPosX", entityPlayer.prevPosX);
+ itemStack.stackTagCompound.setDouble("playerPosY", entityPlayer.prevPosY);
+ itemStack.stackTagCompound.setDouble("playerPosZ", entityPlayer.prevPosZ);
+ entityPlayer.inventoryContainer.detectAndSendChanges();
+
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public ItemMiniGUI getMiniGUI(GuiContainer gui, Slot slot)
+ {
+ if(slot.getHasStack() && slot.getStack().getItemDamage()==0 && slot.getStack().stackTagCompound!=null)
+ {
+ return new SetOfDiesMiniGUI(gui, slot);
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/ihl/items_blocks/ItemSubstance.java b/src/main/java/ihl/items_blocks/ItemSubstance.java new file mode 100644 index 0000000..507e65b --- /dev/null +++ b/src/main/java/ihl/items_blocks/ItemSubstance.java @@ -0,0 +1,413 @@ +package ihl.items_blocks;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ic2.api.item.IC2Items;
+import ic2.api.recipe.RecipeInputOreDict;
+import ic2.api.recipe.Recipes;
+import ihl.IHLCreativeTab;
+import ihl.IHLModInfo;
+import ihl.explosion.DetonatorMiniGUI;
+import ihl.interfaces.IItemHasMiniGUI;
+import ihl.interfaces.ItemMiniGUI;
+import ihl.utils.IHLUtils;
+import ihl.worldgen.ores.IHLFluid.IHLFluidType;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemFood;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class ItemSubstance extends Item implements IItemHasMiniGUI {
+
+ private static Map<Integer, IIcon> iconMap = new HashMap<Integer, IIcon>();
+ private static Map<Integer, String> nameMap = new HashMap<Integer, String>();
+ private static Map<Integer, String> descriptionMap = new HashMap<Integer, String>();
+ public static ItemSubstance instance;
+
+ public ItemSubstance() {
+ super();
+ this.setMaxDamage(0);
+ this.setNoRepair();
+ this.setHasSubtypes(true);
+ this.setCreativeTab(IHLCreativeTab.tab);
+ this.setUnlocalizedName("ihlSimpleItem");
+ instance = this;
+ }
+
+ public static void init() {
+ Item breadWithLard = (new ItemFood(4, 0.1F, false)).setUnlocalizedName("breadWithLard")
+ .setTextureName(IHLModInfo.MODID + ":breadWithLard").setCreativeTab(IHLCreativeTab.tab);
+ GameRegistry.registerItem(breadWithLard, "food");
+ IHLUtils.registerLocally("breadWithLard", new ItemStack(breadWithLard, 1, 0));
+ ItemSubstance item = new ItemSubstance();
+ GameRegistry.registerItem(item, item.getUnlocalizedName());
+ Type[] var1 = Type.values();
+ for (int i = 0; i < var1.length; i++) {
+ nameMap.put(var1[i].damage, var1[i].unLocalizedName);
+ IHLUtils.registerLocally(var1[i].unLocalizedName, new ItemStack(item, 1, var1[i].damage));
+ if (var1[i].registerInOreDictionary) {
+ OreDictionary.registerOre(var1[i].oreRegistryName, new ItemStack(item, 1, var1[i].damage));
+ }
+ if (var1[i].description != null) {
+ descriptionMap.put(var1[i].damage, var1[i].description);
+ }
+ }
+ ItemStack emptyCell = IC2Items.getItem("cell");
+ IHLFluidType[] var2 = IHLFluidType.values();
+ for (int i = 0; i < var2.length; i++) {
+ IHLFluidType type = var2[i];
+ if (type.cell != null) {
+ OreDictionary.registerOre("cell" + type.fluidName.replaceFirst("fluid", ""), type.cell);
+ FluidContainerRegistry.registerFluidContainer(new FluidContainerData(
+ new FluidStack(type.fluid, FluidContainerRegistry.BUCKET_VOLUME), type.cell, emptyCell.copy()));
+ } else {
+ ItemStack filledCell = FluidContainerRegistry.fillFluidContainer(
+ new FluidStack(type.fluid, FluidContainerRegistry.BUCKET_VOLUME), emptyCell.copy());
+ if (filledCell == null && type.hasCell) {
+ ItemStack stack = new ItemStack(item, 1, type.damage);
+ nameMap.put(type.damage, type.cellName);
+ IHLUtils.registerLocally(type.cellName, stack);
+ type.cell = stack;
+ OreDictionary.registerOre("cell" + type.fluidName.replaceFirst("fluid", ""), type.cell);
+ FluidContainerRegistry.registerFluidContainer(new FluidContainerData(
+ new FluidStack(type.fluid, FluidContainerRegistry.BUCKET_VOLUME), stack, emptyCell.copy()));
+ } else {
+ type.cell = filledCell;
+ }
+ }
+ }
+ OreDictionary.registerOre("itemSalt", IHLUtils.getThisModItemStack("dustSalt"));
+ }
+
+ public static void postInit() {
+ Type[] var1 = Type.values();
+ for (int i = 0; i < var1.length; i++) {
+ if (var1[i].registerInOreDictionary) {
+ if (var1[i].oreRegistryName.contains("dustTiny")) {
+ RecipeInputOreDict stack = new RecipeInputOreDict(var1[i].oreRegistryName);
+ ;
+ Recipes.advRecipes.addShapelessRecipe(
+ IHLUtils.getOreDictItemStackWithSize(var1[i].oreRegistryName, 9),
+ new RecipeInputOreDict(var1[i].oreRegistryName.replace("dustTiny", "dust")));
+ Recipes.advRecipes.addShapelessRecipe(
+ IHLUtils.getOreDictItemStack(var1[i].oreRegistryName.replace("dustTiny", "dust")), stack,
+ stack, stack, stack, stack, stack, stack, stack, stack);
+ }
+ if (var1[i].oreRegistryName.contains("ingot")
+ && IHLUtils.hasOreDictionaryEntry(var1[i].oreRegistryName.replace("ingot", "dust"))) {
+ IHLUtils.addIC2MaceratorRecipe(var1[i].oreRegistryName,
+ IHLUtils.getOreDictItemStack(var1[i].oreRegistryName.replace("ingot", "dust")));
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tabs, List itemList) {
+ Type[] var1 = Type.values();
+ for (int i = 0; i < var1.length; i++) {
+ ItemStack stack = IHLUtils.getThisModItemStack(var1[i].unLocalizedName);
+ if (var1[i] == Type.Detonator) {
+ stack.stackTagCompound = new NBTTagCompound();
+ stack.stackTagCompound.setInteger("detonator_delay", 5);
+ }
+ itemList.add(stack);
+ }
+ IHLFluidType[] var2 = IHLFluidType.values();
+ for (int i = 0; i < var2.length; i++) {
+ if (var2[i].hasCell && var2[i].cell != null) {
+ itemList.add(var2[i].cell);
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister register) {
+ Type[] var1 = Type.values();
+ for (int i = 0; i < var1.length; i++) {
+ iconMap.put(var1[i].damage, register.registerIcon(IHLModInfo.MODID + ":" + var1[i].textureName));
+ }
+ IHLFluidType[] var2 = IHLFluidType.values();
+ for (int i = 0; i < var2.length; i++) {
+ IHLFluidType type = var2[i];
+ if (var2[i].hasCell) {
+ iconMap.put(type.damage, register.registerIcon(IHLModInfo.MODID + ":" + type.cellName));
+ }
+ }
+
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamage(int i) {
+ return iconMap.get(i);
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return nameMap.get(stack.getItemDamage());
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) {
+ if (ItemSubstance.descriptionMap.containsKey(itemStack.getItemDamage())) {
+ info.add(ItemSubstance.descriptionMap.get(itemStack.getItemDamage()));
+ }
+ if (itemStack.stackTagCompound != null && itemStack.stackTagCompound.hasKey("detonator_delay")) {
+ info.add(StatCollector.translateToLocal("ihl.detonator_delay") + " "
+ + itemStack.stackTagCompound.getInteger("detonator_delay")
+ + StatCollector.translateToLocal("ihl.seconds"));
+ info.add(StatCollector.translateToLocal("ihl.detonatorHint"));
+ }
+ }
+
+ public enum Type {
+ dustMercuryFulminate(195, "dustMercuryFulminate", true, "Hg(CNO)\u2082"),
+ Detonator(194, "detonator"),
+ dustPentaerythritolTetranitrate(193, "dustPentaerythritolTetranitrate", true, "C(CH\u2082ONO\u2082)\u2084"),
+ DustPentaerythritol(192, "dustPentaerythritol", true, "C(CH\u2082OH)\u2084"),
+ DustPotassiumOxide(191, "dustPotassiumOxide", true, "K\u2082O"),
+ IngotPotassium(190, "ingotPotassium", true, "K"),
+ catalystIron(189, "catalystIron", false, "Fe (foam) + Al\u2082O\u2083 + K\u2082O"),
+ catalystIronOxide(188, "catalystIronOxide", false, "Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"),
+ catalystRawIronOxide(187, "catalystRawIronOxide", false, "Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"),
+ IronOxideCatalystMix(186, "dustIronOxideCatalystMix", false, "Fe\u2082O\u2083 + Al\u2082O\u2083 + K\u2082O"),
+ SodiumFormate(185, "dustSodiumFormate", true, "HCO\u2082Na"),
+ MercuryChloride(184, "dustMercuryChloride", true, "HgCl\u2082"),
+ CalciumAcetate(183, "dustCalciumAcetate", true, "Ca(CH\u2083COO)\u2082"),
+ TinySiliconDioxide(182, "dustTinySiliconDioxide", true, "SiO\u2082"),
+ TinyIronOxide(181, "dustTinyIronOxide", true, "Fe\u2082O\u2083"),
+ TinyManganeseOxide(180, "dustTinyManganeseOxide", true, "Mn\u2083O\u2084"),
+ TinyGypsum(179, "dustTinyGypsum", true, "CaSO\u2084\u00B72H\u2082O"),
+ SodiumZeoliteCoked(178, "dustSodiumZeoliteCoked", true, "Na[AlSi\u2083O\u2088]+C"),
+ SodiumZeolite(177, "dustSodiumZeolite", true, "Na[AlSi\u2083O\u2088]"),
+ SodiumAluminate(176, "dustSodiumAluminate", true, "NaAlO\u2082"),
+ SodiumHydroxide(175, "dustSodiumHydroxide", true, "NaOH"),
+ DustTinyTungsten(174, "dustTinyTungsten", true, "W"),
+ BauxiteDust(173, "dustBauxite", true, "Al\u2082O\u2083\u00B7H\u2082O"),
+ LithiumIngot(172, "ingotLithium", true, "Li"),
+ DustLithiumChloride(171, "dustLithiumChloride", true, "LiCl"),
+ CoalPlate(170, "plateCoal", true, "C (amorphic)"),
+ GraphitePlate(156, "plateGraphite", true, "C (graphite)"),
+ CoalRawPlate(155, "plateRawCoal"),
+ // RedstoneSensor(169,"redstoneSensor"),
+ // RedstoneEmitter(168,"redstoneEmitter"),
+ IncisorSteelDiamondCoated(167, "incisorSteelDiamondCoated"),
+ IncisorSteel(166, "incisorSteel"),
+ LampHolderPorcelain(165, "lampHolderPorcelain"),
+ LampHolderRawPorcelain(164, "lampHolderRawPorcelain"),
+ DustIridium(163, "dustIridium", true, "Ir"),
+ SiliconTiny(162, "dustTinySilicon", true, "Si"),
+ DustMagnesiumOxide(161, "dustMagnesiumOxide", true, "MgO"),
+ Silicon(160, "dustSilicon", true, "Si"),
+ Bischofite(159, "dustBischofite", true, "MgCl\u2082\u00B76H\u2082O"),
+ DustMagnesium(158, "dustMagnesium", true, "Mg"),
+ IngotMagnesium(157, "ingotMagnesium", true, "Mg"),
+ Ignitron(154, "ignitron"),
+ BoronCarbideElectrode(153, "stickBoronCarbide", true, "B\u2084C"),
+ LeadFoil(152, "foilLead", true, "Pb"),
+ DustLeadPlumbate(151, "dustLeadPlumbate", true, "Pb\u2082PbO\u2084"),
+ VacuumSwitch(150, "vacuumSwitch"),
+ HallSensor(149, "hallSensor"),
+ BatteryCells(148, "batteryCellsEbonite"),
+ // BatteryCellsRaw(147,"batteryCellsRawEbonite"),
+ MuscoviteGetinax(146, "plateMica", true, "KAl\u2082(AlSi\u2083O\u2081\u2080)(OH)\u2082"),
+ BoronCarbide(145, "dustBoronCarbide", true, "B\u2084C"),
+ DustBoricAcid(144, "dustBoricAcid", true, "H\u2083BO\u2083"),
+ DustDatolite(143, "dustDatolite", true, "H\u2082Ca\u2082B\u2082Si\u2082O\u2081\u2080"),
+ DustFerrite(142, "dustFerrite", true, "Li\u2082Fe\u2082O\u2084"),
+ RingFerrite(141, "ringFerrite", true, "Li\u2082Fe\u2082O\u2084"),
+ RingRawFerrite(140, "ringRawFerrite"),
+ LithiumOxide(139, "dustLithiumOxide", true, "Li\u2082O"),
+ SolderingAlloyDust(138, "dustSolderingAlloy", true, "Sn\u2089Sb"),
+ AntimonyTinyDust(137, "dustTinyAntimony", true, "Sb"),
+ InsulatorPorcelain(136, "insulatorPorcelain"),
+ InsulatorRawPorcelain(135, "insulatorRawPorcelain"),
+ AntimonyDust(134, "dustAntimony", true, "Sb"),
+ AntimonyOxide(133, "dustAntimonyOxide", true, "Sb\u2082O\u2083"),
+ StibniteDust(132, "dustStibnite", true, "Sb\u2082S\u2083"),
+ CrushedPurifiedStibnite(131, "crushedPurifiedStibnite", true, "Sb\u2082S\u2083"),
+ CrushedStibnite(130, "crushedStibnite", true, "Sb\u2082S\u2083"),
+ RingPorcelain(129, "ringPorcelain"),
+ RingRawPorcelain(128, "ringRawPorcelain"),
+ CopperFoil(127, "foilCopper", true, "Cu"),
+ CrushedPurifiedBauxite(126, "crushedPurifiedBauxite", true, "Al\u2082O\u2083\u00B7H\u2082O"),
+ CrushedBauxite(125, "crushedBauxite", true, "Al\u2082O\u2083�H\u2082O + SiO\u2082, Fe\u2082O\u2083"),
+ SodiumSulfide(124, "dustSodiumSulfide", true, "NaS"),
+ SodiumSulfate(123, "dustSodiumSulfate", true, "Na\u2082SO\u2084"),
+ dustWood(122, "dustWood", true),
+ Kenotron(121, "valveTube1C21P"),
+ HighVolatgeCapacitor(120, "highVoltageCapacitor"),
+ MuscovitePaper(119, "foilMica", true, "KAl\u2082(AlSi\u2083O\u2081\u2080)(OH)\u2082"),
+ MuscoviteDust(118, "dustMica", true, "KAl\u2082(AlSi\u2083O\u2081\u2080)(OH)\u2082"),
+ GaedesPumpBarrel(117, "gaedesPumpBarrelPorcelain"),
+ RawGaedesPumpBarrel(116, "gaedesPumpBarrelRawPorcelain"),
+ GlassDust(115, "dustGlass", true),
+ Gu81m(114, "gu-81m"),
+ TungstenFoil(113, "foilTungsten", true),
+ TungstenIngot(112, "ingotTungsten", true),
+ TungstenPlate(111, "plateTungsten", true),
+ TungstenHotPlate(110, "plateHotTungsten", true),
+ CrushedPurifiedCinnabar(109, "crushedPurifiedCinnabar", true, "HgS"),
+ CrushedCinnabar(108, "crushedCinnabar", true, "HgS"),
+ OvenRawPorcelain(107, "ovenRawPorcelain"),
+ TungstenDust(104, "dustTungsten", true, "W"),
+ ElectrolysisBathPorcelain(103, "electrolysisBathPorcelain"),
+ ElectrolysisBathRawPorcelain(102, "electrolysisBathRawPorcelain"),
+ Porcelain(99, "dustPorcelain", true),
+ FoilGold(98, "foilGold", true),
+ TungsticAcid(97, "dustTungsticAcid", true, "WO\u2083\u00B7H\u2082O"),
+ TurboCompressorSetOfMoldedParts(96, "turboCompressorSetOfMoldedPartsBronze"),
+ TungstenOxide(94, "dustTungstenOxide", true, "WO\u2083"),
+ CalciumTungstate(93, "dustCalciumTungstate", true, "CaWO\u2084"),
+ SodiumHydrogenSulfate(92, "dustSodiumHydrogenSulfate", true, "NaHSO\u2084"),
+ Salt(91, "dustSalt", true, "NaCl"),
+ CalciumChloride(90, "dustCalciumChloride", true, "CaCl\u2082"),
+ PotassiumSulphate(89, "dustPotassiumSulphate", true, "K\u2082SO\u2084"),
+ RockSalt(88, "dustRockSalt", true, "KCl"),
+ CrushedPurifiedGyuibnera(87, "crushedPurifiedGyubnera", true, "(Mn,Fe)WO\u2084 (5:1)"),
+ CrushedGyuibnera(86, "crushedGyubnera", true, "(Mn,Fe)WO\u2084 (5:1)"),
+ ManganeseOxide(85, "dustManganeseOxide", true, "Mn\u2083O\u2084"),
+ IronOxide(84, "dustIronOxide", true, "Fe\u2082O\u2083"),
+ SmallRound(83, "smallRoundSteel"),
+ SmallRoundPolished(82, "smallRoundPolishedSteel"),
+ RollingMachineSetOfMoldedParts(81, "rollingMachineSetOfMoldedPartsSteel"),
+ PistonCylinder(80, "pistonCylinderSteel"),
+ PipelineAccessoriesSteel(77, "pipelineAccessoriesSteel"),
+ DustTrona(76, "dustTrona", true, "Na\u2082CO\u2083�NaHCO\u2083\u00B72H\u2082O"),
+ HighPressureVessel(75, "highPressureVesselSteel"),
+ GasJet(74, "gasJetSteel"),
+ GasReducerSteel(73, "gasReducerSteel"),
+ HotSteelIngot(70, "ingotHotSteel", true),
+ BarD10Gold(69, "barD10Gold"),
+ CalciumCarbide(68, "dustCalciumCarbide", true, "CaC\u2082"),
+ foilRubber(67, "foilRubber", true, "(C\u2085H\u2088)n"),
+ Fabric(66, "fabric"),
+ ThinRubberWithSulfur(65, "foilRubberWithSulfur"),
+ Bucket_tarPitch(64, "bucket_tarPitch"),
+ DetonationSprayingMachineSetOfMoldedParts(63, "detonationSprayingMachineSetOfMoldedPartsBronze"),
+ SetOfPartsForLVElemotorSteel(62, "setOfPartsForLVElemotorSteel"),
+ // PlateNonVulcanizedRubber(60, "plateNonVulcanizedRubber"),
+ TapM10SteelHot(59, "tapM10x1SteelHot"),
+ DiceM10SteelHot(58, "diceM10x1SteelHot"),
+ NailSteel(57, "nailSteel"),
+ NutM10x1Steel(56, "nutM10x1Steel"),
+ GraverSteel(55, "graverSteel"),
+ GraverSteelHot(54, "graverSteelHot"),
+ DrillSteel(53, "drillSteel"),
+ DrillSteelHot(52, "drillSteelHot"),
+ BarD10Steel(51, "barD10Steel"),
+ BarD10SteelHot(50, "barD10SteelHot"),
+ SawBladeSteel(49, "sawBladeSteel"),
+ SawBladeSteelHot(48, "sawBladeSteelHot"),
+ SawBladeSteelHardened(47, "sawBladeSteelHardened"),
+ LinerIronGraphite(46, "linerIronGraphite"),
+ LinerIronGraphiteHot(45, "linerIronGraphiteHot"),
+ LinerIronGraphiteGreased(44, "linerIronGraphiteGreased"),
+ BoltM10x1Steel(43, "boltM10x1Steel"),
+ ExtruderSetOfMoldedParts(42, "extruderSetOfMoldedPartsSteel"),
+ MeshGlass(41, "meshGlass"),
+ TapM10Steel(39, "tapM10x1Steel"),
+ DiceM10Steel(38, "diceM10x1Steel"),
+ BlankSetOfFilesSteel(37, "blankSetOfFilesSteel"),
+ HandDrillSetOfMoldedPartsBronze(36, "handDrillSetOfMoldedPartsBronze"),
+ ViseSetOfMoldedPartsSteel(34, "viseSetOfMoldedPartsSteel"),
+ DustIrongraphite(33, "dustIrongraphite", true),
+ PlateSteelHot(32, "plateHotSteel"),
+ Chisel(31, "blankChiselSteel"),
+ CrucibleMixture(30, "crucibleMixture"),
+ GraphiteDust(29, "dustGraphite", true, "C (graphite)"),
+ BrickDust(28, "dustBrick", true),
+ CalciumSoap(27, "ingotCalciumSoap"),
+ Stearin(26, "ingotStearin"),
+ MuttonLard(25, "muttonLard"),
+ CarvingKnifeBronze(24, "carvingKnifeBronze"),
+ DehydratedGypsum(23, "dustDehydratedGypsum"),
+ BlankNeedleFileSteel(22, "blankNeedleFileSteel"),
+ HammerHead(21, "toolHeadHammerSmallSteel"),
+ SpringSteel(19, "springSteel"),
+ CoalElectrodePremix(18, "dustCoalElectrodePremix"),
+ rawCoalElectrode(17, "stickCoalElectrodePremix"),
+ FoilSteel(16, "foilSteel", true),
+ StickSteel(15, "stickSteel", true),
+ Quicklime(14, "dustQuicklime", true, "CaO"),
+ Calcite(13, "dustCalcite", true, "CaCO\u2082"),
+ Gypsum(12, "dustGypsum", true, "CaSO\u2084\u00B72H\u2082O"),
+ PotassiumFeldspar(11, "dustPotassiumFeldspar", true, "K[AlSi\u2083O\u2088]"),
+ Apatite(10, "gemApatite", true, "Ca\u2085[PO\u2084]\u2083(F,Cl,OH)"),
+ Saltpeter(9, "dustSaltpeter", true, "KNO\u2083"),
+ TarPitch(8, "ingotTarPitch", true),
+ nuggetTarPitch(7, "nuggetTarPitch", true),
+ Graphite_Electrode(6, "stickGraphite", true, "C (graphite)"),
+ Coal_Electrode(5, "stickCoal", true, "C (amorphic)"),
+ Carborundum(4, "dustCarborundum", true, "SiC"),
+ IridiumAndSodiumOxide(3, "dustIridiumAndSodiumOxide", true, "IrO\u2082 + Na\u2082O"),
+ PlatinumGroupSludge(2, "dustPlatinumGroupSludge", true),
+ TinyPlatinumGroupSludge(1, "dustTinyPlatinumGroupSludge", true),
+ SodiumPeroxide(0, "dustSodiumPeroxide", true, "Na\u2082O\u2082");
+ Type(int damage1, String unlocalizedName1) {
+ damage = damage1;
+ textureName = unLocalizedName = unlocalizedName1;
+ }
+
+ Type(int damage1, String unlocalizedName1, boolean registerInOreDictionary1) {
+ damage = damage1;
+ textureName = oreRegistryName = unLocalizedName = unlocalizedName1;
+ registerInOreDictionary = registerInOreDictionary1;
+ }
+
+ Type(int damage1, String unlocalizedName1, boolean registerInOreDictionary1, String description1) {
+ damage = damage1;
+ textureName = oreRegistryName = unLocalizedName = unlocalizedName1;
+ registerInOreDictionary = registerInOreDictionary1;
+ description = description1;
+ }
+
+ Type(int damage1, String unlocalizedName1, boolean registerInOreDictionary1, String description1,
+ String textureName1) {
+ damage = damage1;
+ oreRegistryName = unLocalizedName = unlocalizedName1;
+ registerInOreDictionary = registerInOreDictionary1;
+ description = description1;
+ textureName = textureName1;
+ }
+
+ public int damage;
+ public String unLocalizedName;
+ public String oreRegistryName;
+ public String description;
+ public String textureName;
+ public boolean registerInOreDictionary = false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public ItemMiniGUI getMiniGUI(GuiContainer gui, Slot slot) {
+ if (slot.getHasStack() && slot.getStack().getItemDamage() == Type.Detonator.damage
+ && slot.getStack().stackTagCompound != null) {
+ return new DetonatorMiniGUI(gui, slot);
+ }
+ return null;
+ }
+
+}
\ No newline at end of file diff --git a/src/main/java/ihl/items_blocks/MachineBaseBlock.java b/src/main/java/ihl/items_blocks/MachineBaseBlock.java new file mode 100644 index 0000000..aef567c --- /dev/null +++ b/src/main/java/ihl/items_blocks/MachineBaseBlock.java @@ -0,0 +1,662 @@ +package ihl.items_blocks;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import ic2.api.tile.IWrenchable;
+import ic2.core.IC2;
+import ic2.core.IHasGui;
+import ic2.core.item.tool.ItemToolCutter;
+import ihl.IHLCreativeTab;
+import ihl.IHLMod;
+import ihl.IHLModInfo;
+import ihl.flexible_cable.BatterySwitchUnitTileEntity;
+import ihl.flexible_cable.IronWorkbenchTileEntity;
+import ihl.flexible_cable.RectifierTransformerUnitTileEntity;
+import ihl.interfaces.IEnergyNetNode;
+import ihl.interfaces.IMultiPowerCableHolder;
+import ihl.processing.chemistry.ChemicalReactorTileEntity;
+import ihl.processing.chemistry.CryogenicDistillerTileEntity;
+import ihl.processing.chemistry.DosingPumpTileEntity;
+import ihl.processing.chemistry.ElectrolysisBathTileEntity;
+import ihl.processing.chemistry.FluidizedBedReactorTileEntity;
+import ihl.processing.chemistry.FractionatorBottomTileEntity;
+import ihl.processing.chemistry.FractionatorCoverTileEntity;
+import ihl.processing.chemistry.FractionatorSectionTileEntity;
+import ihl.processing.chemistry.GaedesMercuryRotaryPumpTileEntity;
+import ihl.processing.chemistry.LabElectrolyzerTileEntity;
+import ihl.processing.chemistry.LeadOvenTileEntity;
+import ihl.processing.chemistry.LoomTileEntity;
+import ihl.processing.chemistry.PaperMachineTileEntity;
+import ihl.processing.chemistry.RefluxCondenserTileEntity;
+import ihl.processing.chemistry.SolarEvaporatorTileEntity;
+import ihl.processing.metallurgy.AchesonFurnanceTileEntity;
+import ihl.processing.metallurgy.CoilerTileEntity;
+import ihl.processing.metallurgy.DetonationSprayingMachineTileEntity;
+import ihl.processing.metallurgy.ExtruderTileEntity;
+import ihl.processing.metallurgy.GasWeldingStationTileEntity;
+import ihl.processing.metallurgy.ImpregnatingMachineTileEntity;
+import ihl.processing.metallurgy.LathePart1TileEntity;
+import ihl.processing.metallurgy.LathePart2TileEntity;
+import ihl.processing.metallurgy.MuffleFurnanceTileEntity;
+import ihl.processing.metallurgy.RollingMachinePart1TileEntity;
+import ihl.processing.metallurgy.RollingMachinePart2TileEntity;
+import ihl.processing.metallurgy.VulcanizationExtrudingMoldTileEntity;
+import ihl.processing.metallurgy.WireMillTileEntity;
+import ihl.processing.metallurgy.WoodenRollingMachinePart1TileEntity;
+import ihl.processing.metallurgy.WoodenRollingMachinePart2TileEntity;
+import ihl.utils.IHLUtils;
+import net.minecraft.block.Block;
+import net.minecraft.block.ITileEntityProvider;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class MachineBaseBlock extends Block implements ITileEntityProvider {
+
+ public MachineType type;
+ private static List<MachineBaseBlock> instances = new ArrayList<MachineBaseBlock>();
+
+ @SideOnly(Side.CLIENT)
+ IIcon textureSide, textureBack, textureFrontMuffleFurnance, textureTop, textureTopAchesonFurnance,
+ textureTopGoldFurnace, textureFrontGoldFurnace, textureSideGoldFurnace, textureFrontCryogenicDistiller,
+ textureTopCryogenicDistiller, textureBackCryogenicDistiller, textureFrontChemicalReactor,
+ textureLeftMachineCasing, textureTopMachineCasing, textureRightMachineCasing, textureFrontMachineCasing,
+ textureFrontPaperMachine, textureBackMachineCasing, bronzeTubTop, bronzeTubSide, steel, redPaint,
+ greenPaint, rubberInsulatedCase, powerPort, dosingPumpBack, dosingPumpLeftSide, dosingPumpRightSide,
+ dosingPumpTop, dosingPumpFront, solarEvaporatorSide;
+
+ public MachineBaseBlock(MachineType type1) {
+ super(Material.iron);
+ this.type = type1;
+ this.setCreativeTab(IHLCreativeTab.tab);
+ this.setBlockName(type.unlocalizedName);
+ this.setHardness(2F);
+ this.setResistance(1F);
+ instances.add(this);
+ }
+
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ if (IC2.platform.isSimulating()) {
+ TileEntity te = world.getTileEntity(x, y, z);
+ boolean isPowered = world.isBlockIndirectlyGettingPowered(x, y, z);
+ if (te instanceof DosingPumpTileEntity) {
+ DosingPumpTileEntity dpte = (DosingPumpTileEntity) te;
+ dpte.setPowered(isPowered);
+ }
+
+ if (world.getBlock(x, y + 1, z) == Blocks.fire) {
+ if (te instanceof DetonationSprayingMachineTileEntity) {
+ ((DetonationSprayingMachineTileEntity) te).operate();
+ world.setBlockToAir(x, y + 1, z);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void onBlockPreDestroy(World world, int x, int y, int z, int meta) {
+ if (!world.isRemote) {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null) {
+ if (te instanceof IEnergyNetNode) {
+ IEnergyNetNode ate = (IEnergyNetNode) te;
+ ate.removeAttachedChains();
+ }
+ if (te instanceof IMultiPowerCableHolder) {
+ IMultiPowerCableHolder ate = (IMultiPowerCableHolder) te;
+ ate.removeAttachedChains();
+ }
+ if (te instanceof IronWorkbenchTileEntity) {
+ IronWorkbenchTileEntity iwb = (IronWorkbenchTileEntity) te;
+ iwb.dropContents();
+ } else if (te instanceof IInventory) {
+ IInventory inventory = (IInventory) te;
+ for (int i = 0; i < inventory.getSizeInventory(); i++) {
+ if (inventory.getStackInSlot(i) != null)
+ world.spawnEntityInWorld(new EntityItem(world, x, y + 1, z, inventory.getStackInSlot(i)));
+ }
+ }
+ }
+ }
+ super.onBlockPreDestroy(world, x, y, z, meta);
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list,
+ Entity entity) {
+ float height = 1f;
+ switch (this.type) {
+ case SolarEvaporator:
+ height = 0.5f;
+ case BronzeTub:
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1F, 1.0F);
+ super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.1F, height, 1.0F);
+ super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, height, 0.1F);
+ super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
+ this.setBlockBounds(0.9F, 0.0F, 0.0F, 1.0F, height, 1.0F);
+ super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
+ this.setBlockBounds(0.0F, 0.0F, 0.9F, 1.0F, height, 1.0F);
+ super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
+ this.setBlockBoundsForItemRender();
+ break;
+ default:
+ super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
+ break;
+ }
+ }
+
+ @Override
+ public void setBlockBoundsForItemRender() {
+ if(this.type.equals(MachineType.SolarEvaporator)){
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5f, 1.0F);
+ }
+ else {
+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+ }
+
+ public static void init() {
+ MachineType[] var1 = MachineType.values();
+ for (int i = 0; i < var1.length; i++) {
+ if (!var1[i].unlocalizedName.equalsIgnoreCase(IHLMod.config.preventMachineBlockRegistrationName)) {
+ GameRegistry.registerBlock(new MachineBaseBlock(var1[i]), IHLItemBlock.class, var1[i].unlocalizedName);
+ GameRegistry.registerTileEntity(var1[i].teclass, var1[i].unlocalizedName);
+ }
+ }
+ IHLUtils.getThisModBlock("tubBronze").setBlockTextureName("tubBronzeIcon");
+ }
+
+ @Override
+ public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) {
+ if (this.type.itemDroppedOnBlockDestroy != null) {
+ this.dropBlockAsItem(world, x, y, z, this.type.itemDroppedOnBlockDestroy.copy());
+ } else {
+ super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, flag);
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2) {
+ TileEntity newTE = null;
+ try {
+ newTE = (TileEntity) type.teclass.newInstance();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return newTE;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister par1IconRegister) {
+ this.blockIcon = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenSide");
+ this.textureBack = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenBack");
+ this.textureSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenSide");
+ this.textureTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":brickOvenTop");
+ this.textureFrontMuffleFurnance = par1IconRegister.registerIcon(IHLModInfo.MODID + ":muffleOvenFront");
+ this.textureTopAchesonFurnance = par1IconRegister.registerIcon(IHLModInfo.MODID + ":achesonOvenTop");
+ this.textureTopGoldFurnace = par1IconRegister.registerIcon(IHLModInfo.MODID + ":porcelainFurnaceTop");
+ this.textureFrontGoldFurnace = par1IconRegister.registerIcon(IHLModInfo.MODID + ":porcelainFurnaceFront");
+ this.textureSideGoldFurnace = par1IconRegister.registerIcon(IHLModInfo.MODID + ":porcelainFurnaceSide");
+ this.textureLeftMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsLeft");
+ this.textureTopMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsTop");
+ this.textureRightMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsRight");
+ this.textureFrontMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsFront");
+ this.textureBackMachineCasing = par1IconRegister.registerIcon(IHLModInfo.MODID + ":fiberglassSpinneretsBack");
+ this.textureFrontCryogenicDistiller = par1IconRegister
+ .registerIcon(IHLModInfo.MODID + ":cryogenicDistillerOxygenSide");
+ this.textureTopCryogenicDistiller = par1IconRegister
+ .registerIcon(IHLModInfo.MODID + ":cryogenicDistillerNitrogenSide");
+ this.textureBackCryogenicDistiller = par1IconRegister
+ .registerIcon(IHLModInfo.MODID + ":cryogenicDistillerInputSide");
+ this.textureFrontChemicalReactor = par1IconRegister
+ .registerIcon(IHLModInfo.MODID + ":chemicalReactorOutputSide");
+ this.textureFrontPaperMachine = par1IconRegister.registerIcon(IHLModInfo.MODID + ":paperMachineFront");
+ this.bronzeTubTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tubBronzeTop");
+ this.bronzeTubSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":tubBronzeSide");
+ this.steel = par1IconRegister.registerIcon(IHLModInfo.MODID + ":steel");
+ this.redPaint = par1IconRegister.registerIcon(IHLModInfo.MODID + ":redPaint");
+ this.greenPaint = par1IconRegister.registerIcon(IHLModInfo.MODID + ":greenPaint");
+ this.rubberInsulatedCase = par1IconRegister.registerIcon(IHLModInfo.MODID + ":rubberInsulatedCase");
+ this.powerPort = par1IconRegister.registerIcon(IHLModInfo.MODID + ":powerPort");
+ this.dosingPumpBack = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpBack");
+ this.dosingPumpLeftSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpLeft");
+ this.dosingPumpRightSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpRight");
+ this.dosingPumpTop = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpTop");
+ this.dosingPumpFront = par1IconRegister.registerIcon(IHLModInfo.MODID + ":dosingPumpFront");
+ this.solarEvaporatorSide = par1IconRegister.registerIcon(IHLModInfo.MODID + ":solarEvaporatorSide");
+ }
+
+ @Override
+ public boolean hasTileEntity(int metadata) {
+ return true;
+ }
+
+ @Override
+ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float pos_x,
+ float pos_y, float pos_z) {
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (IC2.platform.isSimulating()) {
+ if (te instanceof DetonationSprayingMachineTileEntity && player.getCurrentEquippedItem() != null
+ && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) {
+ ((DetonationSprayingMachineTileEntity) te).operate();
+ return true;
+ }
+ if (te instanceof LathePart2TileEntity) {
+ LathePart2TileEntity lte = ((LathePart2TileEntity) te);
+ te = world.getTileEntity(x - ForgeDirection.getOrientation(lte.getFacing()).offsetX,
+ y - ForgeDirection.getOrientation(lte.getFacing()).offsetY,
+ z - ForgeDirection.getOrientation(lte.getFacing()).offsetZ);
+ }
+ if (te instanceof RollingMachinePart2TileEntity) {
+ RollingMachinePart2TileEntity lte = ((RollingMachinePart2TileEntity) te);
+ te = world.getTileEntity(x - ForgeDirection.getOrientation(lte.getFacing()).offsetX,
+ y - ForgeDirection.getOrientation(lte.getFacing()).offsetY,
+ z - ForgeDirection.getOrientation(lte.getFacing()).offsetZ);
+ }
+ if (te instanceof WoodenRollingMachinePart2TileEntity) {
+ WoodenRollingMachinePart2TileEntity lte = ((WoodenRollingMachinePart2TileEntity) te);
+ te = world.getTileEntity(x - ForgeDirection.getOrientation(lte.getFacing()).offsetX,
+ y - ForgeDirection.getOrientation(lte.getFacing()).offsetY,
+ z - ForgeDirection.getOrientation(lte.getFacing()).offsetZ);
+ }
+ if (te instanceof RectifierTransformerUnitTileEntity) {
+ RectifierTransformerUnitTileEntity rtu = (RectifierTransformerUnitTileEntity) te;
+ if (player.getCurrentEquippedItem() == null) {
+ if (IC2.keyboard.isModeSwitchKeyDown(player)) {
+ rtu.switchModeDown();
+ } else {
+ rtu.switchModeUp();
+ }
+ IC2.platform.messagePlayer(player, "ic2.tooltip.mode",
+ new Object[] { " Voltage output was set to x" + rtu.mode });
+ }
+ }
+ if (te instanceof IEnergyNetNode) {
+ IEnergyNetNode node = (IEnergyNetNode) te;
+ if (player.getCurrentEquippedItem() != null
+ && player.getCurrentEquippedItem().getItem() instanceof ItemToolCutter) {
+ node.removeAttachedChains();
+ }
+ }
+ }
+ return te instanceof IHasGui
+ ? (IC2.platform.isSimulating() ? IC2.platform.launchGui(player, (IHasGui) te) : true) : false;
+ }
+
+ /**
+ * Called when the block is placed in the world.
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
+ TileEntity t = world.getTileEntity(x, y, z);
+ if (t != null && t instanceof IWrenchable) {
+ ((IWrenchable) t).setFacing(IHLUtils.getFacingFromPlayerView(player, false));
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
+ int facing = 3;
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te instanceof IWrenchable) {
+ IWrenchable tebh = (IWrenchable) te;
+ facing = tebh.getFacing();
+ }
+ return this.getIconFromFacing(facing, side);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(int side, int meta) {
+ if (this.type == MachineType.IronWorkbench) {
+ return this.steel;
+ }
+ if (this.type == MachineType.RectifierTransformerUnit) {
+ switch (side) {
+ case 0:
+ return this.bronzeTubSide;
+ case 1:
+ return this.textureSideGoldFurnace;
+ case 2:
+ return this.redPaint;
+ case 3:
+ return this.greenPaint;
+ case 4:
+ return this.rubberInsulatedCase;
+ case 5:
+ return this.powerPort;
+ }
+ }
+ return this.getIconFromFacing(3, side);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromFacing(int facing, int side) {
+ int mask[] = { 0, 1, 2, 3, 4, 5, 1, 0, 3, 2, 4, 5, 2, 3, 0, 1, 4, 5, 2, 3, 1, 0, 4, 5, 2, 3, 5, 4, 0, 1, 2, 3,
+ 4, 5, 1, 0 };
+ switch (this.type) {
+ case RefluxCondenser:
+ return this.steel;
+ case RectifierTransformerUnit:
+ return this.bronzeTubSide;
+ case IronWorkbench:
+ return this.steel;
+ default:
+ }
+ switch (mask[facing * 6 + side]) {
+ case 0:
+ switch (this.type) {
+ case BronzeTub:
+ return this.bronzeTubSide;
+ case SolarEvaporator:
+ return this.solarEvaporatorSide;
+ case AchesonFurnace:
+ return this.blockIcon;
+ case MuffleFurnace:
+ return this.textureFrontMuffleFurnance;
+ case LeadOven:
+ return this.textureFrontGoldFurnace;
+ case WireMill:
+ return this.textureFrontMachineCasing;
+ case LabElectrolyzer:
+ return this.textureTopMachineCasing;
+ case FluidizedBedReactor:
+ return this.textureTopMachineCasing;
+ case ChemicalReactor:
+ return this.textureFrontChemicalReactor;
+ case CryogenicDistiller:
+ return this.textureFrontCryogenicDistiller;
+ case PaperMachine:
+ return this.textureFrontPaperMachine;
+ case DosingPump:
+ return this.dosingPumpFront;
+ default:
+ break;
+ }
+ case 1:
+ switch (this.type) {
+ case BronzeTub:
+ return this.bronzeTubSide;
+ case SolarEvaporator:
+ return this.solarEvaporatorSide;
+ case LeadOven:
+ return this.textureSideGoldFurnace;
+ case WireMill:
+ return this.textureBackMachineCasing;
+ case CryogenicDistiller:
+ return this.textureBackCryogenicDistiller;
+ case PaperMachine:
+ return this.textureBackCryogenicDistiller;
+ case LabElectrolyzer:
+ return this.textureBackCryogenicDistiller;
+ case FluidizedBedReactor:
+ return this.textureBackCryogenicDistiller;
+ case ChemicalReactor:
+ return this.textureBackCryogenicDistiller;
+ case DosingPump:
+ return this.dosingPumpBack;
+ default:
+ return this.textureBack;
+ }
+
+ case 2:
+ switch (this.type) {
+ case BronzeTub:
+ return this.bronzeTubSide;
+ case SolarEvaporator:
+ return this.solarEvaporatorSide;
+ case LeadOven:
+ return this.textureSideGoldFurnace;
+ case WireMill:
+ return this.textureBackMachineCasing;
+ case CryogenicDistiller:
+ return this.textureBackMachineCasing;
+ case PaperMachine:
+ return this.textureBackMachineCasing;
+ case LabElectrolyzer:
+ return this.textureBackMachineCasing;
+ case FluidizedBedReactor:
+ return this.textureBackMachineCasing;
+ case ChemicalReactor:
+ return this.textureBackMachineCasing;
+ case DosingPump:
+ return this.dosingPumpBack;
+ default:
+ return this.textureTop;
+ }
+ case 3:
+ switch (this.type) {
+ case BronzeTub:
+ case SolarEvaporator:
+ return this.bronzeTubTop;
+ case AchesonFurnace:
+ return this.textureTopAchesonFurnance;
+ case MuffleFurnace:
+ return this.textureTop;
+ case LeadOven:
+ return this.textureTopGoldFurnace;
+ case WireMill:
+ return this.textureTopMachineCasing;
+ case CryogenicDistiller:
+ return this.textureTopCryogenicDistiller;
+ case PaperMachine:
+ return this.textureTopMachineCasing;
+ case LabElectrolyzer:
+ return this.textureTopMachineCasing;
+ case FluidizedBedReactor:
+ return this.textureTopMachineCasing;
+ case ChemicalReactor:
+ return this.textureTopMachineCasing;
+ case DosingPump:
+ return this.dosingPumpTop;
+ default:
+ return this.textureTop;
+ }
+ case 4:
+ switch (this.type) {
+ case BronzeTub:
+ return this.bronzeTubSide;
+ case SolarEvaporator:
+ return this.solarEvaporatorSide;
+ case LeadOven:
+ return this.textureSideGoldFurnace;
+ case WireMill:
+ return this.textureRightMachineCasing;
+ case CryogenicDistiller:
+ return this.textureRightMachineCasing;
+ case PaperMachine:
+ return this.textureRightMachineCasing;
+ case LabElectrolyzer:
+ return this.textureRightMachineCasing;
+ case FluidizedBedReactor:
+ return this.textureRightMachineCasing;
+ case ChemicalReactor:
+ return this.textureRightMachineCasing;
+ case DosingPump:
+ return this.dosingPumpRightSide;
+ default:
+ return this.textureSide;
+ }
+ case 5:
+ switch (this.type) {
+ case BronzeTub:
+ return this.bronzeTubSide;
+ case SolarEvaporator:
+ return this.solarEvaporatorSide;
+ case LeadOven:
+ return this.textureSideGoldFurnace;
+ case CryogenicDistiller:
+ return this.textureLeftMachineCasing;
+ case PaperMachine:
+ return this.textureLeftMachineCasing;
+ case WireMill:
+ return this.textureLeftMachineCasing;
+ case ChemicalReactor:
+ return this.textureLeftMachineCasing;
+ case LabElectrolyzer:
+ return this.textureLeftMachineCasing;
+ case FluidizedBedReactor:
+ return this.textureLeftMachineCasing;
+ case DosingPump:
+ return this.dosingPumpLeftSide;
+ default:
+ return this.textureSide;
+ }
+ default:
+ return this.textureSide;
+ }
+ }
+
+ @Override
+ public boolean onBlockEventReceived(World world, int x, int y, int z, int metadata, int flag) {
+ return true;
+ }
+
+ @Override
+ public boolean canProvidePower() {
+ return true;
+ }
+
+ @Override
+ public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int metadata) {
+ return this.isProvidingWeakPower(world, x, y, z, metadata);
+ }
+
+ public enum MachineType {
+ SolarEvaporator("solarEvaporator", SolarEvaporatorTileEntity.class, false, true, null),
+ DosingPump("dosingPump", DosingPumpTileEntity.class, true, null),
+ IronWorkbench("ironWorkbench", IronWorkbenchTileEntity.class, false, true, null),
+ ElectrolysisBath("electrolysisBath", ElectrolysisBathTileEntity.class, false, IHLUtils
+ .getThisModItemStack("plateGraphite")),
+ RectifierTransformerUnit("rectifierTransformerUnit", RectifierTransformerUnitTileEntity.class, false, true, IHLUtils
+ .getThisModItemStack("foilSteel")),
+ BatterySwitchUnit("batterySwitchUnit", BatterySwitchUnitTileEntity.class, false, IHLUtils
+ .getThisModItemStack("foilSteel")),
+ FractionatorBottom("fractionatorBottom", FractionatorBottomTileEntity.class, false, IHLUtils
+ .getThisModItemStack("foilSteel")),
+ FractionatorSection("fractionatorSection", FractionatorSectionTileEntity.class, false, IHLUtils
+ .getThisModItemStackWithSize("ringPorcelain", 16)),
+ FractionatorCover("fractionatorCover", FractionatorCoverTileEntity.class, false, IHLUtils
+ .getThisModItemStack("foilSteel")),
+ RefluxCondenser("refluxCondenser", RefluxCondenserTileEntity.class, false, false, IHLUtils
+ .getThisModItemStack("foilSteel")),
+ PaperMachine("paperMachine", PaperMachineTileEntity.class, true, IHLUtils.getThisModItemStack("stickSteel")),
+ GaedesMercuryRotaryPump("gaedesMercuryRotaryPump", GaedesMercuryRotaryPumpTileEntity.class, false, IHLUtils
+ .getThisModItemStack("foilSteel")),
+ LabElectrolyzer("labElectrolyzer", LabElectrolyzerTileEntity.class, true, IHLUtils
+ .getThisModItemStack("stickGraphite")),
+ FluidizedBedReactor("fluidizedBedReactor", FluidizedBedReactorTileEntity.class, true, IHLUtils
+ .getThisModItemStack("highPressureVesselSteel")),
+ ChemicalReactor("chemicalReactor", ChemicalReactorTileEntity.class, true, IHLUtils
+ .getThisModItemStack("highPressureVesselSteel")),
+ CryogenicDistiller("cryogenicDistiller", CryogenicDistillerTileEntity.class, true, IHLUtils
+ .getThisModItemStack("highPressureVesselSteel")),
+ GasWeldingStation("gasWeldingStation", GasWeldingStationTileEntity.class, false, null),
+ WoodenRollingMachine1("woodenRollingMachinePart1", WoodenRollingMachinePart1TileEntity.class, false, IHLUtils
+ .getThisModItemStack("barD10Steel")),
+ WoodenRollingMachine2("woodenRollingMachinePart2", WoodenRollingMachinePart2TileEntity.class, false, IHLUtils
+ .getThisModItemStack("barD10Steel")),
+ WireMill("wireMill", WireMillTileEntity.class, true, IHLUtils.getThisModItemStack("stickSteel")),
+ VulcanizationExtrudingMold("vulcanizationExtrudingMold", VulcanizationExtrudingMoldTileEntity.class, false, IHLUtils
+ .getThisModItemStack("dustCarborundum")),
+ Extruder("extruder", ExtruderTileEntity.class, false, IHLUtils.getThisModItemStack("dustCarborundum")),
+ RollingMachine1("rollingMachinePart1", RollingMachinePart1TileEntity.class, false, IHLUtils
+ .getThisModItemStack("stickSteel")),
+ RollingMachine2("rollingMachinePart2", RollingMachinePart2TileEntity.class, false, IHLUtils
+ .getThisModItemStack("stickSteel")),
+ Loom("loom", LoomTileEntity.class, false, new ItemStack(Items.stick)),
+ Coiler("coiler", CoilerTileEntity.class, false, new ItemStack(Items.stick)),
+ Lathe1("lathePart1", LathePart1TileEntity.class, false, IHLUtils.getThisModItemStack("stickSteel")),
+ Lathe2("lathePart2", LathePart2TileEntity.class, false, IHLUtils.getOreDictItemStack("plateSteel")),
+ LeadOven("leadOven", LeadOvenTileEntity.class, true, IHLUtils.getThisModItemStack("dustPorcelain")),
+ DetonationSprayingMachine("cannonBronze", DetonationSprayingMachineTileEntity.class, false, new ItemStack(
+ Items.stick)),
+ BronzeTub("tubBronze", ImpregnatingMachineTileEntity.class, false, true, null),
+ AchesonFurnace("achesonFurnance", AchesonFurnanceTileEntity.class, true, new ItemStack(Items.brick)),
+ MuffleFurnace("muffleFurnance", MuffleFurnanceTileEntity.class, true, new ItemStack(Items.brick));
+ MachineType(String unlocalizedName1, Class<? extends TileEntity> teclass1, boolean isNormalBlock1,
+ ItemStack itemDroppedOnBlockDestroy1) {
+ unlocalizedName = unlocalizedName1;
+ teclass = teclass1;
+ isNormalBlock = isNormalBlock1;
+ if (isNormalBlock) {
+ specialBlockRendererId = 0;
+ } else {
+ specialBlockRendererId = -2;
+ }
+ itemDroppedOnBlockDestroy = itemDroppedOnBlockDestroy1;
+ }
+
+ MachineType(String unlocalizedName1, Class<? extends TileEntity> teclass1, boolean isNormalBlock1,
+ boolean hasSpecialBlockRenderer1, ItemStack itemDroppedOnBlockDestroy1) {
+ unlocalizedName = unlocalizedName1;
+ teclass = teclass1;
+ isNormalBlock = isNormalBlock1;
+ hasSpecialBlockRenderer = hasSpecialBlockRenderer1;
+ itemDroppedOnBlockDestroy = itemDroppedOnBlockDestroy1;
+
+ }
+
+ public String unlocalizedName;
+ Class<? extends TileEntity> teclass;
+ boolean isNormalBlock = true;
+ boolean hasSpecialBlockRenderer = false;
+ int specialBlockRendererId = -2;
+ ItemStack itemDroppedOnBlockDestroy;
+ }
+
+ @Override
+ public int getRenderType() {
+ if (this.type.hasSpecialBlockRenderer) {
+ return IHLMod.proxy.shareBlockRendererByMachineType(this.type);
+ }
+ return this.type.specialBlockRendererId;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return this.type == null ? false : this.type.isNormalBlock;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return this.type.isNormalBlock;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public IIcon getAdditionalIconsForBlockRenderer(int flag) {
+ switch (this.type) {
+ case SolarEvaporator:
+ return this.solarEvaporatorSide;
+ case BronzeTub:
+ return this.bronzeTubSide;
+ default:
+ return this.blockIcon;
+ }
+ }
+}
\ No newline at end of file diff --git a/src/main/java/ihl/items_blocks/RecipeInputs.java b/src/main/java/ihl/items_blocks/RecipeInputs.java new file mode 100644 index 0000000..6b49ce2 --- /dev/null +++ b/src/main/java/ihl/items_blocks/RecipeInputs.java @@ -0,0 +1,25 @@ +package ihl.items_blocks;
+
+import ic2.api.recipe.IRecipeInput;
+import ic2.api.recipe.RecipeInputItemStack;
+import ic2.api.recipe.RecipeInputOreDict;
+import ihl.utils.IHLUtils;
+
+public class RecipeInputs
+{
+ public static IRecipeInput cutter = new RecipeInputOreDict("craftingToolWireCutter");
+ public static IRecipeInput saw = new RecipeInputOreDict("craftingToolSaw");
+ public static IRecipeInput file = new RecipeInputOreDict("craftingToolFile");
+ public static IRecipeInput vise = new RecipeInputItemStack(IHLUtils.getThisModItemStack("viseSteel"));
+ public static IRecipeInput plateSteel = new RecipeInputOreDict("plateSteel");
+ public static IRecipeInput hammer = new RecipeInputOreDict("craftingToolHardHammer");
+
+ public static IRecipeInput get(String name, int amount)
+ {
+ return new RecipeInputItemStack(IHLUtils.getThisModItemStackWithSize(name,amount),amount);
+ }
+ public static IRecipeInput get(String name)
+ {
+ return new RecipeInputItemStack(IHLUtils.getThisModItemStack(name));
+ }
+}
|
