EscapeMC Posted December 9, 2016 Posted December 9, 2016 So, I have a mod, and I made it into 1.10.2. NOW I need to make it to 1.11. What changes are there? GameRegistry.registerItem is no longer a thing... so what do I do? Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
EscapeMC Posted December 9, 2016 Author Posted December 9, 2016 So, here. I have made a server and client proxy. I have my main.java class, and I am now in a separate class that I use to make/register items. I have (For Example): packake com.escapemc.modname.init imports .... public class ModItems { public static Item example_ingot; public static void init() { example_ingot = new Item().setUnlocalizedName("example_ingot"); } public static void register() { GameRegistery.register(example_ingot); } } is that all I need for registering the item? And then for the texture, would I use public static void registerRenders() { registerRender(example_ingot); } along with public static void registerRender(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } after? EDIT: Sorry for spelling errors, I did not copy this directly from my code, rather typed it all up inside the code][/code thing Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
EscapeMC Posted December 9, 2016 Author Posted December 9, 2016 You need to set the registry name as well. Also your way of registering models has been outdated since at least 1.8.9, use ModelLoader.setCustomModelResourceLocation in ModelRegistryEvent . Wait, so what I must I put, and where? GameRegistry.register(What Here); And where do I use ModelLoader.setCustomModelResourceLocation? Where specifically. Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
EscapeMC Posted December 9, 2016 Author Posted December 9, 2016 Ok, public static Item escapemc_ingot; public static void init() { escapemc_ingot = new Item().setUnlocalizedName("escapemc_ingot").setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab).setRegistryName("escapemc_ingot"); } public static void register() { GameRegistry.register(escapemc_ingot, [WHAT HERE? I am confused]); } public static void registerRenders() { registerRender(escapemc_ingot); [is THIS section correct too?] } public static void registerRender(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } I am still confused about where I use ModelLoader.setCustomModelResourceLocation Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
EscapeMC Posted December 9, 2016 Author Posted December 9, 2016 GameRegistry.register(escapemc_ingot, [WHAT HERE? I am confused]);Nothing there, since you already set the registry name before. Either you use the overload that takes the registry name or you set it before. Not both. Moreover, you do not need to include your ModID in your registry name, FML automatically prefixes it, as opposed to the unlocalized name. Ok, so for this, do I use both unlocalized name AND registry name? and for that section where I put "[WHAT HERE? I am confused]", do I put null? I am about to read the documentation, so I will update you on that as I get questions/nee help Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
Draco18s Posted December 9, 2016 Posted December 9, 2016 Set the unlocalized name to the registry name: blockOrItem.setUnlocalizedName(blockOrItem.getRegistryName()) Quote 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.
jeffryfisher Posted December 9, 2016 Posted December 9, 2016 And: I just learned that all resource file names must be all lower case. Quote The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
EscapeMC Posted December 9, 2016 Author Posted December 9, 2016 Ok, I am still SO confused. I am making an ingot. escapemc_ingot (long story on the name) I do public static Item There, now it is a thing that can be called. Now, in another thing, I have public static void init() { escapemc_ingot = new Item().setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab).setRegistryName("escapemc_ingot"); } After that, public static void register() { GameRegistry.register(escapemc_ingot, null); } //In that null, WHAT DO I PUT? Later, I know I need to register render, but how? Could someone, in full detail, tell me everything I would need to add to make this ingot a reality in my game, with the texture I have (in the correct place, resources>assets>modid>textures>items ) Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
Draco18s Posted December 9, 2016 Posted December 9, 2016 Call ModelLoader.setCustomModelResourceLocation(...) for your item. Quote 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.
EscapeMC Posted December 10, 2016 Author Posted December 10, 2016 Ok, so for now I am focusing on the GameRegistry.register. AFTER I will work with the ModelRegistryEvent, I am still confused on HOW to call it with my item. So, I have escapemc_ingot = new Item().setUnlocalizedName("escapemc_ingot").setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab); Is this all I need in my item at that point? Then, later, for registering the item. GameRegistry.register(escapemc_ingot, escapemc_ingot.setRegistryName("escapemc_ingot")); This gives me the error of i need to change GameRegistry.register to registerItem, which I know I need to avoid. How can I fix these two things (literally, what do I need to put in. Is it possible you can comment the code I need?) so it all clears? Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
61352151511 Posted December 10, 2016 Posted December 10, 2016 escapemc_ingot = new Item().setUnlocalizedName("escapemc_ingot").setRegistryName("escapemc_ingot").setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab); GameRegistry.register(escapemc_ingot); Quote
EscapeMC Posted December 10, 2016 Author Posted December 10, 2016 escapemc_ingot = new Item().setUnlocalizedName("escapemc_ingot").setRegistryName("escapemc_ingot").setCreativeTab(TeamMadnessMod.TeamMadnessModMaterialsTab); GameRegistry.register(escapemc_ingot); Ok, thank you! For some reason I tried that earlier and the game wouldn't load... Hmf... Now. For Later, I know I need to register render, but how?You subscribe to ModelRegistryEvent , like I already told you. In there you can use ModelLoader.setCustomModelResourceLocation to register the model for your items. I also told you that already. HOW can I subscribe to ModelRegistryEvent and use ModelLoader.setCustomModelResourceLocation Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
EscapeMC Posted December 10, 2016 Author Posted December 10, 2016 HOW can I subscribe to ModelRegistryEvent http://mcforge.readthedocs.io/en/latest/events/intro/ use ModelLoader.setCustomModelResourceLocationIt's a method. You call it. You do know how to call methods, right? Yes I know how to. I just don't know how to use this ModelLoader.setCustomModelResourceLocation with my items for registering renders. So, should I make another class for registering items? Or is it possible that I can use ModelLoader inside of my class I am using to make items? Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
trollworkout Posted December 10, 2016 Posted December 10, 2016 in 1.11 ALL resources need to be lowercase this includes: unlocalized names, registry names, file names, and pretty much any id like entity id, living entity id etc etc Item item = new Item().setRegistryName("item").setUnlocalizedName(ModId + ":" + "item") GameRegistry.register(item) The models have to be registered on the client side otherwise will cause a crash on the server. ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); But to be fair the lowercase enforcement was the only change brought in 1.11 the other stuff is same as 1.10 have a look at what i did here https://github.com/trollworkout/technorcery/tree/master/src/main/java/com/technorcery common is where the common stuff + common proxy (called Proxy) is and client is where the client stuff including the item model handler which registers the item models Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
EscapeMC Posted December 10, 2016 Author Posted December 10, 2016 Ok, so I made a new class for ItemModelsHandler (Thanks troll for helping me with this part!) So now, what must I do? I "loadModel"ed all my item textures, but when I go in game, none of the textures are loaded in. What must I do (and where) to get the textures to work? GitHub: https://github.com/EcapeMC/TeamMadnessMod 1.10.2/tree/master/main/java/com/escapemc/teammadnessmod Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
EscapeMC Posted December 10, 2016 Author Posted December 10, 2016 The link didn't work properly. There is a - in the link, and the forum recognizes it as the end of the link. Just copy the whole thing, and put it in the URL https://github.com/EcapeMC/TeamMadnessMod-1.10.2/tree/master/main/java/com/escapemc/teammadnessmod Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
trollworkout Posted December 11, 2016 Posted December 11, 2016 my code is fully functional and tested. i recommend you pick an item say IngotCopper and follow it see how i declare and how i make the json file DO NOT edit json files with shitter text editors. you need to have profesh ones and even verify the json file. if json files is malformed sometimes it will simply not work and no error is thrown. it only throws errors if json cannot be found. you need to eliminate all your issues one by one. if you see any errors it tells you exactly what you're doing wrong. if no errors is likely your tex file or json may be incorrect path/bad/unreadable/broken etc. from over here there's not much i can do other than simply point you in the right direction . Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
Draco18s Posted December 11, 2016 Posted December 11, 2016 Install the JSON Editor Plugin in Eclipse, or if you are using IntelliJ, find an equivalent plugin. Quote 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.
EscapeMC Posted December 12, 2016 Author Posted December 12, 2016 I think I am just going to restart my 1.9.4/1.10.2 Version of my mod, and instead of using the code from my 1.8 version then editing it, I am going to just going to code the whole thing again following 1.10.2. Yes, I probably sound like an idiot right now. Go ahead, and feel free to think of me as a noob for this. Thank you to all for your advice, and you can bet I will be using all of it for making my 1.10.2/1.9.4 version!!! Can a mod lock this thread? Quote I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But...... https://www.youtube.com/watch?v=6t0GlXWx_PY ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2 TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2 If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.
Recommended Posts
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.