WorldProviderHell .java

net.minecraft.world.WorldProviderHell (class): members: generateLightBrightnessTable, registerWorldChunkManager, calculateCelestialAngle, canRespawnHere.

net.minecraft.worldclass121 linescommonextends WorldProvider3.0 KB

API Surface (14)

void registerWorldChunkManager()
Vec3 getFogColor(float p_76562_1_, float p_76562_2_)
void generateLightBrightnessTable()
IChunkProvider createChunkGenerator()
boolean isSurfaceWorld()
boolean canCoordinateBeSpawn(int x, int z)
float calculateCelestialAngle(long worldTime, float partialTicks)
boolean canRespawnHere()
boolean doesXZShowFog(int x, int z)
String getDimensionName()
String getInternalNameSuffix()
WorldBorder getWorldBorder()
double getCenterX()
double getCenterZ()

String literals (2)

"Nether"
"_nether"

Code Graph: Dependencies (8)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

WorldProviderHell.java121 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world;
2
3
import net.minecraft.util.Vec3;
4
import net.minecraft.world.biome.BiomeGenBase;
5
import net.minecraft.world.biome.WorldChunkManagerHell;
6
import net.minecraft.world.border.WorldBorder;
7
import net.minecraft.world.chunk.IChunkProvider;
8
import net.minecraft.world.gen.ChunkProviderHell;
9
10
public class WorldProviderHell extends WorldProvider
11
{
12
    /**
13
     * creates a new world chunk manager for WorldProvider
14
     */
15
    public void registerWorldChunkManager()
16
    {
17
        this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F);
18
        this.isHellWorld = true;
19
        this.hasNoSky = true;
20
        this.dimensionId = -1;
21
    }
22
23
    /**
24
     * Return Vec3D with biome specific fog color
25
     */
26
    public Vec3 getFogColor(float p_76562_1_, float p_76562_2_)
27
    {
28
        return new Vec3(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D);
29
    }
30
31
    /**
32
     * Creates the light to brightness table
33
     */
34
    protected void generateLightBrightnessTable()
35
    {
36
        float f = 0.1F;
37
38
        for (int i = 0; i <= 15; ++i)
39
        {
40
            float f1 = 1.0F - (float)i / 15.0F;
41
            this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
42
        }
43
    }
44
45
    /**
46
     * Returns a new chunk provider which generates chunks for this world
47
     */
48
    public IChunkProvider createChunkGenerator()
49
    {
50
        return new ChunkProviderHell(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed());
51
    }
52
53
    /**
54
     * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.
55
     */
56
    public boolean isSurfaceWorld()
57
    {
58
        return false;
59
    }
60
61
    /**
62
     * Will check if the x, z position specified is alright to be set as the map spawn point
63
     */
64
    public boolean canCoordinateBeSpawn(int x, int z)
65
    {
66
        return false;
67
    }
68
69
    /**
70
     * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)
71
     */
72
    public float calculateCelestialAngle(long worldTime, float partialTicks)
73
    {
74
        return 0.5F;
75
    }
76
77
    /**
78
     * True if the player can respawn in this dimension (true = overworld, false = nether).
79
     */
80
    public boolean canRespawnHere()
81
    {
82
        return false;
83
    }
84
85
    /**
86
     * Returns true if the given X,Z coordinate should show environmental fog.
87
     */
88
    public boolean doesXZShowFog(int x, int z)
89
    {
90
        return true;
91
    }
92
93
    /**
94
     * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
95
     */
96
    public String getDimensionName()
97
    {
98
        return "Nether";
99
    }
100
101
    public String getInternalNameSuffix()
102
    {
103
        return "_nether";
104
    }
105
106
    public WorldBorder getWorldBorder()
107
    {
108
        return new WorldBorder()
109
        {
110
            public double getCenterX()
111
            {
112
                return super.getCenterX() / 8.0D;
113
            }
114
            public double getCenterZ()
115
            {
116
                return super.getCenterZ() / 8.0D;
117
            }
118
        };
119
    }
120
}
121

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