Posted June 25, 20169 yr A few years ago I made minecraft mods, then I quit. I come back to see that on the new 1.10 forge registerItem has been deprecated. I do not at all understand how the new registry system works. Can someone help me? There are 10 types of people in this world. Those who know binary and those who don't.
June 25, 20169 yr The deprecated GameRegistry methods tell you their replacements in their doc comments. The registration process is the same for any IForgeRegistryEntry implementation (e.g. Block , Item , Biome ): Call setRegistryName to set the registry name of the object Call GameRegistry.register(IForgeRegistryEntry) to register it The main change from the old system is that GameRegistry.register won't create an ItemBlock for your Block , you need to create and register it yourself. Some older tutorials will tell you to use the unlocalised name as the registry name or model location, don't do this. Registry names are IDs, they must be unique and can't change. Unlocalised names are only for translation/display purposes, don't have to be unique and may change at any time. The default model loaded for every Item is the one with its registry name, so use this as the default model location for your items. If the registry and unlocalised names of an object are the same, set the registry name and then set the unlocalised name to the registry name ( setRegistryName("foo"); setUnlocalisedName(getRegistryName()); ). This has the benefit of including your mod ID in the unlocalised name, preventing localisation conflicts with other mods. If the unlocalised name changes later on, set it separately instead of using the registry name. 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.
June 27, 20169 yr Where are you now supposed to set the in-game name for the Item? I seem to have pretty much all the things in place, but it is still displayed as item.epsetestmod.pocketCalculator.name I have a private final String name = "someName"; and a getter for it (getName). Also doesn't work with the name being public. Read the docs they said. There no be docs
June 27, 20169 yr Where are you now supposed to set the in-game name for the Item? I seem to have pretty much all the things in place, but it is still displayed as item.epsetestmod.pocketCalculator.name I have a private final String name = "someName"; and a getter for it (getName). Also doesn't work with the name being public. Nothing changed with regards to unlocalised and localised names, you still set the unlocalised name with setUnlocalizedName() and then defined the localised name in the .lang file. What version did you last mod in?
June 27, 20169 yr EDIT: read the IronChests source code. It works. What I saw is actually what is supposed to happen Well, that thing is something I read somewhere. I already had this line: this.setUnlocalizedName(name); but I still don't get an in-game name for my Item. Read the docs they said. There no be docs
June 27, 20169 yr You need to create localization files in resources/asstets/modid/lang/ for your mod. where you specify unlocalizedName=Localized Name
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.