-
Notifications
You must be signed in to change notification settings - Fork 753
/
OverworldProvider.java
65 lines (52 loc) · 1.35 KB
/
OverworldProvider.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package tconstruct.worldgen;
import net.minecraft.world.WorldProvider;
public class OverworldProvider extends WorldProvider
{
@Override
public String getDimensionName ()
{
return "Overworld";
}
public boolean getWorldHasVoidParticles ()
{
return this.terrainType.hasVoidParticles(this.hasNoSky);
}
public float calculateCelestialAngle (long worldtime, float par3)
{
int timeOfDay = 18000;
float f1 = ((float) timeOfDay + par3) / 24000.0F - 0.25F;
if (f1 < 0.0F)
{
++f1;
}
if (f1 > 1.0F)
{
--f1;
}
float f2 = f1;
f1 = 1.0F - (float) ((Math.cos((double) f1 * Math.PI) + 1.0D) / 2.0D);
f1 = f2 + (f1 - f2) / 3.0F;
return f1;
}
/*public float calculateCelestialAngle(long worldtime, float par3)
{
int timeOfDay = (int)(worldtime % 43200L);
float f1 = ((float)timeOfDay + par3) / 43200.0F - 0.25F;
if (f1 < 0.0F)
{
++f1;
}
if (f1 > 1.0F)
{
--f1;
}
float f2 = f1;
f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D);
f1 = f2 + (f1 - f2) / 3.0F;
return f1;
}
public int getMoonPhase(long par1)
{
return (int)(par1 / 43200L) % 8;
}*/
}