AdvancedPlugins / Seasons

Experience dynamic seasons in Minecraft with Advanced Seasons, the most immersive seasons plugin available.
Apache License 2.0
2 stars 1 forks source link

Add a setting to disable seasonal colors for certain biomes #52

Closed Mitality closed 7 months ago

Mitality commented 9 months ago

Describe the feature

Could even look like this:

# Seasonal Settings
seasons:
  spring:
    snow: false
    sky: ""
    fog: ""
    water: ""
    waterFog: ""
    grass: ""
    tree: ""

  summer:
    snow: false
    sky: ""
    fog: ""
    water: ""
    waterFog: ""  
    grass: ""
    tree: ""

  fall:
    snow: false
    sky: ""
    fog: ""
    water: ""
    waterFog: ""
    grass: ""
    tree: ""

  winter:
    winter-freeze: true
    snow: true
    sky: ""
    fog: ""
    water: ""
    waterFog: ""
    grass: ""
    tree: ""
Mitality commented 9 months ago

Would be even better, if you would allow us to disable seasonal colors only for custiom biomes, but this is not necessary, as we could use an additional configuration-file for custom biomes instead

GC-spigot commented 8 months ago

I saw this the day you posted, and still trying to think of how to do this - but it might not be possible right now. I'll keep this open until some idea pops up!

Mitality commented 8 months ago

Isn't colors the only thing the biome change does..? I mean everything else should be doable by just using the original biome how it is, or not..? What would break?

Mitality commented 8 months ago

How about an option to not replace (custom) biomes and just calculate / do everything with the original biome from the config..?

Mitality commented 8 months ago

Even a setting to disable the custom advanced biomes and use the default vanills/customworldgen ones without color changes would be something

Mitality commented 8 months ago

@GC-spigot

GC-spigot commented 8 months ago

It’s easier said than done. To add this we have to rework like 30% of the plugin. It’s currently not the highest priority as the people who will use it are handful, the plugin functions well, and we’ll get to this after other bigger updates, e.g. For customisable temperature of blocks etc.

We always prioritize issues and features that would be most widely impactful.

Mitality commented 8 months ago

Hmm well then the only option left for me by now is to give moonlight grove and mirage isles their own biome group... How many biome groups can I define before it exceeds the vanilla biome limit..? (Note that terralith adds about 75 biomes or so on top of the 64 from vanilla)

Mitality commented 8 months ago

Or could you please use the temperature-formular even for biomes that are not in the config / add a setting to do so, instead of just using the base value no matter what season there is? Just use 0 as %biome% temperature if the biome isn't found

Mitality commented 8 months ago

I just need a way to use the temperature system without letting AS obliterate custom biomes

Mitality commented 8 months ago

Or could you please use the temperature-formular even for biomes that are not in the config / add a setting to do so, instead of just using the base value no matter what season there is? Just use 0 as %biome% temperature if the biome isn't found

Or even better, let me set biome-temperature-overrides within temperature.yml to be used within the temperature-formula, no matter if the biome is configured there.

Something like this could be manually added to temperature.yml:

biomeTemperatureOverrides:
   FROZEN_OCEAN: -6
   mirage_isles: 3

As I don't really care about the snow, this should make AS usable for me without coming close to having to rework 30% of the plugin.

@GC-spigot

Mitality commented 8 months ago

This way, I could just clear the biomeConfiguration folder and everything but the snow and abviously seasonal colors should work for now, right?

Mitality commented 8 months ago

Just noticed that clearing the biomeConfiguration folder lets it regenerate, but if I set biomes: to [ ], it should work, right?

GC-spigot commented 8 months ago

Yes if you set biomes to [] it would still work

Mitality commented 8 months ago

Great! Only biome temperature overrides are needed then to make this fully work

Mitality commented 8 months ago

Should I add them as a separate issue?

Mitality commented 7 months ago

If you are still wondering why this option is so essential to me: 2024-04-07_19 03 07 I just can't use AS when it obliterates the visuals of my worlds like that

Mitality commented 7 months ago

Or could you please use the temperature-formular even for biomes that are not in the config / add a setting to do so, instead of just using the base value no matter what season there is? Just use 0 as %biome% temperature if the biome isn't found

Or even better, let me set biome-temperature-overrides within temperature.yml to be used within the temperature-formula, no matter if the biome is configured there.

Something like this could be manually added to temperature.yml:

biomeTemperatureOverrides:
   FROZEN_OCEAN: -6
   mirage_isles: 3

As I don't really care about the snow, this should make AS usable for me without coming close to having to rework 30% of the plugin.

@GC-spigot

How about adding something like this to net.advancedplugins.seasons.biomes.BiomesHandler.getPlayerTemperature/getLocationTemperature?

public int getPlayerTemperature(Player paramPlayer) {
    int i;
    Location location = paramPlayer.getEyeLocation();
    if (this.temp.containsKey(paramPlayer.getUniqueId()))
        return ((Integer) this.temp.get(paramPlayer.getUniqueId())).intValue();
    Biome biome = location.getBlock().getBiome();
    SeasonType seasonType = Core.getSeasonHandler().getSeason(paramPlayer.getWorld()).getType();
    AdvancedBiomeBase advancedBiomeBase = Core.getBiomesHandler().getBiome(biome);
    if (advancedBiomeBase == null) {
        i = 0;
    } else {
        i = advancedBiomeBase.getTemperature();
    }
    /* NEW CODE START */
    File file = new File(<get-plugin-from-somewhere>.getDataFolder(), "temperature.yml");
    YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
    ConfigurationSection biomeOverridesSection = yamlConfiguration.getConfigurationSection("biomeTemperatureOverrides");
    if (biomeOverridesSection != null && biomeOverridesSection.contains(biome.name())) {
        i = biomeOverridesSection.getInt(biome.name());
    }
    /* NEW CODE END */
    double d = location.getBlock().getLightFromBlocks();
    int j = getSeasonTemperature(seasonType, advancedBiomeBase);
    int k = (int) (d * (seasonType.equals(SeasonType.SUMMER) ? 0.8D : Math.max(1.5D, d / ((j < 0) ? 5 : 8))));
    int m = (int) Arrays.<ItemStack>stream(paramPlayer.getInventory().getArmorContents()).filter(Objects::nonNull).count();
    int n = getConditional(paramPlayer);
    return (int) ASManager.parseThroughCalculator(this.formula.replace("%base%", Integer.toString(this.baseTemperature)).replace("%biome%", Integer.toString(i)).replace("%seasonTemp%", Integer.toString(j)).replace("%lightLevel%", Integer.toString(k)).replace("%conditionalTemp%", Integer.toString(n)).replace("%armorItemsCount%", Integer.toString(m)));
}
public int getLocationTemperature(Location paramLocation) {
    int i;
    Biome biome = paramLocation.getBlock().getBiome();
    SeasonType seasonType = Core.getSeasonHandler().getSeason(paramLocation.getWorld()).getType();
    AdvancedBiomeBase advancedBiomeBase = Core.getBiomesHandler().getBiome(biome);
    if (advancedBiomeBase == null) {
        i = 0;
    } else {
        i = advancedBiomeBase.getTemperature();
    }
    /* NEW CODE START */
    File file = new File(<get-plugin-from-somewhere>.getDataFolder(), "temperature.yml");
    YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
    ConfigurationSection biomeOverridesSection = yamlConfiguration.getConfigurationSection("biomeTemperatureOverrides");
    if (biomeOverridesSection != null && biomeOverridesSection.contains(biome.name())) {
        i = biomeOverridesSection.getInt(biome.name());
    }
    /* NEW CODE END */
    double d = paramLocation.getBlock().getLightFromBlocks();
    int j = getSeasonTemperature(seasonType, advancedBiomeBase);
    int k = (int) (d * (seasonType.equals(SeasonType.SUMMER) ? 1.0D : Math.max(1.5D, d / ((j < 0) ? 5 : 8))));
    return (int) ASManager.parseThroughCalculator(this.formula.replace("%base%", Integer.toString(this.baseTemperature)).replace("%biome%", Integer.toString(i)).replace("%seasonTemp%", Integer.toString(j)).replace("%lightLevel%", Integer.toString(k)).replace("%conditionalTemp%", "0").replace("%armorItemsCount%", "0"));
}
Mitality commented 7 months ago

(Just trying to make it easier for you. If you don't want me to mess around with your code, let me know) 🙂

Mitality commented 7 months ago

(Actually, I have no idea if this works with custom biomes, but you'll know for sure)

GC-spigot commented 7 months ago

Added