Oh my gosh! I feel so stupid. I was using GameRegistry.findBlock instead of GameRegistry.findItem...
It works now
Oh my gosh! I feel so stupid. I was using GameRegistry.findBlock instead of GameRegistry.findItem...
It works now
Yes I'm using the correct names. I can even do /give Player123 soulforest:Copperingot or gibby_dungeons:dungeons_copper
Aha! I found something interesting...
[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]: ***************************************
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:
---- 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.
I'm registering them at the FMLInitializationEvent
Like this:
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.
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
Released here. If anyone wants to download it. Will add support for other mods at some point.
Ah, so that's what that's for. Thank you. It works fine now.
EDIT: You made a small typo though. It's supposed to be NBTTagCompound not NBTTagCompount
I'm creating an addon for IC2, similar to the old 1.6.4 JAMI addon but for 1.7.10. I'm starting on adding interaction with DivineRPG and I was able to successfully add macerator recipes thanks to Speiger's example. But I'm having trouble adding recipes for the Ore Washing Plant. I added the code as you can see from in the code block. I get no errors in eclipse and the game doesn't crash but nothing happens when I put the crushed ores in the Ore Washing Plant. Other Crushed Ores will get washed but the ones from the recipe I tried to add don't.
ItemStack oreWashing_input = new ItemStack(crushedRupeeOre, 1);
ItemStack oreWashing_output = new ItemStack(purifiedRupeeOre, 1);
ItemStack oreWashing_output2 = new ItemStack(Items.string, 2);//String for testing. Change to respective tiny dust.
ItemStack oreWashing_output3 = new ItemStack(Items.wheat_seeds, 1);//Seeds for testing. Change to IC2 stone dust.
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(oreWashing_input), null, oreWashing_output, oreWashing_output2, oreWashing_output3);
MC: 1.7.10
IC2: 2.2.828
Forge: 10.13.4.1614
Mods folder: IC2-dev, DivineRPG, CodeChickenCore-dev
That's the first time someone reported this, I need more information than that. Corruption usually involves a crash or at least log entries.
There was no crash. Just quite a large framerate drop and a bunch of lag spikes which slowly ceased. And a bunch of missing chunks. I checked In mcedit and a quarter of the map was missing. It was replaced with the flatworld it originally was, and all structures and terraformings were missing. It may have been due to incompatible mods that were installed alongside it. Here's the log...