Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

  • Author

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.

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

 

  • Author

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.

  • Author

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.