Skip to content

Expose net.minecraft.world.level.biome.Biome.hasPrecipitation() in paper Biome API. #13487

@HydrolienF

Description

@HydrolienF

Is your feature request related to a problem?

I'm trying to get rid of NMS code from a plugin since Paper API now support custom biomes & custom biome tags.
I haven't found a way to know if there is snow or rain in a biome with the API. I know we can know if the world hasStorm, but I would like to know if a specific biome is wet enough to be rainy.

This is what I'm currently using

  private static double getWeatherTemperatureModifier(Location location) {
        if (!NMSBiomeUtils.getBiome(location).hasPrecipitation()) { // access NMS biome
            return 0.0;
        } else if (location.getWorld().isThundering()) {
            return 0.1;
        } else if (location.getWorld().hasStorm()) {
            return 0.2;
        } else {
            return 0.0;
        }
    }

Describe the solution you'd like.

I would love to have a org.bukkit.block.Biome.hasPrecipitation() function that works as the vanilla one:

  • return true if the biome .json file contains "has_precipitation": true.
  • else return false.

An access to Biome.Precipitation getPrecipitationAt(BlockPos pos, int seaLevel) would probably usefull to some people to.

Describe alternatives you've considered.

I've tried to get the precipitation from somewhere else in the Paper API, but it doesn't look like to have a hasPrecipitation() function anywhere.

Other

Thanks for all the new API stuff about biomes.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions