EmptyChunk .java

net.minecraft.world.chunk.EmptyChunk (class): members: getEntitiesWithinAABBForEntity, getEntitiesOfTypeWithinAAAB, getBlockLightOpacity, setChunkModified.

net.minecraft.world.chunkclass183 linescommonextends Chunk4.1 KB

API Surface (27)

boolean isAtLocation(int x, int z)
int getHeightValue(int x, int z)
void generateHeightMap()
void generateSkylightMap()
Block getBlock(BlockPos pos)
int getBlockLightOpacity(BlockPos pos)
int getBlockMetadata(BlockPos pos)
int getLightFor(EnumSkyBlock p_177413_1_, BlockPos pos)
void setLightFor(EnumSkyBlock p_177431_1_, BlockPos pos, int value)
int getLightSubtracted(BlockPos pos, int amount)
void addEntity(Entity entityIn)
void removeEntity(Entity entityIn)
void removeEntityAtIndex(Entity entityIn, int p_76608_2_)
boolean canSeeSky(BlockPos pos)
TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_)
void addTileEntity(TileEntity tileEntityIn)
void addTileEntity(BlockPos pos, TileEntity tileEntityIn)
void removeTileEntity(BlockPos pos)
void onChunkLoad()
void onChunkUnload()
void setChunkModified()
void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List<Entity> listToFill, Predicate <? super Entity > p_177414_4_)
<T extends Entity> void getEntitiesOfTypeWithinAAAB(Class <? extends T > entityClass, AxisAlignedBB aabb, List<T> listToFill, Predicate <? super T > p_177430_4_)
boolean needsSaving(boolean p_76601_1_)
Random getRandomWithSeed(long seed)
boolean isEmpty()
boolean getAreLevelsEmpty(int startY, int endY)

Full Source

EmptyChunk.java183 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.chunk;
2
3
import com.google.common.base.Predicate;
4
import java.util.List;
5
import java.util.Random;
6
import net.minecraft.block.Block;
7
import net.minecraft.entity.Entity;
8
import net.minecraft.init.Blocks;
9
import net.minecraft.tileentity.TileEntity;
10
import net.minecraft.util.AxisAlignedBB;
11
import net.minecraft.util.BlockPos;
12
import net.minecraft.world.EnumSkyBlock;
13
import net.minecraft.world.World;
14
15
public class EmptyChunk extends Chunk
16
{
17
    public EmptyChunk(World worldIn, int x, int z)
18
    {
19
        super(worldIn, x, z);
20
    }
21
22
    /**
23
     * Checks whether the chunk is at the X/Z location specified
24
     */
25
    public boolean isAtLocation(int x, int z)
26
    {
27
        return x == this.xPosition && z == this.zPosition;
28
    }
29
30
    /**
31
     * Returns the value in the height map at this x, z coordinate in the chunk
32
     */
33
    public int getHeightValue(int x, int z)
34
    {
35
        return 0;
36
    }
37
38
    /**
39
     * Generates the height map for a chunk from scratch
40
     */
41
    public void generateHeightMap()
42
    {
43
    }
44
45
    /**
46
     * Generates the initial skylight map for the chunk upon generation or load.
47
     */
48
    public void generateSkylightMap()
49
    {
50
    }
51
52
    public Block getBlock(BlockPos pos)
53
    {
54
        return Blocks.air;
55
    }
56
57
    public int getBlockLightOpacity(BlockPos pos)
58
    {
59
        return 255;
60
    }
61
62
    public int getBlockMetadata(BlockPos pos)
63
    {
64
        return 0;
65
    }
66
67
    public int getLightFor(EnumSkyBlock p_177413_1_, BlockPos pos)
68
    {
69
        return p_177413_1_.defaultLightValue;
70
    }
71
72
    public void setLightFor(EnumSkyBlock p_177431_1_, BlockPos pos, int value)
73
    {
74
    }
75
76
    public int getLightSubtracted(BlockPos pos, int amount)
77
    {
78
        return 0;
79
    }
80
81
    /**
82
     * Adds an entity to the chunk. Args: entity
83
     */
84
    public void addEntity(Entity entityIn)
85
    {
86
    }
87
88
    /**
89
     * removes entity using its y chunk coordinate as its index
90
     */
91
    public void removeEntity(Entity entityIn)
92
    {
93
    }
94
95
    /**
96
     * Removes entity at the specified index from the entity array.
97
     */
98
    public void removeEntityAtIndex(Entity entityIn, int p_76608_2_)
99
    {
100
    }
101
102
    public boolean canSeeSky(BlockPos pos)
103
    {
104
        return false;
105
    }
106
107
    public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_)
108
    {
109
        return null;
110
    }
111
112
    public void addTileEntity(TileEntity tileEntityIn)
113
    {
114
    }
115
116
    public void addTileEntity(BlockPos pos, TileEntity tileEntityIn)
117
    {
118
    }
119
120
    public void removeTileEntity(BlockPos pos)
121
    {
122
    }
123
124
    /**
125
     * Called when this Chunk is loaded by the ChunkProvider
126
     */
127
    public void onChunkLoad()
128
    {
129
    }
130
131
    /**
132
     * Called when this Chunk is unloaded by the ChunkProvider
133
     */
134
    public void onChunkUnload()
135
    {
136
    }
137
138
    /**
139
     * Sets the isModified flag for this Chunk
140
     */
141
    public void setChunkModified()
142
    {
143
    }
144
145
    /**
146
     * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity.
147
     */
148
    public void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List<Entity> listToFill, Predicate <? super Entity > p_177414_4_)
149
    {
150
    }
151
152
    public <T extends Entity> void getEntitiesOfTypeWithinAAAB(Class <? extends T > entityClass, AxisAlignedBB aabb, List<T> listToFill, Predicate <? super T > p_177430_4_)
153
    {
154
    }
155
156
    /**
157
     * Returns true if this Chunk needs to be saved
158
     */
159
    public boolean needsSaving(boolean p_76601_1_)
160
    {
161
        return false;
162
    }
163
164
    public Random getRandomWithSeed(long seed)
165
    {
166
        return new Random(this.getWorld().getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ seed);
167
    }
168
169
    public boolean isEmpty()
170
    {
171
        return true;
172
    }
173
174
    /**
175
     * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty
176
     * (true) or not (false).
177
     */
178
    public boolean getAreLevelsEmpty(int startY, int endY)
179
    {
180
        return true;
181
    }
182
}
183

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