public class Chunk
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.Map |
chunkTileEntityMap
A Map of ChunkPositions to TileEntities in this chunk
|
java.util.List[] |
entityLists
Array of Lists containing the entities in this Chunk.
|
boolean |
field_150815_m |
boolean |
hasEntities
Whether this Chunk has any Entities and thus requires saving on every tick
|
int[] |
heightMap |
int |
heightMapMinimum
Lowest value in the heightmap.
|
long |
inhabitedTime
the cumulative number of ticks players have been in this chunk
|
boolean |
isChunkLoaded
Whether or not this Chunk is currently loaded into the World
|
boolean |
isLightPopulated |
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 |
sendUpdates
Updates to this chunk will not be sent to clients if this is false.
|
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 and Description |
---|
Chunk(World p_i45447_1_,
Block[] p_i45447_2_,
byte[] p_i45447_3_,
int p_i45447_4_,
int p_i45447_5_) |
Chunk(World p_i45446_1_,
Block[] p_i45446_2_,
int p_i45446_3_,
int p_i45446_4_) |
Chunk(World par1World,
int par2,
int par3) |
Modifier and Type | Method and Description |
---|---|
void |
addEntity(Entity par1Entity)
Adds an entity to the chunk.
|
void |
addTileEntity(TileEntity p_150813_1_) |
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 |
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)
Initialise this chunk with new binary data
|
boolean |
func_150802_k() |
void |
func_150804_b(boolean p_150804_1_) |
TileEntity |
func_150806_e(int p_150806_1_,
int p_150806_2_,
int p_150806_3_) |
boolean |
func_150807_a(int p_150807_1_,
int p_150807_2_,
int p_150807_3_,
Block p_150807_4_,
int p_150807_5_) |
int |
func_150808_b(int p_150808_1_,
int p_150808_2_,
int p_150808_3_) |
void |
func_150809_p() |
void |
func_150812_a(int p_150812_1_,
int p_150812_2_,
int p_150812_3_,
TileEntity p_150812_4_) |
void |
generateHeightMap()
Generates the height map for a chunk from scratch
|
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
|
Block |
getBlock(int p_150810_1_,
int p_150810_2_,
int p_150810_3_)
Returns the block corresponding to the given coordinates inside a chunk.
|
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.
|
ChunkCoordIntPair |
getChunkCoordIntPair()
Gets a ChunkCoordIntPair representing the Chunk's position.
|
void |
getEntitiesOfTypeWithinAAAB(java.lang.Class par1Class,
AxisAlignedBB par2AxisAlignedBB,
java.util.List par3List,
IEntitySelector par4IEntitySelector)
Gets all entities that can be assigned to the specified class.
|
void |
getEntitiesWithinAABBForEntity(Entity par1Entity,
AxisAlignedBB par2AxisAlignedBB,
java.util.List par3List,
IEntitySelector par4IEntitySelector)
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.
|
java.util.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)
|
TileEntity |
getTileEntityUnsafe(int x,
int y,
int z)
Retrieves the tile entity, WITHOUT creating it.
|
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 |
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 |
removeInvalidTileEntity(int x,
int y,
int z)
Removes the tile entity at the specified position, only if it's
marked as invalid.
|
void |
removeTileEntity(int p_150805_1_,
int p_150805_2_,
int p_150805_3_) |
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 |
setBlockMetadata(int par1,
int par2,
int par3,
int par4)
Set the metadata of a block in the 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) |
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 java.util.Map chunkTileEntityMap
public java.util.List[] entityLists
public boolean isTerrainPopulated
public boolean isLightPopulated
public boolean field_150815_m
public boolean isModified
public boolean hasEntities
public long lastSaveTime
public boolean sendUpdates
public int heightMapMinimum
public long inhabitedTime
public Chunk(World par1World, int par2, int par3)
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 func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_)
public Block getBlock(int p_150810_1_, int p_150810_2_, int p_150810_3_)
public int getBlockMetadata(int par1, int par2, int par3)
public boolean func_150807_a(int p_150807_1_, int p_150807_2_, int p_150807_3_, Block p_150807_4_, int p_150807_5_)
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 func_150806_e(int p_150806_1_, int p_150806_2_, int p_150806_3_)
public void addTileEntity(TileEntity p_150813_1_)
public void func_150812_a(int p_150812_1_, int p_150812_2_, int p_150812_3_, TileEntity p_150812_4_)
public void removeTileEntity(int p_150805_1_, int p_150805_2_, int p_150805_3_)
public void onChunkLoad()
public void onChunkUnload()
public void setChunkModified()
public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, java.util.List par3List, IEntitySelector par4IEntitySelector)
public void getEntitiesOfTypeWithinAAAB(java.lang.Class par1Class, AxisAlignedBB par2AxisAlignedBB, java.util.List par3List, IEntitySelector par4IEntitySelector)
public boolean needsSaving(boolean par1)
public java.util.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 func_150804_b(boolean p_150804_1_)
public boolean func_150802_k()
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 func_150809_p()
public TileEntity getTileEntityUnsafe(int x, int y, int z)
x
- y
- z
- public void removeInvalidTileEntity(int x, int y, int z)
x
- y
- z
-