Jump to content

Recommended Posts

Posted

I register an IBlockColor like this:

Minecraft.getInstance().getBlockColors().register(new CakeColor(0xad6b15), block); //Cake color implements IBlockColor and its method

 

The getColor method is setup like this:

@Override
    public int getColor(BlockState p_getColor_1_, @Nullable IBlockDisplayReader p_getColor_2_, @Nullable BlockPos p_getColor_3_, int p_getColor_4_) {
        return color; // Returns the same color regardless of state
    }

Yet the color of my cake still uses the base texture when placed on the ground. I need the color to change.

Posted
On 2/20/2021 at 12:01 PM, diesieben07 said:

That is incorrect. Use ColorHandlerEvent.Block.

I am now registering the colors using that event, but nothing has changed. I even have the event logging to the console to check that it is working.

On 2/20/2021 at 12:01 PM, diesieben07 said:

Show your model JSON and texture.

Blockstate:

{
  "variants": {
    "bites=0": {
      "model": "tons_of_cakes:block/cake"
    },
    "bites=1": {
      "model": "tons_of_cakes:block/cake_slice1"
    },
    "bites=2": {
      "model": "tons_of_cakes:block/cake_slice2"
    },
    "bites=3": {
      "model": "tons_of_cakes:block/cake_slice3"
    },
    "bites=4": {
      "model": "tons_of_cakes:block/cake_slice4"
    },
    "bites=5": {
      "model": "tons_of_cakes:block/cake_slice5"
    },
    "bites=6": {
      "model": "tons_of_cakes:block/cake_slice6"
    }
  }
}

cake.json:

{
  "parent": "block/cake_slice1",
  "textures": {
    "down": "tons_of_cakes:blocks/cake_bottom",
    "up": "tons_of_cakes:blocks/cake_top",
    "north": "tons_of_cakes:blocks/cake_side",
    "south": "tons_of_cakes:blocks/cake_side",
    "east": "tons_of_cakes:blocks/cake_side",
    "west": "tons_of_cakes:blocks/cake_inside"
  }
}

cake_slice1:

{
  "parent": "block/cake_slice1",
  "textures": {
    "down": "tons_of_cakes:blocks/cake_bottom",
    "up": "tons_of_cakes:blocks/cake_top",
    "north": "tons_of_cakes:blocks/cake_side",
    "south": "tons_of_cakes:blocks/cake_side",
    "east": "tons_of_cakes:blocks/cake_side",
    "west": "tons_of_cakes:blocks/cake_inside"
  }
}

and the textures it is referencing are black and white versions of the vanilla textures, but it doesn't even show as black and white in game. It shows as the original vanilla texture.

Posted (edited)
8 hours ago, diesieben07 said:

You set the vanilla cake_slice1 as your parent model and then do not override any of its textures

How do I override textures?

Edited by NullDev

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.