Support Request: I decompile IC2,but got errors

  • I decompile IndustrialCraft 2 ,I want to develop the addon.
    But got some errors when I start minecraft with eclipse.



    Caused by: java.lang.NullPointerException
    at net.minecraft.src.ItemStack.<init>(ItemStack.java:31)
    at net.minecraft.src.ItemStack.<init>(ItemStack.java:26)
    at net.minecraft.src.ic2.common.ItemScrapbox.addDrop(ItemScrapbox.java:117)
    at net.minecraft.src.ic2.common.ItemScrapbox.<init>(ItemScrapbox.java:75)
    at net.minecraft.src.mod_IC2.<clinit>(mod_IC2.java:243)
    ... 15 more


    How to solve it ?


    ------------------------
    My English is poor , sorry. :P

    • Official Post

    If you can't fix NPEs by yourself, you REEEEALLY shouldn't be trying to create mods.


    IC² is quite complex, probably MCP can't recompile it perfectly and will create some errors like this one. Fix them, create your mod, you can assume that a recompiled version of your mod will work fine with a original version of IC².

  • If MCP can't recompile IC2, how do you do it?
    And if you were to make a mod to go over IC2, how would you edit the stuff that IC2 already has (you can do that for private use can't you?)
    :)

  • I've run into this problem too. It happens because the decompiler breaks the order of the initializers in mod_IC2.java.
    I fixed mine a much more tedious way, but this should work too, although I haven't tried it, and I don't know if other items have the same problem as well:

    • Open net.minecraft.src.mod_IC2
    • Find a line starting with "public static Item itemScrapBox"
    • Change that line so all it says is

      Code
      public static Item itemScrapBox;


    • Gol to the end of the file, and scroll up until you find a line starting with "itemArmorAlloyChestplate = "
    • Underneath that line, add

      Code
      itemScrapBox = (new ItemScrapbox(getItemIdFor("itemScrapbox", 29883), 159)).setItemName("itemScrapbox");


    Disappointed with the bugs and nerfedness of AtomicStryker Corp's Advanced Machines, and the unupdatedness of Snyke's Enterprises?
    Need low-lag renewable power?
    Come to ImmTech Intragalactical this thread for free UUM!

    Note: UUM may stand for Unnerfed Unbuggy Updated Machines and may not be actual UUM. The extra U was lost due to a bit error.
    Battery snot included.