KubeJS Asset System Compatibility
Brittank88 opened this issue · 20 comments
Versions:
Forge 36.1.16
Curios (Forge) 4.0.5.2
KubeJS (Forge) 1605.3.10-Build.18
(PLEASE REFER TO FURTHER COMMENTS, THE ISSUE CHANGED SOMEWHAT BUT IS STILL A VALID ISSUE)
Observed Behavior:
Despite mirroring the asset and filename structure used by Curios itself (in the KubeJS assets folder), my custom slot backgrounds are not being used.
Expected Behavior:
I should be able to have KubeJS apply the assets and see Curios automatically use them for my custom slots.
Setup:
Custom slot tags (functional):
Custom slot lang (functional):
Custom slot textures (non-functional):
Result:
Custom slots appear, and have correct lang, but no custom texture:
I've revamped the slot texture registration which should fix this issue as well. I've also written some documentation about it, so take a look: https://github.com/TheIllusiveC4/Curios/wiki/Slot-Textures
Let me know if this still doesn't work and I'll re-open it.
P.S. How on earth did you manage to save the slot textures with a bit depth of 1? I can't figure out a way to do it that doesn't completely ruin the image.
What do you mean by "bit depth of 1"?
P.S. How on earth did you manage to save the slot textures with a bit depth of 1? I can't figure out a way to do it that doesn't completely ruin the image.
What do you mean by "bit depth of 1"?
I can tell it's not just superficial either, because the file is MUCH tinier than my 16x16 transparent PNGs that also use only 2 indexed colours. Just compare:
This is literally the first time I see this "bit depth" thing on images. Was it there all along and just isn't that important, or is it me randomly hopping across parallel universes again?
Bit depth is how much colour information (in bits) is stored per pixel!
By the way, do you know how I can get these textures working? I'm pulling my hair out over this, lol.
Personally, whether this is my fault or a mod issue, I believe this is a critical section of information missing from the wiki. At least, I was unable to find any examples in the wiki related to assigning textures to your custom slots.
P.S. How on earth did you manage to save the slot textures with a bit depth of 1? I can't figure out a way to do it that doesn't completely ruin the image.
I thought this was my fault, but I am realising that I can't even get Curios to use its own assets in slots.
I have tried:
icon = "curios:textures/item/empty_head_slot.png"
icon = "curios:textures/item/empty_head_slot"
icon = "textures/item/empty_head_slot.png"
icon = "textures/item/empty_head_slot"
icon = "curios:item/empty_head_slot.png"
icon = "curios:item/empty_head_slot"
icon = "item/empty_head_slot.png"
icon = "item/empty_head_slot"
All of these produce missing textures.
As it turns out, I'm a dumbass and didn't see the This is still an actual issue, it refuses to work.icon
entry in the wiki. Apologies for the false alarm.
I'd close the issue, but I am still curious about the 1-bit-depth image thing, so I'll leave it open so maybe that question can be seen and answered quickly before the issue is closed!
Okay, I've been here for an hour trying to find the correct string to use for the icon
parameter, and I have not found a way to get it to work. I still think I was right about the wiki not covering this well enough. There needs to be an example.
I can see in the code that it just turns the input string into a ResourceLocation, but nothing I input works.
Here's my current curios-server.toml
(that doesn't work...):
#List of curio slot type settings
[[curiosSettings]]
icon = "curios:item/empty_totem_slot"
identifier = "totem"
[[curiosSettings]]
icon = "curios:item/empty_elytra_slot"
identifier = "elytra"
[[curiosSettings]]
icon = "curios:item/empty_oddities_backpack_slot"
identifier = "oddities_backpack"
[[curiosSettings]]
identifier = "back"
size = 2
[[curiosSettings]]
icon = "curios:item/empty_potion_charm_slot"
identifier = "potion_charm"
size = 2
What is very odd though, is that if I drag some resource texture into the assets folder of the curios jar, and reference it appropriately (same syntax and everything as the head slot texture, which I've been able to get working), it won't work.
Anyways, this issue is a bit of a mess - let me know if I should open a new, clean one.
Maybe try excluding item
and above directories from icon path? So, either curios:empty_head_slot
or just empty_head_slot
. The .png
extension is certainly not required.
I think I know what the issue is, but you'll have to give me some time before I can look into it properly.
As for your curiosity about the image metadata, I believe that's a result of the compression from TinyPNG which is handy for shrinking image file sizes.
Thank you! I look forward to getting them working, considering the default slot textures don't reveal much. For now, I can deal with it though.
I'll definitely check out TinyPNG!