Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Items look weird and crooked in inventory
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
Aldie

Items look weird and crooked in inventory

By Aldie, February 2, 2020 in Modder Support

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • Next
  • Page 1 of 2  

Recommended Posts

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 2, 2020

So I'm working on a mod that adds new weapons to the game, but when I added the texture for one of my items it renders weird in the inventory. As you can see, the item in question looks identical to the vanilla iron sword, rendering perfectly both as a dropped item and as the model help in hand, it's only in the inventory itself that it looks all crooked.

 

The item texture was originally 18x18 as opposed to the default multiple of 16 (64x64 I believe). The problem persisted even when I rescaled it to a multiple of 16.

Is there any workaround for this? Some way to get it rendering properly?

2020-02-02_17.11.38.png

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 2, 2020

Don't use non-power-of-2 textures. 

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

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 2, 2020
13 minutes ago, Draco18s said:

Don't use non-power-of-2 textures. 

I resized it to 512x512, which is what it is in this screenshot. The problem persisted, what should I do?

  • Quote

Share this post


Link to post
Share on other sites

larsgerrits    514

larsgerrits

larsgerrits    514

  • Reality Controller
  • larsgerrits
  • Members
  • 514
  • 3462 posts
Posted February 2, 2020

Maybe try a lower resolution, 512x512 is really high and not necessary.

  • Quote

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 3, 2020
20 hours ago, larsgerrits said:

Maybe try a lower resolution, 512x512 is really high and not necessary.

I did so but the problem persisted. The problem seems to be caused by some element in Minecraft's code forcing any item to visually fit into a maximum grid resolusion of 32x32, i.e. I can't just resize the item's texture to 128x128 (which looks alright everywhere outside the inventory), because the inventory forces the image into that damned 32x32 frame. To clarify why I specifically need my items 18x18, the mod I'm making offers stronger versions of vanilla minecraft weapons, such as the "mythic iron sword", which are visually derived from the vanilla weapons. Without that extra couple of pixels, I can't really emphasize the progression, visually, and 32x32 would be TOO large for this task. 18x18 (or maybe 20x20) would be the Goldilocks zone.

 

I'll phrase my question in a simpler manner then. Is there any way to get Minecraft to render hd textures in the inventory?

 

I'll really appreciate any help I get since I've been really hyped to work on this mod for some time and learnt Java specifically therefor.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 3, 2020

Inventory squares are always the same size. You can't just "add a few extra pixels" and make it work. The image is going to get scaled down to fit within that space and that space is only 32x32 on screen (actually, its 16x16, but the default UI size is scaled up by a factor of 2 with a intrapixel mode of "nearest").

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

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 3, 2020
9 minutes ago, Draco18s said:

Inventory squares are always the same size. You can't just "add a few extra pixels" and make it work. The image is going to get scaled down to fit within that space and that space is only 32x32 on screen (actually, its 16x16, but the default UI size is scaled up by a factor of 2 with a intrapixel mode of "nearest").

Alright. I'll try a few alternatives. Should I upload separate threads for different questions relating to the same subject (relating to different coding issues but to the same end goal) or should I keep posting here with further questions?

 

Thanks for your help by the way.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 3, 2020

Unless your plan is to hack the gui systems to draw your items with more pixels, I suspect that nothing will do what you want. 

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

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 4, 2020
22 hours ago, Draco18s said:

Unless your plan is to hack the gui systems to draw your items with more pixels, I suspect that nothing will do what you want. 

Well, that was my original plan. To modify the element in Minecraft's code which renders the items' textures in the inventory, or replace the vanilla GUI with my own GUI that can accommodate 18x18 textures (possibly with GuiOpenEvent or some other black magic :P). Is this possible? Could you help me do this?

 

If not, there were two alternatives I had in mind:

1) Render the items in the inventory with an alternative model (I've seen this done before in mods; items using various 3d models instead of a 2d texture). I'm not sure how to do this so I'd appreciate any help.

 

2) Use different textures for the handheld/dropped item and the item in the inventory. This is the simplest option, and I know this is entirely doable, but it's not the best one.

 

Thanks for all your help.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 4, 2020

Step 0:

Open an image editing program and draw what you want your 18 pixel sword to look like in the inventory.

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

Share this post


Link to post
Share on other sites

Cadiboo    365

Cadiboo

Cadiboo    365

  • Reality Controller
  • Cadiboo
  • Members
  • 365
  • 3624 posts
Posted February 5, 2020

You could also emphasise the progression by having unique textures that look good or your own custom models.

  • Quote

About Me

Spoiler

My Discord - Cadiboo#8887

My Website - Cadiboo.github.io

My Mods - Cadiboo.github.io/projects

My Tutorials - Cadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 6, 2020
On 2/5/2020 at 12:40 AM, Draco18s said:

Step 0:

Open an image editing program and draw what you want your 18 pixel sword to look like in the inventory.

Well, this is actually quite embarrassing, but I already made all of the textures for all of the swords of all 15 materials of which I wish to make swords, before even starting the mod itself. (Below are ten of them.)

 

What's step one?

Stone_LongSwords (1).png

Diamond_LongSwords (1).png

Golden_LongSwords (1).png

Wooden_LongSwords (1).png

Iron_LongSwords (1).png

Coal_LongSwords.png

Flint_LongSwords.png

Quartz_LongSwords.png

Redstone_LongSwords.png

Obsidian_LongSwords.png

  • Quote

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 6, 2020
On 2/5/2020 at 10:00 AM, Cadiboo said:

You could also emphasise the progression by having unique textures that look good or your own custom models.

Custom models? In what sense? How would it look in the inventory?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 6, 2020

Those are graphical assets, but they are not in the UI. Draw what the player will see when they open their inventory.

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

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 16, 2020 (edited)
On 2/7/2020 at 12:19 AM, Draco18s said:

Those are graphical assets, but they are not in the UI. Draw what the player will see when they open their inventory.

Hey, sorry I disappeared for a couple of weeks, it's been hectic with finals and all.

 

I drew three options to what the UI should look like, from best option to least preferable option:

 

Edit: To clarify, black pixels are the border of the item texture and red is the item.

sword- (1).png

sword (3).png

Edited February 16, 2020 by Aldie
  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 16, 2020

Yep, you're going to have to hack Minecraft's itemstack UI renderer.

Have fun!

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

Share this post


Link to post
Share on other sites

Cadiboo    365

Cadiboo

Cadiboo    365

  • Reality Controller
  • Cadiboo
  • Members
  • 365
  • 3624 posts
Posted February 17, 2020

Go with #1 and 16x16 textures. Textures should be a power of two. So 8, 16, 32, 64. They should also be no larger than 16 because of this and this.

  • Quote

About Me

Spoiler

My Discord - Cadiboo#8887

My Website - Cadiboo.github.io

My Mods - Cadiboo.github.io/projects

My Tutorials - Cadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted February 21, 2020
On 2/17/2020 at 12:30 AM, Draco18s said:

Yep, you're going to have to hack Minecraft's itemstack UI renderer.

Have fun!

Well, for options one and two you're right, but for option three? I know there's an option to have the model for handheld items/dropped items be different than the model used in the inventory. How would I tackle that?

 

And if that isn't good enough, where would I start if I wanted to hack the itemstack UI renderer? Is there documentation for this?

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 21, 2020
1 hour ago, Aldie said:

I know there's an option to have the model for handheld items/dropped items be different than the model used in the inventory. How would I tackle that?

I know this is possible, I think I saw a thread on it a week ago. Something about using a smaller part of a texture for an item.

 

1 hour ago, Aldie said:

Is there documentation for this?

No, there is not.

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

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 21, 2020

@Aldie, ehm, can you show us your mod on Github or something else? But with custom model you can use Blockbench to make your Item model, then Export it as a Json file and instead of Minecraft itemheld model you can use the Json file model. Then you will have your Model that should work with the Inventory rendering.

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 21, 2020
On 2/2/2020 at 4:36 PM, Aldie said:

The item texture was originally 18x18 as opposed to the default multiple of 16 (64x64 I believe). The problem persisted even when I rescaled it to a multiple of 16.

Why you are using 16x16 Texture? You should use 18x18 Texture, then the Problem should be disappear. I think you simply need to set the Texture to 18x18, and then try to resize the others Textures to make it size to 18x18, but first try with .

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 23, 2020
On 2/2/2020 at 4:36 PM, Aldie said:

So I'm working on a mod that adds new weapons to the game, but when I added the texture for one of my items it renders weird in the inventory. As you can see, the item in question looks identical to the vanilla iron sword, rendering perfectly both as a dropped item and as the model help in hand, it's only in the inventory itself that it looks all crooked.

 

The item texture was originally 18x18 as opposed to the default multiple of 16 (64x64 I believe). The problem persisted even when I rescaled it to a multiple of 16.

Is there any workaround for this? Some way to get it rendering properly?

2020-02-02_17.11.38.png

@Aldie, this Video will definitively help you (it was made for older Version but should still work):

 

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

Draco18s    2407

Draco18s

Draco18s    2407

  • Reality Controller
  • Draco18s
  • Members
  • 2407
  • 15945 posts
Posted February 23, 2020
On 2/21/2020 at 12:08 PM, DragonITA said:

Why you are using 16x16 Texture? You should use 18x18 Texture, then the Problem should be disappear. I think you simply need to set the Texture to 18x18, and then try to resize the others Textures to make it size to 18x18, but first try with .

No. They already tried this. It doesn't work. Because the game scales any texture you give it down to fit into a space meant to be occupied by a 16x16 texture.

 

  • Like 1
  • 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.

Share this post


Link to post
Share on other sites

DragonITA    12

DragonITA

DragonITA    12

  • Dragon Slayer
  • DragonITA
  • Members
  • 12
  • 552 posts
Posted February 24, 2020
8 hours ago, Draco18s said:

No. They already tried this. It doesn't work. Because the game scales any texture you give it down to fit into a space meant to be occupied by a 16x16 texture.

 

 

12 hours ago, DragonITA said:

@Aldie, this Video will definitively help you (it was made for older Version but should still work):

 

 

  • Quote

New in Modding? == Still learning!

Share this post


Link to post
Share on other sites

Aldie    0

Aldie

Aldie    0

  • Tree Puncher
  • Aldie
  • Members
  • 0
  • 11 posts
Posted March 19, 2020
On 2/21/2020 at 7:31 PM, DragonITA said:

@Aldie, ehm, can you show us your mod on Github or something else? But with custom model you can use Blockbench to make your Item model, then Export it as a Json file and instead of Minecraft itemheld model you can use the Json file model. Then you will have your Model that should work with the Inventory rendering.

Here's a link to the whole mod: https://drive.google.com/open?id=1llGhCc5zKeQ3gO-nQlZvs8R_POdkoisa

(Sorry it's not github, I don't know how to use github.)

(Also sorry it took me a month to respond. I've been busy lately.)

  • Quote

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • Next
  • Page 1 of 2  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Milano
      My forge wont install

      By Milano · Posted 12 minutes ago

      Yes, that actually worked. Thanks for the link.  I am finally able to install. Thankyou for all the support, have a nice day!
    • octa
      Disconnection From Server When Placing Modded Block

      By octa · Posted 14 minutes ago

      Oh, that makes sense. Do you have a suggested way of initializing that BlockPos? I can't think of anything other than assigning a symbolic value which gets verified before use, but that seems clumsy. Edit: Nvm, I was trying to return some nbt data instead of the tileentity's actual position. Thanks for the help.
    • diesieben07
      My forge wont install

      By diesieben07 · Posted 26 minutes ago

      Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
    • diesieben07
      Disconnection From Server When Placing Modded Block

      By diesieben07 · Posted 28 minutes ago

      That is fine, but then you must use @ObjectHolder instead of manually assigning fields.   It crashes because your TileEntityPortalBase creates an SUpdateTileEntityPacket with a null BlockPos.
    • Purity
      Valhelsia 3 server not starting

      By Purity · Posted 38 minutes ago

      how do i know if i installed correctly? it works good when i run it on my computer any thoughts on how i can fix it on the host?
  • Topics

    • Milano
      4
      My forge wont install

      By Milano
      Started 50 minutes ago

    • octa
      6
      Disconnection From Server When Placing Modded Block

      By octa
      Started 4 hours ago

    • Purity
      10
      Valhelsia 3 server not starting

      By Purity
      Started 17 hours ago

    • Exced
      1
      Minecraft Eternal Modpack Server won't start

      By Exced
      Started 1 hour ago

    • xX_deadbush_Xx
      0
      1.15.2 compiled mod crashes due to IllegalAccessError

      By xX_deadbush_Xx
      Started 52 minutes ago

  • Who's Online (See full list)

    • TheidenHD
    • octa
    • GermanBucket
    • Nuparu00
    • Purity
    • diesieben07
    • Milano
    • SaltBeard
    • Mopaseo
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Items look weird and crooked in inventory
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community