Posted August 9, 20169 yr When I run my Minecraft mod, it runs fine for a few seconds, but then crashes before I get to the title screen. The console says, "AL lib: (EE) alc_cleanup: 1 device not closed". Forge crash report ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 8/9/16 3:15 PM Description: Initializing game java.lang.IllegalArgumentException: Attempted to register a item with conflicting names. Old: renewabilitymod:chain_mail New: chain_mail at net.minecraftforge.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:423) at main.ModItems.items(ModItems.java:17) at com.renewability.renewabilitymod.RenewabilityMod.init(RenewabilityMod.java:24) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:575) 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 net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213) 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 net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:774) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:322) at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) at net.minecraft.client.Minecraft.run(Minecraft.java:386) at net.minecraft.client.main.Main.main(Main.java:118) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraftforge.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:423) at main.ModItems.items(ModItems.java:17) at com.renewability.renewabilitymod.RenewabilityMod.init(RenewabilityMod.java:24) 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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:575) 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 net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213) 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 net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:774) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:322) at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:386) at net.minecraft.client.main.Main.main(Main.java:118) 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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.10 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 660494800 bytes (629 MB) / 1257766912 bytes (1199 MB) up to 2837446656 bytes (2706 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.32 Powered by Forge 12.18.0.2000 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHI mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHI FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10-12.18.0.2000-1.10.0.jar) UCHI Forge{12.18.0.2000} [Minecraft Forge] (forgeSrc-1.10-12.18.0.2000-1.10.0.jar) UCHE renewabilitymod{1.10} [renewabilitymod] (bin) Loaded coremods (and transformers): GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4463' Renderer: 'Intel® HD Graphics 4400' Launched Version: 1.10 LWJGL: 2.9.4 OpenGL: Intel® HD Graphics 4400 GL version 4.3.0 - Build 20.19.15.4463, Intel GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes 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) CPU: 4x Intel® Core i5-4200U CPU @ 1.60GHz If people call you garbage, don't let them stop you from doing great things. It's called a garbage can, not a garbage can't.
August 10, 20169 yr Author Please read the actual error message, it clearly tells you whats wrong (especially if you then look at the code that's producing it). Also, stop using deprecated methods. From my best guess, it has something to do with registering items. I haven't been able to properly learn how to register an item in versions 1.8 and later. Can you please teach me? Also, if registerItem() is deprecated, what should I use instead? If people call you garbage, don't let them stop you from doing great things. It's called a garbage can, not a garbage can't.
August 10, 20169 yr register(IForgeRegistryObject) Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 11, 20169 yr Author register(IForgeRegistryObject) What's an IForgeRegistryObject? If people call you garbage, don't let them stop you from doing great things. It's called a garbage can, not a garbage can't.
August 11, 20169 yr Almost anything is an IForgeRegistryObject Items and Blocks are the mainly used one but Enchantments and PotionEffects(something to do with potions). You need to call setRegistryName on the object first or it will not work, but for blocks you need to register the item as well as the blocks themselves or there won't be any Item for the block. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 11, 20169 yr The interface is actually called IForgeRegistryEntry and the method to register it is GameRegistry.register . Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
August 11, 20169 yr Thanks, I could not remember the exact interface name and was unable to look it up (traveling). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 11, 20169 yr For registering blocks and items I have in both item and block libraries a register fuction for when I'm registering things. Here's the item version: public static void regItems(Item item){ GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); } } Here's the block version: public static void regBlocks(Block block){ GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5)); } } All in All, they're very similar. EDIT: And I've just posted for no reason it seemes. I just looked at the date of the first post and BAM! from the 9. :P Well if someone else is having trouble with the same thing, they could get some info out of this.
August 11, 20169 yr For registering blocks and items I have in both item and block libraries a register fuction for when I'm registering things. Here's the item version: public static void regItems(Item item){ GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); } } Here's the block version: public static void regBlocks(Block block){ GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5)); } } All in All, they're very similar. EDIT: And I've just posted for no reason it seemes. I just looked at the date of the first post and BAM! from the 9. :P Well if someone else is having trouble with the same thing, they could get some info out of this. Dont use the deprecated version use the GameRegistry.register (item.setRegistryName (name) not unlocalized name VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 11, 20169 yr For registering blocks and items I have in both item and block libraries a register fuction for when I'm registering things. Here's the item version: public static void regItems(Item item){ GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); } } Here's the block version: public static void regBlocks(Block block){ GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5)); } } All in All, they're very similar. EDIT: And I've just posted for no reason it seemes. I just looked at the date of the first post and BAM! from the 9. :P Well if someone else is having trouble with the same thing, they could get some info out of this. Dont use the deprecated version use the GameRegistry.register (item.setRegistryName (name) not unlocalized name I don't see the problem with the code I gave. I use it in my 1.10.2 mod and it works perfectly.
August 11, 20169 yr For registering blocks and items I have in both item and block libraries a register fuction for when I'm registering things. Here's the item version: public static void regItems(Item item){ GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); } } Here's the block version: public static void regBlocks(Block block){ GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5)); } } All in All, they're very similar. EDIT: And I've just posted for no reason it seemes. I just looked at the date of the first post and BAM! from the 9. :P Well if someone else is having trouble with the same thing, they could get some info out of this. Dont use the deprecated version use the GameRegistry.register (item.setRegistryName (name) not unlocalized name I don't see the problem with the code I gave. I use it in my 1.10.2 mod and it works perfectly. The problem is that it will be removed in the next version of minecraft and you will need to change it anyway. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 11, 20169 yr For registering blocks and items I have in both item and block libraries a register fuction for when I'm registering things. Here's the item version: public static void regItems(Item item){ GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); } } Here's the block version: public static void regBlocks(Block block){ GameRegistry.registerBlock(block, block.getUnlocalizedName().substring(5)); } } All in All, they're very similar. EDIT: And I've just posted for no reason it seemes. I just looked at the date of the first post and BAM! from the 9. :P Well if someone else is having trouble with the same thing, they could get some info out of this. Dont use the deprecated version use the GameRegistry.register (item.setRegistryName (name) not unlocalized name I don't see the problem with the code I gave. I use it in my 1.10.2 mod and it works perfectly. The problem is that it will be removed in the next version of minecraft and you will need to change it anyway. Really!? I really need to get up-to-date with the next updates then!
August 11, 20169 yr Yes, "Really!"... That's what @Deprecated means... it's not there for show... Sorry! I'm used to using C# not Java!
August 11, 20169 yr C# had ways to mark methods as deprecated too. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 11, 20169 yr C# had ways to mark methods as deprecated too. Yes, but I wrote all my code aswell. Which doesn't help when making mods.
August 11, 20169 yr I mean the fact that after using the method it gets a nice line through it that's supposed to hint to you, "Hey dummy! This method is deprecated!" And then you look at the Javadoc (C# had something similar too) and read it and think, "Oh, this method is deprecated and tells me what to use instead, maybe I should dip that thing." Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 11, 20169 yr Author In my code right now, my item is being registered twice. Is it better to register all the items in one class, or is it better to register each item in its own class? If people call you garbage, don't let them stop you from doing great things. It's called a garbage can, not a garbage can't.
August 12, 20169 yr I have multiple ways you could do this. 1. In the constructor of the class you can add this to an array in a class then have a method that loops through all of the values in the array and register them. 2. You could pass a string into the constructor of your items class and register them there as you said. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 12, 20169 yr Author Almost anything is an IForgeRegistryObject Items and Blocks are the mainly used one but Enchantments and PotionEffects(something to do with potions). You need to call setRegistryName on the object first or it will not work, but for blocks you need to register the item as well as the blocks themselves or there won't be any Item for the block. This was slightly confusing. Can you please give an example or link me to a tutorial that's up-to-date? If people call you garbage, don't let them stop you from doing great things. It's called a garbage can, not a garbage can't.
August 12, 20169 yr You can look at the link in my signature and look at my RegistryHelper class for an example on how that is handled. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 13, 20169 yr Author You can look at the link in my signature and look at my RegistryHelper class for an example on how that is handled. Thanks. It's registered now. If people call you garbage, don't let them stop you from doing great things. It's called a garbage can, not a garbage can't.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.