Jump to content

[1.15.2] Entity getGrassColor getFoliageColor gets only default color


frakier

Recommended Posts

I tried getting the block under the entity and....

colorInt = targetEntity.world.getBiome(new BlockPos(entityX, entityY, entityZ)).getGrassColor(entityX, entityZ)

Expecting, hoping, to get the current shifted color of the grass [also tried this with foliage] but it only seems to return the default colors for grass not shifted for the biome [biome grass color].

What am I missing? Can anyone point me in the right direction?

I'm currently working on my own code that uses the temp/humidity to shift the colors but would rather not reinvent the wheel.

Thanks

Edited by frakier
clarifying - clarifying title again
Link to comment
Share on other sites

51 minutes ago, ChampionAsh5357 said:

For reference, the method only exists on the physical client. So, calling this on the logical server is problematic. This wouldn't be stored on the specific entity, this would be called directly in the renderer and applied there.

This all takes place in rendering on the client so not a problem. For a chameleon like ability.

Edited by frakier
Link to comment
Share on other sites

15 minutes ago, frakier said:

This all takes place in rendering on the client so not a problem. For a chameleon like ability.

Thanks for the clarification. Well in that case, you might want to try your luck with BiomeColors::getGrassColor. That should be able to get the exact block color for grass. Make sure the position you check is the one below your entity.

Link to comment
Share on other sites

colorInt = BiomeColors.getGrassColor(targetEntity.world, new BlockPos(entityX, entityY, entityZ));

seems to get the same value as

colorInt = targetEntity.world.getBiome(new BlockPos(entityX, entityY, entityZ)).getGrassColor(entityX, entityZ);


Need something to get the tint of the color being used in the biome, found some talk about a colorizeer or something to that effect but that seems to be fro a really old version of mc.
I'll keep digging.
Looking at how BlockModelRenderer handles it.


More Information, fairly sure getGrassColor is for Blocks.GRASS and Blocks.TALL_GRASS the plants not Blocks.GRASS_BLOCK
So I am looking for foliage, particularly the default, shaded/tint color for the biome and
the correct shaded/tint color for GRASS_BLOCK in the biome.

Edited by frakier
Link to comment
Share on other sites

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.