WorldProviderEnd .java

net.minecraft.world.WorldProviderEnd (class): members: calcSunriseSunsetColors, getAverageGroundLevel, getCloudHeight, isSkyColored, canCoordinateBeSpawn.

net.minecraft.worldclass132 linescommonextends WorldProvider3.3 KB

API Surface (15)

void registerWorldChunkManager()
IChunkProvider createChunkGenerator()
float calculateCelestialAngle(long worldTime, float partialTicks)
float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks)
Vec3 getFogColor(float p_76562_1_, float p_76562_2_)
boolean isSkyColored()
boolean canRespawnHere()
boolean isSurfaceWorld()
float getCloudHeight()
boolean canCoordinateBeSpawn(int x, int z)
BlockPos getSpawnCoordinate()
int getAverageGroundLevel()
boolean doesXZShowFog(int x, int z)
String getDimensionName()
String getInternalNameSuffix()

String literals (2)

"The End"
"_end"

Full Source

WorldProviderEnd.java132 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world;
2
3
import net.minecraft.util.BlockPos;
4
import net.minecraft.util.MathHelper;
5
import net.minecraft.util.Vec3;
6
import net.minecraft.world.biome.BiomeGenBase;
7
import net.minecraft.world.biome.WorldChunkManagerHell;
8
import net.minecraft.world.chunk.IChunkProvider;
9
import net.minecraft.world.gen.ChunkProviderEnd;
10
11
public class WorldProviderEnd extends WorldProvider
12
{
13
    /**
14
     * creates a new world chunk manager for WorldProvider
15
     */
16
    public void registerWorldChunkManager()
17
    {
18
        this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F);
19
        this.dimensionId = 1;
20
        this.hasNoSky = true;
21
    }
22
23
    /**
24
     * Returns a new chunk provider which generates chunks for this world
25
     */
26
    public IChunkProvider createChunkGenerator()
27
    {
28
        return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
29
    }
30
31
    /**
32
     * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)
33
     */
34
    public float calculateCelestialAngle(long worldTime, float partialTicks)
35
    {
36
        return 0.0F;
37
    }
38
39
    /**
40
     * Returns array with sunrise/sunset colors
41
     */
42
    public float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks)
43
    {
44
        return null;
45
    }
46
47
    /**
48
     * Return Vec3D with biome specific fog color
49
     */
50
    public Vec3 getFogColor(float p_76562_1_, float p_76562_2_)
51
    {
52
        int i = 10518688;
53
        float f = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
54
        f = MathHelper.clamp_float(f, 0.0F, 1.0F);
55
        float f1 = (float)(i >> 16 & 255) / 255.0F;
56
        float f2 = (float)(i >> 8 & 255) / 255.0F;
57
        float f3 = (float)(i & 255) / 255.0F;
58
        f1 = f1 * (f * 0.0F + 0.15F);
59
        f2 = f2 * (f * 0.0F + 0.15F);
60
        f3 = f3 * (f * 0.0F + 0.15F);
61
        return new Vec3((double)f1, (double)f2, (double)f3);
62
    }
63
64
    public boolean isSkyColored()
65
    {
66
        return false;
67
    }
68
69
    /**
70
     * True if the player can respawn in this dimension (true = overworld, false = nether).
71
     */
72
    public boolean canRespawnHere()
73
    {
74
        return false;
75
    }
76
77
    /**
78
     * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.
79
     */
80
    public boolean isSurfaceWorld()
81
    {
82
        return false;
83
    }
84
85
    /**
86
     * the y level at which clouds are rendered.
87
     */
88
    public float getCloudHeight()
89
    {
90
        return 8.0F;
91
    }
92
93
    /**
94
     * Will check if the x, z position specified is alright to be set as the map spawn point
95
     */
96
    public boolean canCoordinateBeSpawn(int x, int z)
97
    {
98
        return this.worldObj.getGroundAboveSeaLevel(new BlockPos(x, 0, z)).getMaterial().blocksMovement();
99
    }
100
101
    public BlockPos getSpawnCoordinate()
102
    {
103
        return new BlockPos(100, 50, 0);
104
    }
105
106
    public int getAverageGroundLevel()
107
    {
108
        return 50;
109
    }
110
111
    /**
112
     * Returns true if the given X,Z coordinate should show environmental fog.
113
     */
114
    public boolean doesXZShowFog(int x, int z)
115
    {
116
        return true;
117
    }
118
119
    /**
120
     * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
121
     */
122
    public String getDimensionName()
123
    {
124
        return "The End";
125
    }
126
127
    public String getInternalNameSuffix()
128
    {
129
        return "_end";
130
    }
131
}
132

Deobfuscated MCP 1.8.9 source of WorldProviderEnd from Marcelektro/MavenMCP-1.8.9 (net/minecraft/world/WorldProviderEnd.java), stored verbatim.