Jump to content

c-ab-o-o-s-e

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by c-ab-o-o-s-e

  1. Ahh was it because there was 2 different declerations of the ID fields one being public static int panelBlockID; and the other being in the preInit int panelBlockID.
  2. I understand that 1.7 gets rid of the need for ID's, but this is being targeted towards people that still on 1.6.4. I just finished going over the tutorial on the forums here and when I go to run it I always get slot 0 is already occupied when trying to add the second block. The code:
  3. I was close.... i just didn't do the copy.
  4. If its not too much trouble. I did the override but it still consumes the item. Can I get an example/skeleton on what you mean? I do a lot better when I can see what I'm trying to learn. I looked at a couple open source mods but they do it a different way. Your method seems like it would be a lot better but never seen it in use. If you don't want to write code for me is there a reference I can look at?
  5. I would like for when I use a item in a recipe is damages it. Like the hammer from Ic2. Would it be part of the CraftingEvent.
  6. Alright I been working on a recipe list. I just took bits out of the vanilla code and trying to modify it. I believe I got the list setup properly to accept two items but I'm unsure on how to return it properly in the getSmeltingResult() public class CarbonWeaverRecipes { private static final CarbonWeaverRecipes smeltingBase = new CarbonWeaverRecipes(); /** The list of smelting results. */ private Map smeltingList = new HashMap(); private Map experienceList = new HashMap(); private HashMap<List<Integer>, ItemStack> metaSmeltingList = new HashMap<List<Integer>, ItemStack>(); private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>(); /** * Used to call methods addSmelting and getSmeltingResult. */ public static final CarbonWeaverRecipes smelting() { return smeltingBase; } private CarbonWeaverRecipes() { this.addSmeltingOxy(SuperNova.denseCoal.itemID, SuperNova.titaniumIngots.itemID, new ItemStack(SuperNova.carbonFuel)); } /** * Adds a smelting recipe. */ public void addSmeltingOxy(int par1, int par2, ItemStack par3ItemStack) { this.smeltingList.put(Integer.valueOf(par1), Integer.valueOf(par2)); } /** * Returns the smelting result of an item. * Deprecated in favor of a metadata sensitive version */ @Deprecated public ItemStack getSmeltingResult(int par1) { return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); } public Map getSmeltingList() { return this.smeltingList; } /** * Used to get the resulting ItemStack form a source ItemStack * @param item The Source ItemStack * @return The result ItemStack */ public ItemStack getSmeltingResult(ItemStack item) { if (item == null) { return null; } ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); if (ret != null) { return ret; } return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); } public Map<List<Integer>, ItemStack> getMetaSmeltingList() { return metaSmeltingList; } }
  7. yea that should work perfectly. At the moment I only have a couple to do. In the future though how would I make it bit more flexible just in case if I want to expand plus I'd like to have the knowledge.
  8. Maybe im just being an idiot or something and not understanding what your saying. Don't i have to make my own version of furnace recipes in order to handle 2 inputs?
  9. OK I understand all the checks. The thing I'm still fuzzy on is making the recipe list itself I wanted to make a method something like... addSmelting(ItemStack output, int input1, int input2){ } It would accept 2 ids and give back the itemstack of the item to be received.
  10. What would be the best way to make a furnace that requires 2 different items to be able to get the output?
  11. No. I really don't know what I'm doing. Why I'm here trying to learn, as well as looking for every tutorial I can to figure out how it works. Thanks for the help I don't intend to seem like and Idiot. I used the example you gave me to make it how I wanted. public CarbonBattery(int id, int maxPower) { super(id); this.setMaxDamage(maxPower); } public void addInformation(ItemStack stack, EntityPlayer entityplayer, List list, boolean extendedToolTips){ list.add("Power Left: " + (this.getMaxDamage() - stack.getItemDamage()) + "/" + this.getMaxDamage()); } } So now it will display "Power Left: 1000/1000" and will count down.
  12. I thought it would be part of the this.setInfo because that is what gets put into the list. I found this code here on the forums for the addInformation and understand all but the ItemStack and boolean, but I'm assuming the boolean is for if you want to do something like isDamaged()
  13. Wait exactly where do I put this. My item im trying to get the damage of hasn't been set to an ItemStack.
  14. The idea is I have a battery and I want the tool tip to say "Power Left: " and then how much power the battery has in it at the moment it is registered with a max power of 10000 (using metadata) but I'm unsure on how to get the current damage value to add to the end of the string. This is the battery class the damage and id are registered in the main class public class CarbonBattery extends Item { private final String setInfo; private final String setColor; public CarbonBattery(int id, int maxPower) { super(id); this.setMaxDamage(maxPower); this.setInfo = "Power Left: "; this.setColor = "\u00A75"; } public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean bool){ list.add(setToolTipData()); } private String setToolTipData(){ return this.setColor + this.setInfo; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.