Skip to content

Commit

Permalink
1.3.143 - serene season compat
Browse files Browse the repository at this point in the history
I definitely have to say thanks for such a wonderful api, very convenient!
  • Loading branch information
kotmatross28729 committed Oct 17, 2024
1 parent 48b40e7 commit 0df1e88
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 47 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.143
* Added support for Serene Seasons
* All relevant settings in the parameters of each biome

# 1.3.142

**Attention: for the correct operation of biome temperatures on planets, go to: `Enviromine menu - Custom Editor - Profile settings - default_settings.cfg - Config - Generate Defaults - true`**
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
## EnviroMine ~~for Galaxy Odyssey~~ continuation
## EnviroMine continuation
#### based on [EnviroMine for Galaxy Odyssey](https://gitgud.io/AstroTibs/enviromine-for-galaxy-odyssey) by [AstroTibs](https://gitgud.io/AstroTibs)

## IMPORTANT:
**For most things in this mod to work correctly, do the following: `Enviromine menu - Custom Editor - Profile settings - default_settings.cfg - Config - Generate Defaults - true`**

**Please note, this is a very long process! may take up to 30 minutes of real time if you are using a large modpack**


## Physics for blocks is disabled by default!
#### To use it, go to: `Enviromine menu -> Custom editor -> Profile settings -> default_settings.cfg -> general -> Enable Physics -> true`,
#### then go to: `Profile settings -> default_settings.cfg -> Config -> Generate Blank Configs` and `Generate Defaults -> true` (both)
#### Please note, this is a very long process! may take up to 30 minutes of real time if you are using a large modpack
**To use it, go to: `Enviromine menu -> Custom editor -> Profile settings -> default_settings.cfg -> general -> Enable Physics -> true`,**

## Differences from the Galaxy Odyssey version:

#### 1) more sanity debuffs (due to the fact that sanity in the original enviromine does almost nothing dangerous (+, from 1.3.134 version, if your sanity is less than or equal to 5 (but greater than 0) you will die from a heart attack after 1 minute, but if your sanity is 0, then you will die after 30 seconds, and, if more than 30 seconds have passed and your sanity has JUST dropped to 0, you will die instantly(configurable + you can disable death, but instead, some debuffs will become of a higher level))
1) more sanity debuffs (due to the fact that sanity in the original enviromine does almost nothing dangerous (+, if your sanity is less than or equal to 5 you will die from a heart attack after 1 minute (configurable + you can disable death, but instead, some debuffs will become of a higher level))

### 2) Compatibility with Hbm's Nuclear Tech filters/masks/protective helmets
2) Compatibility with Hbm's Nuclear Tech filters/masks/protective helmets

### 3) Updated build script, thanks to GTNH!
3) Updated build script, thanks to GTNH!

### 4) Fixed a bug where the sound of the gas mask was played even when the game was paused
4) Fixed a bug where the sound of the gas mask was played even when the game was paused

### 5) Added a bunch of configs
5) Added a bunch of configs

### 6) Completely rewritten biome temperature system
6) Completely rewritten biome temperature system

### 7) Completely rewritte armor temperature system
7) Completely rewritte armor temperature system

### 8) Added compat with Hbm's NTM Space (fork)
8) Added compat with Hbm's NTM Space (fork)


# Credits:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ plugins {
id 'com.gtnewhorizons.gtnhconvention'
}

version = "1.3.142"
version = "1.3.143"
2 changes: 1 addition & 1 deletion src/main/java/enviromine/core/EM_Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class EM_Settings
public static File worldDir = null;

//Mod Data
public static final String VERSION = "1.3.142" + " kotmatross edition";
public static final String VERSION = "1.3.143" + " kotmatross edition";
public static final String MOD_ID = "enviromine";
public static final String MOD_NAME = "EnviroMine";
public static final String MOD_NAME_COLORIZED = EnumChatFormatting.AQUA + MOD_NAME + EnumChatFormatting.RESET;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/enviromine/core/EnviroMine.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public static boolean isTCLoaded() {
return Loader.isModLoaded("Thaumcraft");
}

public static boolean isSereneSeasonsLoaded() {
return Loader.isModLoaded("sereneseasons");
}

//public static EM_WorldData theWorldEM;

@EventHandler
Expand Down
71 changes: 62 additions & 9 deletions src/main/java/enviromine/handlers/EM_StatusManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import net.minecraftforge.common.EnumPlantType;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import sereneseasons.api.season.Season;
import sereneseasons.api.season.SeasonHelper;

import java.lang.reflect.Method;
import java.util.HashMap;
Expand Down Expand Up @@ -508,6 +510,21 @@ public static float[] getSurroundingData(EntityLivingBase entityLiving, int cube
float biome_DUSK_TEMPERATURE_TERRAFORMED = 4F;
float biome_NIGHT_TEMPERATURE_TERRAFORMED = 8F;


float biome_EARLY_SPRING_TEMPERATURE_DECREASE = 5.0F;
float biome_MID_SPRING_TEMPERATURE_DECREASE = -2.0F;
float biome_LATE_SPRING_TEMPERATURE_DECREASE = -1.0F;
float biome_EARLY_SUMMER_TEMPERATURE_DECREASE = -1.0F;
float biome_MID_SUMMER_TEMPERATURE_DECREASE = -3.0F;
float biome_LATE_SUMMER_TEMPERATURE_DECREASE = -1.0F;
float biome_EARLY_AUTUMN_TEMPERATURE_DECREASE = 6.0F;
float biome_MID_AUTUMN_TEMPERATURE_DECREASE = 8.0F;
float biome_LATE_AUTUMN_TEMPERATURE_DECREASE = 10.0F;
float biome_EARLY_WINTER_TEMPERATURE_DECREASE = 12.0F;
float biome_MID_WINTER_TEMPERATURE_DECREASE = 16.0F;
float biome_LATE_WINTER_TEMPERATURE_DECREASE = 10.0F;


if (biome != null) {
BiomeProperties biomeOverride = null;
if (BiomeProperties.base.hasProperty(biome)) {
Expand All @@ -527,6 +544,19 @@ public static float[] getSurroundingData(EntityLivingBase entityLiving, int cube
biome_DAY_TEMPERATURE_TERRAFORMED = biomeOverride.DAY_TEMPERATURE_TERRAFORMED;
biome_DUSK_TEMPERATURE_TERRAFORMED = biomeOverride.DUSK_TEMPERATURE_TERRAFORMED;
biome_NIGHT_TEMPERATURE_TERRAFORMED = biomeOverride.NIGHT_TEMPERATURE_TERRAFORMED;

biome_EARLY_SPRING_TEMPERATURE_DECREASE = biomeOverride.EARLY_SPRING_TEMPERATURE_DECREASE;
biome_MID_SPRING_TEMPERATURE_DECREASE = biomeOverride.MID_SPRING_TEMPERATURE_DECREASE;
biome_LATE_SPRING_TEMPERATURE_DECREASE = biomeOverride.LATE_SPRING_TEMPERATURE_DECREASE;
biome_EARLY_SUMMER_TEMPERATURE_DECREASE = biomeOverride.EARLY_SUMMER_TEMPERATURE_DECREASE;
biome_MID_SUMMER_TEMPERATURE_DECREASE = biomeOverride.MID_SUMMER_TEMPERATURE_DECREASE;
biome_LATE_SUMMER_TEMPERATURE_DECREASE = biomeOverride.LATE_SUMMER_TEMPERATURE_DECREASE;
biome_EARLY_AUTUMN_TEMPERATURE_DECREASE = biomeOverride.EARLY_AUTUMN_TEMPERATURE_DECREASE;
biome_MID_AUTUMN_TEMPERATURE_DECREASE = biomeOverride.MID_AUTUMN_TEMPERATURE_DECREASE;
biome_LATE_AUTUMN_TEMPERATURE_DECREASE = biomeOverride.LATE_AUTUMN_TEMPERATURE_DECREASE;
biome_EARLY_WINTER_TEMPERATURE_DECREASE = biomeOverride.EARLY_WINTER_TEMPERATURE_DECREASE;
biome_MID_WINTER_TEMPERATURE_DECREASE = biomeOverride.MID_WINTER_TEMPERATURE_DECREASE;
biome_LATE_WINTER_TEMPERATURE_DECREASE = biomeOverride.LATE_WINTER_TEMPERATURE_DECREASE;
}
}

Expand All @@ -552,23 +582,46 @@ public static float[] getSurroundingData(EntityLivingBase entityLiving, int cube
temperatureChange = calculateTemperatureChange(currentTime % 24000L, biome_DAWN_TEMPERATURE, biome_DAY_TEMPERATURE, biome_DUSK_TEMPERATURE, biome_NIGHT_TEMPERATURE);
}

biomeTemperature -= temperatureChange;
if (biome.rainfall <= 0F || isDesertBiome) {
biomeTemperature -= temperatureChange * DesertBiomeTemperatureMultiplier;
} else {
biomeTemperature -= temperatureChange;
}

if(EnviroMine.isHbmSpaceLoaded()) {
if(EnviroMine.isSereneSeasonsLoaded()) {
Season.SubSeason currentSubSeason = SeasonHelper.getSeasonState(entityLiving.worldObj).getSubSeason();
if(currentSubSeason != null) {
switch (currentSubSeason) {
case EARLY_SPRING -> biomeTemperature -= biome_EARLY_SPRING_TEMPERATURE_DECREASE;
case MID_SPRING -> biomeTemperature -= biome_MID_SPRING_TEMPERATURE_DECREASE;
case LATE_SPRING -> biomeTemperature -= biome_LATE_SPRING_TEMPERATURE_DECREASE;

case EARLY_SUMMER -> biomeTemperature -= biome_EARLY_SUMMER_TEMPERATURE_DECREASE;
case MID_SUMMER -> biomeTemperature -= biome_MID_SUMMER_TEMPERATURE_DECREASE;
case LATE_SUMMER -> biomeTemperature -= biome_LATE_SUMMER_TEMPERATURE_DECREASE;

case EARLY_AUTUMN -> biomeTemperature -= biome_EARLY_AUTUMN_TEMPERATURE_DECREASE;
case MID_AUTUMN -> biomeTemperature -= biome_MID_AUTUMN_TEMPERATURE_DECREASE;
case LATE_AUTUMN -> biomeTemperature -= biome_LATE_AUTUMN_TEMPERATURE_DECREASE;

case EARLY_WINTER -> biomeTemperature -= biome_EARLY_WINTER_TEMPERATURE_DECREASE;
case MID_WINTER -> biomeTemperature -= biome_MID_WINTER_TEMPERATURE_DECREASE;
case LATE_WINTER -> biomeTemperature -= biome_LATE_WINTER_TEMPERATURE_DECREASE;
}
}
}

ThreeInts pos = new ThreeInts((int)entityLiving.posX, (int)(entityLiving.posY + entityLiving.getEyeHeight()), (int)entityLiving.posZ);
//List<AtmosphereBlob> nearbyBlobs = ChunkAtmosphereManager.proxy.getBlobsWithinRadius(entityLiving.worldObj, pos, 3);
//I still don't understand why there are other access modifiers besides public?
List<AtmosphereBlob> nearbyBlobs = getBlobsWithinRadius(ChunkAtmosphereManager.proxy, entityLiving.worldObj, pos, 256);
//List<AtmosphereBlob> blobs = ChunkAtmosphereManager.proxy.getBlobs(entityLiving.worldObj, (int)entityLiving.posX, (int)((float)entityLiving.posY + entityLiving.getEyeHeight()), (int)entityLiving.posZ);
for(AtmosphereBlob blob : nearbyBlobs) {
if(blob.hasFluid(Fluids.AIR, 0.19) || blob.hasFluid(Fluids.OXYGEN, 0.09)) {
if(EnviroMine.isHbmSpaceLoaded()) {
if(entityLiving.ticksExisted % 20 == 0) {
ThreeInts pos = new ThreeInts((int) entityLiving.posX, (int) (entityLiving.posY), (int) entityLiving.posZ);
//I still don't understand why there are other access modifiers besides public?
List<AtmosphereBlob> nearbyBlobs = getBlobsWithinRadius(ChunkAtmosphereManager.proxy, entityLiving.worldObj, pos, 256);
for (AtmosphereBlob blob : nearbyBlobs) {
if (blob.hasFluid(Fluids.AIR, 0.19) || blob.hasFluid(Fluids.OXYGEN, 0.09)) {
biomeTemperature = 24; //TODO HARDCODED
}
}
}
}
}

Expand Down
Loading

0 comments on commit 0df1e88

Please sign in to comment.