[Solved] Can't hammer some copper ingots.

  • I have four mods that add copper ingots:

    Arcana RPG,

    Soul Forest,

    End Ores,

    and IC2 itself...

    The new copper ingot from the End Ores mod can be smashed. But the other two, from Arcana RPG & Soul Forest, can't.

    I tried registering them as ingotCopper but that didn't work.

    Java: Class.java
    if(Loader.isModLoaded("gibby_dungeons")) { //Arcana RPG
        OreDictionary.registerOre("ingotCopper", new ItemStack(GameRegistry.findBlock("gibby_dungeons", "dungeons_copper")));
    }
    
    if(Loader.isModLoaded("soulforest")) { //Soul Forest
        OreDictionary.registerOre("ingotCopper", new ItemStack(GameRegistry.findBlock("soulforest", "Copperingot")));
    }

    How can I get ingots from other mods to be smashed with a hammer? How does End Ores do it?

    MC-1.7.10

  • I'm registering them at the FMLInitializationEvent

    Like this:

    Java
    public void init(FMLInitializationEvent event)
        {
            initOreDict();
        }
    
    public static void initOreDict() {
        if(Loader.isModLoaded("gibby_dungeons")) {
                OreDictionary.registerOre("ingotCopper", new ItemStack(GameRegistry.findBlock("gibby_dungeons", "dungeons_copper")));
            }
    }
  • I tried,

    System.out.println("ITEMSTACK OUT >> "+ new ItemStack(GameRegistry.findBlock("soulforest", "Copperingot")).getUnlocalizedName());

    and also,

    System.out.println("ITEMSTACK OUT >> "+ new ItemStack(GameRegistry.findBlock("soulforest", "Copperingot")));

    And it crashed both times:

    crash-2017-08-19_02.38.24-client

    ---- Minecraft Crash Report ----

    // On the bright side, I bought you a teddy bear!

    Time: 8/19/17 2:38 AM

    Description: Initializing game

    java.lang.NullPointerException: Initializing game

    at net.minecraft.item.ItemStack.getUnlocalizedName(ItemStack.java:449)

    at com.zephaniahnoah.ic2_rpg_addon.IC2RPGAddon.initRecipes(IC2RPGAddon.java:148)

    at com.zephaniahnoah.ic2_rpg_addon.IC2RPGAddon.init(IC2RPGAddon.java:31)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

    at com.google.common.eventbus.EventBus.post(EventBus.java:275)

    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)

    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

    at com.google.common.eventbus.EventBus.post(EventBus.java:275)

    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

    at cpw.mods.fml.common.Loader.initializeMods(Loader.java:742)

    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311)

    at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

    at net.minecraft.client.Minecraft.run(Minecraft.java:942)

    at net.minecraft.client.main.Main.main(Main.java:164)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

    at GradleStart.main(Unknown Source)


    A detailed walkthrough of the error, its code path and all known details is as follows:

    ---------------------------------------------------------------------------------------

    -- Head --

    Stacktrace:

    at net.minecraft.item.ItemStack.getUnlocalizedName(ItemStack.java:449)

    at com.zephaniahnoah.ic2_rpg_addon.IC2RPGAddon.initRecipes(IC2RPGAddon.java:148)

    at com.zephaniahnoah.ic2_rpg_addon.IC2RPGAddon.init(IC2RPGAddon.java:31)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

    at com.google.common.eventbus.EventBus.post(EventBus.java:275)

    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)

    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)

    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

    at com.google.common.eventbus.EventBus.post(EventBus.java:275)

    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

    at cpw.mods.fml.common.Loader.initializeMods(Loader.java:742)

    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311)

    at net.minecraft.client.Minecraft.startGame(Minecraft.java:597)

    -- Initialization --

    Details:

    Stacktrace:

    at net.minecraft.client.Minecraft.run(Minecraft.java:942)

    at net.minecraft.client.main.Main.main(Main.java:164)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

    at GradleStart.main(Unknown Source)

    -- System Details --

    Details:

    Minecraft Version: 1.7.10

    Operating System: Windows 8.1 (amd64) version 6.3

    Java Version: 1.7.0_80, Oracle Corporation

    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation

    Memory: 867071048 bytes (826 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 7 mods loaded, 7 mods active

    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    UCHIJ mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

    UCHIJ FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar)

    UCHIJ Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar)

    UCHIJ CodeChickenCore{1.0.7.47} [CodeChicken Core] (minecraft.jar)

    UCHIE ic2rpg{1.1} [IC2 RPG Addon] (bin)

    UCHIJ IC2{2.2.828-experimental} [IndustrialCraft 2] (industrialcraft-2-2.2.828-experimental-dev.jar)

    UCHIJ soulforest{1.9.75} [Soul Forest Mod] (soulforest-1.7.10-1.9.75.jar)

    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 385.28' Renderer: 'GeForce GT 650M/PCIe/SSE2'

    Launched Version: 1.7.10

    LWJGL: 2.9.1

    OpenGL: GeForce GT 650M/PCIe/SSE2 GL version 4.5.0 NVIDIA 385.28, NVIDIA Corporation

    GL Caps: Using GL 1.3 multitexturing.

    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

    Anisotropic filtering is supported and maximum anisotropy is 16.

    Shaders are available because OpenGL 2.1 is supported.

    Is Modded: Definitely; Client brand changed to 'fml,forge'

    Type: Client (map_client.txt)

    Resource Packs: []

    Current Language: English (US)

    Profiler Position: N/A (disabled)

    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    Anisotropic Filtering: Off (1)

    Does that mean that the stack is empty?

    I also tried it at FMLPostInitializationEvent instead of FMLInitializationEvent and that didn't work.

  • Aha! I found something interesting...

    Console

    [03:37:56] [Client thread/WARN] [FML]: ****************************************
    [03:37:56] [Client thread/WARN] [FML]: * Invalid registration attempt for an Ore Dictionary item with name ingotCopper has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.
    [03:37:56] [Client thread/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOreImpl(OreDictionary.java:522)
    [03:37:56] [Client thread/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:501)
    [03:37:56] [Client thread/WARN] [FML]: * at com.zephaniahnoah.ic2_rpg_addon.IC2RPGAddon.initRecipes(IC2RPGAddon.java:147)
    [03:37:56] [Client thread/WARN] [FML]: * at com.zephaniahnoah.ic2_rpg_addon.IC2RPGAddon.init(IC2RPGAddon.java:31)
    [03:37:56] [Client thread/WARN] [FML]: * at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [03:37:56] [Client thread/WARN] [FML]: * at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)...
    [03:37:56] [Client thread/WARN] [FML]: ***************************************