backport.

This commit is contained in:
bconlon 2020-08-25 14:49:54 -07:00
parent 1370e77b91
commit 7db4b74ecf
3 changed files with 36 additions and 21 deletions

View file

@ -33,6 +33,8 @@ public class AetherConfig {
private static boolean aether_start; private static boolean aether_start;
private static boolean disable_eternal_day;
public static void init(File location) { public static void init(File location) {
File newFile = new File(location + "/aether" + "/AetherI.cfg"); File newFile = new File(location + "/aether" + "/AetherI.cfg");
@ -79,6 +81,8 @@ public class AetherConfig {
repeat_sun_spirit_dialog = config.get("Misc", "If disabed, the Sun Spirit's dialog will only show once per world.", true).getBoolean(true); repeat_sun_spirit_dialog = config.get("Misc", "If disabed, the Sun Spirit's dialog will only show once per world.", true).getBoolean(true);
disable_eternal_day = config.get("Misc", "Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks.", false).getBoolean(false);
config.save(); config.save();
} }
@ -168,4 +172,9 @@ public class AetherConfig {
{ {
return aether_start; return aether_start;
} }
public static boolean eternalDayDisabled()
{
return disable_eternal_day;
}
} }

View file

@ -207,6 +207,8 @@ public class EntitySunSpirit extends EntityFlying implements IMob, IAetherBoss {
dungeonTarget.triggerAchievement(AchievementsAether.defeat_gold); dungeonTarget.triggerAchievement(AchievementsAether.defeat_gold);
if (!AetherConfig.eternalDayDisabled())
{
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)
{ {
if (!AetherData.getInstance(this.worldObj).isEternalDay()) if (!AetherData.getInstance(this.worldObj).isEternalDay())
@ -214,6 +216,7 @@ public class EntitySunSpirit extends EntityFlying implements IMob, IAetherBoss {
AetherData.getInstance(this.worldObj).setEternalDay(true); AetherData.getInstance(this.worldObj).setEternalDay(true);
} }
} }
}
this.setDoor(Blocks.air); this.setDoor(Blocks.air);
this.unlockTreasure(); this.unlockTreasure();

View file

@ -34,6 +34,8 @@ public class AetherWorldProvider extends WorldProvider {
@Override @Override
public float calculateCelestialAngle(long worldTime, float partialTicks) public float calculateCelestialAngle(long worldTime, float partialTicks)
{
if (!AetherConfig.eternalDayDisabled())
{ {
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)
{ {
@ -66,8 +68,9 @@ public class AetherWorldProvider extends WorldProvider {
data.setAetherTime(6000); data.setAetherTime(6000);
} }
} }
}
int i = (int)(this.aetherTime % 24000L); int i = (int)(AetherConfig.eternalDayDisabled() ? worldTime : this.aetherTime % 24000L);
float f = ((float)i + partialTicks) / 24000.0F - 0.25F; float f = ((float)i + partialTicks) / 24000.0F - 0.25F;