The Spice of Life

The Spice of Life

16M Downloads

Item textures missing when used with Ender IO

CrazyPants opened this issue ยท 17 comments

commented

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?

commented

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

commented

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.

commented

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.

commented

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

commented

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.

commented

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.

commented

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.

commented

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

commented

They did? oh I missed that, thank you.

commented
commented

That is just for registering the Item instance with the EVENT_BUS (so it can handle ItemTossEvents).

The items themselves are registered here: https://github.com/squeek502/SpiceOfLife/blob/1.9.4/java/squeek/spiceoflife/ModContent.java#L16-L26

commented

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.

commented

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

commented

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

commented

@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?

commented

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

commented

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.