mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Improve Time Modifier
This commit is contained in:
1 parent
6d774de5a6
commit
4441d78eb2
1 file changed
+7
-3
@@ -27,12 +27,16 @@ import forestry.greenhouse.api.climate.IClimateModifier;
|
||||
|
||||
public class TimeModifier implements IClimateModifier {
|
||||
|
||||
private static final float TEMPERATURE_CHANGE = 0.1F;
|
||||
private static final float TEMPERATURE_CHANGE = 0.05F;
|
||||
|
||||
public static float calculateLightRatio(World world) {
|
||||
private static float calculateLightRatio(World world) {
|
||||
int lightValue = EnumSkyBlock.SKY.defaultLightValue - world.getSkylightSubtracted();
|
||||
float sunAngle = world.getCelestialAngleRadians(1.0F);
|
||||
|
||||
if(!world.isDaytime()){
|
||||
lightValue = EnumSkyBlock.SKY.defaultLightValue - lightValue;
|
||||
}
|
||||
|
||||
if (sunAngle < (float) Math.PI) {
|
||||
sunAngle -= sunAngle * 0.2F;
|
||||
} else {
|
||||
@@ -41,7 +45,7 @@ public class TimeModifier implements IClimateModifier {
|
||||
|
||||
lightValue = Math.round(lightValue * MathHelper.cos(sunAngle));
|
||||
|
||||
lightValue = MathHelper.clamp(lightValue, 0, 15);
|
||||
lightValue = MathHelper.clamp(lightValue, -15, 15);
|
||||
return lightValue / 15f;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user