#fluid registry issue

27 messages · Page 1 of 1 (latest)

tiny raptor
#

why is this error happening?

StartupEvents.registry('fluid', event => {
    event.create("purified_water")
        .tint(0xBBCCFF)
});
zinc robinBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

tiny raptor
#

well i guess its a bug

default void texture(ResourceLocation target, LoadedTexture texture) {
        if (texture.width <= 0 || texture.height <= 0) {
            ConsoleJS.CLIENT.error("Failed to save texture " + target);
            return;
        }

        add(new GeneratedData(target.withPath(ID.PNG_TEXTURE), texture::toBytes));

        if (texture.mcmeta != null) {
            add(new GeneratedData(target.withPath(ID.PNG_TEXTURE_MCMETA), () -> texture.mcmeta));
        }
    }
tiny raptor
#

whad should i do?

verbal sorrel
#

that error, as you posted the source-code for, only happens when texture.width <= 0 || texture.height <= 0
The texture is either

  • malformed/incorrect img type
  • named incorrectly
  • in the wrong location
  • missing entirely

Check everything, and make sure that the texture is located in INSTANCEFOLDER/kubejs/assets/kubejs/textures/block/
Where INSTANCEFOLDER is the main folder for your pack, which houses the /mods, /config folders etc

tiny raptor
ember fern
tiny raptor
#

i am

ember fern
# tiny raptor i am

u can use this script

StartupEvents.registry('fluid', event => {
 event.create('kubejs:example_fluid', 'thin')  //in this line u can replace "thin" for "thick" and those arguments works like ".thinTexture" and ".thickTexture" respectively.
  .tint(0xFF0000)  //this line is for color and it also handle ".bucketColor" argument in one
  .displayName('Example Fluid')

})
tiny raptor
#

mhm

ember fern
#

it's for KubeJS NeoForge 1.21.1 newest version

tiny raptor
#

ill try it, thanks

#

is there a proper 1.21 wiki?

#

i couldnt find anything

ember fern
ember fern
ember fern
#

I discovered and created this script thanks to an extensive reading of the code responsible for fluid registry

#

-# yup, I read all the code in the GitHub repository

tiny raptor
ember fern
#

this is also thanks to the fact that there don't seem to be many people on this server who know about this and want to help xD

ember fern
tiny raptor
#

thanks

ember fern