Curios API (Forge/NeoForge)

Curios API (Forge/NeoForge)

140M Downloads

KubeJS Asset System Compatibility

Brittank88 opened this issue · 20 comments

commented

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):
image

Custom slot lang (functional):
image

Custom slot textures (non-functional):
image

Result:

Custom slots appear, and have correct lang, but no custom texture:

image

commented

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.

commented

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

commented

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

image

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:
image image

commented

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?

commented

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.

commented

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.

commented

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.

commented

Still haven't figured it out. Curios refuses to find the resources.

commented

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.

commented

As it turns out, I'm a dumbass and didn't see the icon entry in the wiki. Apologies for the false alarm. This is still an actual issue, it refuses to work.

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!

commented

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.

commented

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
commented

Have discovered that Curios can load textures from other mods too, just not from the KubeJS resourcepack:
image

commented

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.

commented

Anyways, this issue is a bit of a mess - let me know if I should open a new, clean one.

commented

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.

commented

I got the head slot working with curios:item/empty_head_slot, however, this was just a test, and applying the same format to the other resource locations did not work:
image

commented

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.

commented

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!

commented

Hi, Illusive! After checking out TinyPNG, I found a free program called PNGGauntlet that actually (somehow) beats TinyPNG at compressing the images down. Just thought I'd let you know, in case that was useful to you!