Item textures missing when used with Ender IO
CrazyPants opened this issue ยท 17 comments
I have this bug report: SleepyTrousers/EnderIO-1.5-1.12#3549
I have confirmed that a couple of SoL item models dont work when Ender IO is installed. (It is fine with just Ender Core installed.)
I have looked at the code / models for the Journal, and it looks like completely 'normal' to me, but this issue doesn't happen with EIO and any other mods, or even some of the item in SoL. We are not doing anything out of the ordinary on our end that I can think of. I have absolutely no idea how this could happen. Any ideas from your end?
@OddWhirled or @CrazyPants could you share an EnderIO config that the problem can be reproduced with? I can't seem to reproduce it with default TSoL + AppleCore + EnderCore + EnderIO (latest versions of all mods) in a dev environment.
No clue. See also #93 and #94.
In the case of Reliquary, I theorized that it was caused by icons being registered but the related item not being registered, but that was never confirmed as far as I know.
Also unsure why this only seems to affect TSoL.
Thanks @jeep70. I'm not sure I know enough about the texture system to know how to debug this. Unless I'm doing something wrong, the problem seems to be exclusive to obfuscated environments--I can't reproduce it in a dev environment even though everything should be the same (same mod versions, some Forge version, same config files, etc).
This is a strange one.
I am not sure where to look either. I failed to get apple core running in a dev environment to poke around.
FYI, the issue happens with default configs for both mods with just tsol and eio installed
https://dl.dropboxusercontent.com/u/8082184/ShareX/2016/09/test%20boi.zip
Here's a MultiMC instance where this occurs.
The journal thing also has no texture.
And now I was worried why I didn't get the nice journal icon, any fix right now or I'm forced to remember what I hate and not use the lunchbox either.
Did you ever find what's responsible for this bug? because I'm pretty sure it's affecting applecore too, in my modpack none of the effects of applecore are working. And I can't live without it anymore.
@Xiaminou that would be a completely separate bug. Please report it on the AppleCore issue tracker
EDIT: Note that if you're talking about AppleCore's HUD effects (food values, saturation visualization, etc), those got moved into a separate mod.
Ok - was just an idea.
But got another idea:
What if you register the model after registering the item:
https://github.com/squeek502/SpiceOfLife/blob/1.9.4/java/squeek/spiceoflife/items/ItemFoodContainer.java#L71
and
https://github.com/squeek502/SpiceOfLife/blob/1.9.4/java/squeek/spiceoflife/ModContent.java#L19
That is just for registering the Item instance with the EVENT_BUS (so it can handle ItemTossEvent
s).
The items themselves are registered here: https://github.com/squeek502/SpiceOfLife/blob/1.9.4/java/squeek/spiceoflife/ModContent.java#L16-L26
but why are you registering each single item as event handler? Ok, it's just 2, but they are doing double work. Make the event handling method static and register the class once.
@HenryLoenwind not sure that event handlers can be static. Either way, that's unrelated to this issue.
@MatthiasMann I see what you mean about the order of registering the model, though; will try moving the model registry outside of the constructor and put it after GameRegistry.register
is called.
@MatthiasMann you nailed it. Somehow, calling ModelLoader.setCustomModelResourceLocation
before the Item is registered with the GameRegistry
can cause the icon to go missing... but only when certain other mods are present?
Who knows, but changing the order does indeed fix this bug. Appreciate you taking a look at the code.
Also, @HenryLoenwind you're absolutely right that there was duplication in that event handler, will fix that too (just changing the handler to use a == this
check will fix it).
@squeek502 I think it's because you do not specify the domain when creating the ResourceLocation.
You pass the getRegistryName() directly to ModelResourceLocation()
https://github.com/squeek502/SpiceOfLife/blob/1.9.4/java/squeek/spiceoflife/items/ItemFoodJournal.java#L44
This is how EnderIO creates it's item render via registerDefaultItemRenderer:
https://github.com/SleepyTrousers/EnderIO/blob/1.10/src/main/java/crazypants/util/ClientUtil.java#L104
while EnderIO passes EnderIO.DOMAIN + ":" + getRegistryName().
So maybe if you include your domain in front of the registry name this texture issue goes away?
@MatthiasMann, IIRC the mod ID of the currently executing container gets inserted as the domain if none is specified, but it's certainly worth a shot. Will try it out tonight and report back.
I was wrong about where the mod ID is inserted, but I was right that it does get inserted. setRegistryName
without the mod ID specified creates a ResourceLocation using the mod ID of the current container, so calling getRegistryName()
later returns the equivalent of ResourceLocation(modID.toLowerCase(), itemName)
Basically, it has no effect on this bug--the problem still exists either way.