Skip to content

Commit

Permalink
Fix biome spawning on cold planets and setting the LEO explicitly in …
Browse files Browse the repository at this point in the history
…PlanetIcons, moved line in StellarBody (#2339)

* Small fixes

-Frigid and snowball planets spawn cold biomes now.
-Setting the LEO explicitly will now work properly instead of just setting the LEO to the atmosphere LEO.

* Move line of code in StellarBody

Seemed to be in the wrong place.
  • Loading branch information
MouJouNakki authored Aug 15, 2023
1 parent d4e09b3 commit 8b2c9f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ public float[] getColor() {
else {
color[1] = temperature - 60;
color[1] = 288f * (float)Math.pow(color[1], -0.07551);

color[1] = MathHelper.clamp(color[1]/255f, 0f, 1f);
}
color[1] = MathHelper.clamp(color[1]/255f, 0f, 1f);


//Calculate Blue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public enum PlanetIcons {
PlanetIcons(ResourceLocation resource, ResourceLocation leo) {
this.resource = resource;

this.resourceLEO = atmosphereLEO;
this.resourceLEO = leo;
}

public ResourceLocation getResource() {
Expand Down Expand Up @@ -1129,14 +1129,14 @@ else if(Temps.getTempFromValue(averageTemperature).hotterThan(Temps.COLD)) {
else if(Temps.getTempFromValue(averageTemperature).hotterThan(Temps.FRIGID)) {

for (Biome biome : Biome.REGISTRY) {
if (biome != null && !BiomeDictionary.getTypes(biome).contains(BiomeDictionary.Type.COLD) && !isBiomeblackListed(biome)) {
if (biome != null && BiomeDictionary.getTypes(biome).contains(BiomeDictionary.Type.COLD) && !isBiomeblackListed(biome)) {
viableBiomes.add(biome);
}
}
}
else {
for (Biome biome : Biome.REGISTRY) {
if (biome != null && !BiomeDictionary.getTypes(biome).contains(BiomeDictionary.Type.COLD) && !isBiomeblackListed(biome)) {
if (biome != null && BiomeDictionary.getTypes(biome).contains(BiomeDictionary.Type.COLD) && !isBiomeblackListed(biome)) {
viableBiomes.add(biome);
}
}
Expand Down

0 comments on commit 8b2c9f1

Please sign in to comment.