Jump to content

Recommended Posts

Posted

Okay, so I have some custom classes (BaseItem, BasePickaxe, BaseSword, and BaseAxe) that I use to create new items pretty easily. They will automatically run some basic functions and register themselves to the GameRegistry, as well as adding themselves to an ArrayList<Item>. I have a class by the name of RSItems that is called during the preInit and init methods of my main class.

 

The preInit method creates the items. Currently that's all that it does.

 

 

public static void preInit() {
   new BaseItem("cord");
   new BaseItem("branch");
   new BasePickaxe("rocktool", RealisticSurvival.MATERIALFLINT);
   new BaseSword("flintKnife", RealisticSurvival.MATERIALFLINT);
   new BaseAxe("flintAxe", RealisticSurvival.MATERIALFLINT);
   new BaseItem("flintaxehead");
}

 

 

 

The init method loops through the ArrayList and registers them for rendering.

 

public static void init() {
   ItemModelMesher m = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
   for (Item i : items) {
      m.register(i, 0, new ModelResourceLocation(RealisticSurvival.MODID + ":" + i.getUnlocalizedName().substring(5), "inventory"));
   }
}

 

 

Now, for whatever reason, after the BaseItem with the argument of "cord" is created, nothing really works anymore. None of the items after that have their correct textures, and most don't even have a texture anymore. Am I doing something wrong? I haven't the slightest idea as to what's happening.

Posted

hey you are the guy from realistic surviver

 

i think i know what is happening and i tink is a bug very rare but idont wana write that long again here is the post

i have trouble whit mixed textures and found that feature / bug

http://www.minecraftforge.net/forum/index.php/topic,25815.0.html

 

Hey! Didn't think anyone would recognize me, haha!

 

Anyways, I went and reorganized their definitions by ID, but they still don't work. Most still don't have textures, and the texture shift is still a bit different. If it makes a difference though, the IDs jump from 4098 to 4104, which seems odd to me.

Posted

you have a bigger mod than mine for sure

 

?? you have only one mod loaded in the forge at time  maiby the losing ids are in other set of items

can you do this trick

 

in one item not loading the texture change the ModelResourceLocation to the one of a item whit a working texture 

 

like i have this

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.multitextura, 0, new ModelResourceLocation("modmercenario:multitextura" , "inventory"));

 

if i change it to this

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.multitextura, 0, new ModelResourceLocation("modmercenario:carbonoMercenario" , "inventory"));

 

i get the item multitextura loading the texture from carbonoMercenario

 

Posted

you have a bigger mod than mine for sure

 

?? you have only one mod loaded in the forge at time  maiby the losing ids are in other set of items

can you do this trick

 

in one item not loading the texture change the ModelResourceLocation to the one of a item whit a working texture 

 

like i have this

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.multitextura, 0, new ModelResourceLocation("modmercenario:multitextura" , "inventory"));

 

if i change it to this

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.multitextura, 0, new ModelResourceLocation("modmercenario:carbonoMercenario" , "inventory"));

 

i get the item multitextura loading the texture from carbonoMercenario

 

I honestly have no idea where the other IDs are going. I don't have anything else loaded, and the items that are registered apart from vanilla items are only registered there as far as I can tell.

Posted

Okay, I pinpointed the bug! It lies in the way that IDs are loaded from world files. It seems that if they get out of order, then the textures shift and get assigned to empty IDs that have no items associated with them. I fixed my problem by creating a new world. I guess this must have happened when I rewrote my render-registering code.

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.

Announcements



×
×
  • Create New...

Important Information

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