Jump to content

[Solved, Sort of, but DO NOT worry about this] Changes with 1.11 from 1.10.2


EscapeMC

Recommended Posts

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?

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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.

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

Set the unlocalized name to the registry name:

blockOrItem.setUnlocalizedName(blockOrItem.getRegistryName())

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.

Link to comment
Share on other sites

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 )

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.

Link to comment
Share on other sites

Call ModelLoader.setCustomModelResourceLocation(...) for your item.

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.

Link to comment
Share on other sites

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?

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

HOW can I subscribe to ModelRegistryEvent
http://mcforge.readthedocs.io/en/latest/events/intro/

 

use ModelLoader.setCustomModelResourceLocation
It'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?

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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 .

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.

Link to comment
Share on other sites

Install the JSON Editor Plugin in Eclipse, or if you are using IntelliJ, find an equivalent plugin.

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.

Link to comment
Share on other sites

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?

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.