|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.minecraft.world.chunk.Chunk
public class Chunk
Field Summary | |
---|---|
Map |
chunkTileEntityMap
A Map of ChunkPositions to TileEntities in this chunk |
boolean |
deferRender
|
List[] |
entityLists
Array of Lists containing the entities in this Chunk. |
int |
field_82912_p
|
boolean |
hasEntities
Whether this Chunk has any Entities and thus requires saving on every tick |
int[] |
heightMap
|
boolean |
isChunkLoaded
Whether or not this Chunk is currently loaded into the World |
static boolean |
isLit
Determines if the chunk is lit or not at a light value greater than 0. |
boolean |
isModified
Set to true if the chunk has been modified and needs to be updated internally. |
boolean |
isTerrainPopulated
Boolean value indicating if the terrain is populated. |
long |
lastSaveTime
The time according to World.worldTime when this chunk was last saved |
int[] |
precipitationHeightMap
A map, similar to heightMap, that tracks how far down precipitation can fall. |
boolean[] |
updateSkylightColumns
Which columns need their skylightMaps updated. |
World |
worldObj
Reference to the World object. |
int |
xPosition
The x coordinate of the chunk. |
int |
zPosition
The z coordinate of the chunk. |
Constructor Summary | |
---|---|
Chunk(World world,
byte[] ids,
byte[] metadata,
int chunkX,
int chunkZ)
Metadata sensitive Chunk constructor for use in new ChunkProviders that use metadata sensitive blocks during generation. |
|
Chunk(World par1World,
byte[] par2ArrayOfByte,
int par3,
int par4)
|
|
Chunk(World par1World,
int par2,
int par3)
|
|
Chunk(World world,
short[] ids,
byte[] metadata,
int chunkX,
int chunkZ)
A Chunk Constructor which handles shorts to allow block ids > 256 (full 4096 range) Meta data sensitive NOTE: The x,y,z order of the array is different from the native Chunk constructor to allow for generation > y127 NOTE: This is possibly more efficient than the standard constructor due to less memory skipping |
Method Summary | |
---|---|
void |
addEntity(Entity par1Entity)
Adds an entity to the chunk. |
void |
addTileEntity(TileEntity par1TileEntity)
Adds a TileEntity to a chunk |
boolean |
canBlockSeeTheSky(int par1,
int par2,
int par3)
Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) |
void |
cleanChunkBlockTileEntity(int x,
int y,
int z)
FORGE: Used to remove only invalid TileEntities |
void |
enqueueRelightChecks()
Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8 blocks at a time. |
void |
fillChunk(byte[] par1ArrayOfByte,
int par2,
int par3,
boolean par4)
|
void |
generateHeightMap()
|
void |
generateSkylightMap()
Generates the initial skylight map for the chunk upon generation or load. |
boolean |
getAreLevelsEmpty(int par1,
int par2)
Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) or not (false). |
byte[] |
getBiomeArray()
Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs. |
BiomeGenBase |
getBiomeGenForWorldCoords(int par1,
int par2,
WorldChunkManager par3WorldChunkManager)
This method retrieves the biome at a set of coordinates |
int |
getBlockID(int par1,
int par2,
int par3)
Return the ID of a block in the chunk. |
int |
getBlockLightOpacity(int par1,
int par2,
int par3)
|
int |
getBlockLightValue(int par1,
int par2,
int par3,
int par4)
Gets the amount of light on a block taking into account sunlight |
int |
getBlockMetadata(int par1,
int par2,
int par3)
Return the metadata corresponding to the given coordinates inside a chunk. |
ExtendedBlockStorage[] |
getBlockStorageArray()
Returns the ExtendedBlockStorage array for this Chunk. |
TileEntity |
getChunkBlockTileEntity(int par1,
int par2,
int par3)
Gets the TileEntity for a given block in this chunk |
ChunkCoordIntPair |
getChunkCoordIntPair()
Gets a ChunkCoordIntPair representing the Chunk's position. |
void |
getEntitiesOfTypeWithinAAAB(Class par1Class,
AxisAlignedBB par2AxisAlignedBB,
List par3List,
IEntitySelector par4IEntitySelector)
Gets all entities that can be assigned to the specified class. |
void |
getEntitiesWithinAABBForEntity(Entity par1Entity,
AxisAlignedBB par2AxisAlignedBB,
List par3List)
Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity Args: entity, aabb, listToFill |
int |
getHeightValue(int par1,
int par2)
Returns the value in the height map at this x, z coordinate in the chunk |
int |
getPrecipitationHeight(int par1,
int par2)
Gets the height to which rain/snow will fall. |
Random |
getRandomWithSeed(long par1)
|
int |
getSavedLightValue(EnumSkyBlock par1EnumSkyBlock,
int par2,
int par3,
int par4)
Gets the amount of light saved in this block (doesn't adjust for daylight) |
int |
getTopFilledSegment()
Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block. |
boolean |
isAtLocation(int par1,
int par2)
Checks whether the chunk is at the X/Z location specified |
boolean |
isEmpty()
|
boolean |
needsSaving(boolean par1)
Returns true if this Chunk needs to be saved |
void |
onChunkLoad()
Called when this Chunk is loaded by the ChunkProvider |
void |
onChunkUnload()
Called when this Chunk is unloaded by the ChunkProvider |
void |
populateChunk(IChunkProvider par1IChunkProvider,
IChunkProvider par2IChunkProvider,
int par3,
int par4)
|
void |
removeChunkBlockTileEntity(int par1,
int par2,
int par3)
Removes the TileEntity for a given block in this chunk |
void |
removeEntity(Entity par1Entity)
removes entity using its y chunk coordinate as its index |
void |
removeEntityAtIndex(Entity par1Entity,
int par2)
Removes entity at the specified index from the entity array. |
void |
resetRelightChecks()
Resets the relight check index to 0 for this Chunk. |
void |
setBiomeArray(byte[] par1ArrayOfByte)
Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to biome IDs. |
boolean |
setBlockID(int par1,
int par2,
int par3,
int par4)
Sets a blockID for a position in the chunk. |
boolean |
setBlockIDWithMetadata(int par1,
int par2,
int par3,
int par4,
int par5)
Sets a blockID of a position within a chunk with metadata. |
boolean |
setBlockMetadata(int par1,
int par2,
int par3,
int par4)
Set the metadata of a block in the chunk |
void |
setChunkBlockTileEntity(int par1,
int par2,
int par3,
TileEntity par4TileEntity)
Sets the TileEntity for a given block in this chunk |
void |
setChunkModified()
Sets the isModified flag for this Chunk |
void |
setLightValue(EnumSkyBlock par1EnumSkyBlock,
int par2,
int par3,
int par4,
int par5)
Sets the light value at the coordinate. |
void |
setStorageArrays(ExtendedBlockStorage[] par1ArrayOfExtendedBlockStorage)
|
void |
updateSkylight()
Checks whether skylight needs updated; if it does, calls updateSkylight_do |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean isLit
public int[] precipitationHeightMap
public boolean[] updateSkylightColumns
public boolean isChunkLoaded
public World worldObj
public int[] heightMap
public final int xPosition
public final int zPosition
public Map chunkTileEntityMap
public List[] entityLists
public boolean isTerrainPopulated
public boolean isModified
public boolean hasEntities
public long lastSaveTime
public boolean deferRender
public int field_82912_p
Constructor Detail |
---|
public Chunk(World par1World, int par2, int par3)
public Chunk(World par1World, byte[] par2ArrayOfByte, int par3, int par4)
public Chunk(World world, byte[] ids, byte[] metadata, int chunkX, int chunkZ)
world
- The world this chunk belongs toids
- A ByteArray containing all the BlockID's to set this chunk tometadata
- A ByteArray containing all the metadata to set this chunk tochunkX
- The chunk's X positionchunkZ
- The Chunk's Z positionpublic Chunk(World world, short[] ids, byte[] metadata, int chunkX, int chunkZ)
world
- The world this chunk belongs toids
- A ShortArray containing all the BlockID's to set this chunk to (x is low order, z is mid, y is high)metadata
- A ByteArray containing all the metadata to set this chunk tochunkX
- The chunk's X positionchunkZ
- The Chunk's Z positionMethod Detail |
---|
public boolean isAtLocation(int par1, int par2)
public int getHeightValue(int par1, int par2)
public int getTopFilledSegment()
public ExtendedBlockStorage[] getBlockStorageArray()
public void generateHeightMap()
public void generateSkylightMap()
public int getBlockLightOpacity(int par1, int par2, int par3)
public int getBlockID(int par1, int par2, int par3)
public int getBlockMetadata(int par1, int par2, int par3)
public boolean setBlockID(int par1, int par2, int par3, int par4)
public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
public boolean setBlockMetadata(int par1, int par2, int par3, int par4)
public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5)
public int getBlockLightValue(int par1, int par2, int par3, int par4)
public void addEntity(Entity par1Entity)
public void removeEntity(Entity par1Entity)
public void removeEntityAtIndex(Entity par1Entity, int par2)
public boolean canBlockSeeTheSky(int par1, int par2, int par3)
public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3)
public void addTileEntity(TileEntity par1TileEntity)
public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
public void removeChunkBlockTileEntity(int par1, int par2, int par3)
public void onChunkLoad()
public void onChunkUnload()
public void setChunkModified()
public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List)
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
public boolean needsSaving(boolean par1)
public Random getRandomWithSeed(long par1)
public boolean isEmpty()
public void populateChunk(IChunkProvider par1IChunkProvider, IChunkProvider par2IChunkProvider, int par3, int par4)
public int getPrecipitationHeight(int par1, int par2)
public void updateSkylight()
public ChunkCoordIntPair getChunkCoordIntPair()
public boolean getAreLevelsEmpty(int par1, int par2)
public void setStorageArrays(ExtendedBlockStorage[] par1ArrayOfExtendedBlockStorage)
public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
public BiomeGenBase getBiomeGenForWorldCoords(int par1, int par2, WorldChunkManager par3WorldChunkManager)
public byte[] getBiomeArray()
public void setBiomeArray(byte[] par1ArrayOfByte)
public void resetRelightChecks()
public void enqueueRelightChecks()
public void cleanChunkBlockTileEntity(int x, int y, int z)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |