001 package net.minecraft.world.chunk;
002
003 import cpw.mods.fml.relauncher.Side;
004 import cpw.mods.fml.relauncher.SideOnly;
005 import java.util.List;
006 import java.util.Random;
007 import net.minecraft.command.IEntitySelector;
008 import net.minecraft.entity.Entity;
009 import net.minecraft.tileentity.TileEntity;
010 import net.minecraft.util.AxisAlignedBB;
011 import net.minecraft.world.EnumSkyBlock;
012 import net.minecraft.world.World;
013
014 public class EmptyChunk extends Chunk
015 {
016 public EmptyChunk(World par1World, int par2, int par3)
017 {
018 super(par1World, par2, par3);
019 }
020
021 /**
022 * Checks whether the chunk is at the X/Z location specified
023 */
024 public boolean isAtLocation(int par1, int par2)
025 {
026 return par1 == this.xPosition && par2 == this.zPosition;
027 }
028
029 /**
030 * Returns the value in the height map at this x, z coordinate in the chunk
031 */
032 public int getHeightValue(int par1, int par2)
033 {
034 return 0;
035 }
036
037 /**
038 * Generates the initial skylight map for the chunk upon generation or load.
039 */
040 public void generateSkylightMap() {}
041
042 @SideOnly(Side.CLIENT)
043
044 /**
045 * Generates the height map for a chunk from scratch
046 */
047 public void generateHeightMap() {}
048
049 /**
050 * Return the ID of a block in the chunk.
051 */
052 public int getBlockID(int par1, int par2, int par3)
053 {
054 return 0;
055 }
056
057 public int getBlockLightOpacity(int par1, int par2, int par3)
058 {
059 return 255;
060 }
061
062 /**
063 * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata
064 */
065 public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
066 {
067 return true;
068 }
069
070 /**
071 * Sets a blockID for a position in the chunk. Args: x, y, z, blockID
072 */
073 public boolean setBlockID(int par1, int par2, int par3, int par4)
074 {
075 return true;
076 }
077
078 /**
079 * Return the metadata corresponding to the given coordinates inside a chunk.
080 */
081 public int getBlockMetadata(int par1, int par2, int par3)
082 {
083 return 0;
084 }
085
086 /**
087 * Set the metadata of a block in the chunk
088 */
089 public boolean setBlockMetadata(int par1, int par2, int par3, int par4)
090 {
091 return false;
092 }
093
094 /**
095 * Gets the amount of light saved in this block (doesn't adjust for daylight)
096 */
097 public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
098 {
099 return 0;
100 }
101
102 /**
103 * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a
104 * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue
105 */
106 public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) {}
107
108 /**
109 * Gets the amount of light on a block taking into account sunlight
110 */
111 public int getBlockLightValue(int par1, int par2, int par3, int par4)
112 {
113 return 0;
114 }
115
116 /**
117 * Adds an entity to the chunk. Args: entity
118 */
119 public void addEntity(Entity par1Entity) {}
120
121 /**
122 * removes entity using its y chunk coordinate as its index
123 */
124 public void removeEntity(Entity par1Entity) {}
125
126 /**
127 * Removes entity at the specified index from the entity array.
128 */
129 public void removeEntityAtIndex(Entity par1Entity, int par2) {}
130
131 /**
132 * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap)
133 */
134 public boolean canBlockSeeTheSky(int par1, int par2, int par3)
135 {
136 return false;
137 }
138
139 /**
140 * Gets the TileEntity for a given block in this chunk
141 */
142 public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3)
143 {
144 return null;
145 }
146
147 /**
148 * Adds a TileEntity to a chunk
149 */
150 public void addTileEntity(TileEntity par1TileEntity) {}
151
152 /**
153 * Sets the TileEntity for a given block in this chunk
154 */
155 public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) {}
156
157 /**
158 * Removes the TileEntity for a given block in this chunk
159 */
160 public void removeChunkBlockTileEntity(int par1, int par2, int par3) {}
161
162 /**
163 * Called when this Chunk is loaded by the ChunkProvider
164 */
165 public void onChunkLoad() {}
166
167 /**
168 * Called when this Chunk is unloaded by the ChunkProvider
169 */
170 public void onChunkUnload() {}
171
172 /**
173 * Sets the isModified flag for this Chunk
174 */
175 public void setChunkModified() {}
176
177 /**
178 * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity
179 * Args: entity, aabb, listToFill
180 */
181 public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List) {}
182
183 /**
184 * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill
185 */
186 public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {}
187
188 /**
189 * Returns true if this Chunk needs to be saved
190 */
191 public boolean needsSaving(boolean par1)
192 {
193 return false;
194 }
195
196 public Random getRandomWithSeed(long par1)
197 {
198 return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ par1);
199 }
200
201 public boolean isEmpty()
202 {
203 return true;
204 }
205
206 /**
207 * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty
208 * (true) or not (false).
209 */
210 public boolean getAreLevelsEmpty(int par1, int par2)
211 {
212 return true;
213 }
214 }