Posted May 16, 201312 yr I'm Trying to get an Icon to register for my custom slot. Heres My Code (simplified it below): Icon armorIcon; @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { armorIcon = par1IconRegister.registerIcon("textures/items/slot_empty_boots.png"); } @SideOnly(Side.CLIENT) /** * Returns the icon index on items.png that is used as background image of the slot. */ public Icon getBackgroundIconIndex() { return armorIcon; } It turns out blank. Any help appreciated http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 16, 201312 yr Is the texture white, or transparent. Make sure that you put the texture in the right place. I think you need to put I in /mcp71/src/minecraft/textures/items/your file. The path you put in is the exact path from your zip or the src/minecraft/ folder.
May 16, 201312 yr armorIcon = par1IconRegister.registerIcon("textures/items/slot_empty_boots.png"); That is not how you call registerIcon. You're supposed to pass it a string in this format: "MODNAME:ITEMNAME" No .png, no full path. 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.
May 16, 201312 yr Author Its transparent...So its not registering anything. And its not an item! Its just an icon for a slot. http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 16, 201312 yr Personally I like loading in the texture without an icon and just binding it. Not sure if there's a render item method however, but IMO that's much more manageable.
May 16, 201312 yr Author public Icon getBackgroundIconIndex() { return armorIcon; } must return an Icon, so You cant just bind it directly....Any ideas of why the icon remains transparent? http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 16, 201312 yr Check your error log. 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.
May 16, 201312 yr Author No crashes http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 16, 201312 yr No crashes Still check your logs. some errors don't neccessarily cause crashes. Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
May 16, 201312 yr Author Nothing out of the ordinary, but this was definitely interesting: /** * Returns the icon index on items.png that is used as background image of the slot. */ It returns the icon index! (which I thought was outdated) That being said, how would I use it to properly load an Icon? http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 16, 201312 yr Author Disregard my last post. It just Says that, but it doesn't. But there are no logs and the icon isn't rendering! Help! http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 17, 201312 yr I believe slot backgrounds are considered items and not blocks. Are you performing your registration as a block or as an item? I had a similar problem and I had to create an item just to serve as the register for my slot backgrounds.
May 17, 201312 yr Author I thought it was icons, not Items or Blocks... Or if it is I have no idea what you mean to do. http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
May 17, 201312 yr Sorry I wasn't clear. You do put an Icon in the background of the container slot, it's just a matter of where you declare the icon you want to use. Originally I was registering the icon in my chest Block and that just did not work. Look at my mod project at: https://github.com/dark2phoenix/RescueChest I register the icon in dummy item I call ItemHotBar. I then reference the icon I created in ItemHotBar when I'm creating my custom slot SlotHotBar. See if that works for you.
May 17, 201312 yr Sorry I wasn't clear. You do put an Icon in the background of the container slot, it's just a matter of where you declare the icon you want to use. Originally I was registering the icon in my chest Block and that just did not work. Look at my mod project at: https://github.com/dark2phoenix/RescueChest I register the icon in dummy item I call ItemHotBar. I then reference the icon I created in ItemHotBar when I'm creating my custom slot SlotHotBar. See if that works for you. There's also another way on how to register an Icon, without needing an Item: https://gist.github.com/SanAndreasP/380a80911debb88204c5 Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
May 17, 201312 yr Author Sorry I wasn't clear. You do put an Icon in the background of the container slot, it's just a matter of where you declare the icon you want to use. Originally I was registering the icon in my chest Block and that just did not work. Look at my mod project at: https://github.com/dark2phoenix/RescueChest I register the icon in dummy item I call ItemHotBar. I then reference the icon I created in ItemHotBar when I'm creating my custom slot SlotHotBar. See if that works for you. Thanks that worked! http://mag.racked.eu/cimage/i6000/Achievement++get%21/Newb+Modder%21/mca.png[/img]
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.