Package net.minecraft.world.chunk
Class Chunk
- java.lang.Object
-
- net.minecraft.world.chunk.Chunk
-
- Direct Known Subclasses:
EmptyChunk
public class Chunk extends java.lang.Object
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Chunk.EnumCreateEntityType
-
Constructor Summary
Constructors Constructor Description Chunk(World worldIn, int x, int z)
Chunk(World worldIn, ChunkPrimer primer, int x, int z)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntity(Entity entity)
+ Adds an entity to the chunk.void
addTileEntity(TileEntity tileentity)
void
addTileEntity(BlockPos blockpos, TileEntity tileentity)
boolean
canSeeSky(BlockPos blockpos)
void
enqueueRelightChecks()
+ Called once-per-chunk-per-tick, and advances the round-robin relight check index by up to 8 blocks at a time.void
fillChunk(byte[] parArrayOfByte, int parInt1, boolean parFlag)
+ Initialize this chunk with new binary data.void
func_150804_b(boolean parFlag)
void
func_150809_p()
protected void
generateHeightMap()
+ Generates the height map for a chunk from scratchvoid
generateSkylightMap()
+ Generates the initial skylight map for the chunk upon generation or load.boolean
getAreLevelsEmpty(int i, int j)
+ Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) or not (false).BiomeGenBase
getBiome(BlockPos pos)
byte[]
getBiomeArray()
+ Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs.Block
getBlock(int x, int y, int z)
Block
getBlock(BlockPos blockpos)
int
getBlockLightOpacity(BlockPos blockpos)
int
getBlockMetadata(BlockPos blockpos)
+ Return the metadata corresponding to the given coordinates inside a chunk.IBlockState
getBlockState(BlockPos pos)
IBlockState
getBlockStateFaster(BlockPos pos)
only use with a regular "net.minecraft.util.BlockPos"!ExtendedBlockStorage[]
getBlockStorageArray()
+ Returns the ExtendedBlockStorage array for this Chunk.ChunkCoordIntPair
getChunkCoordIntPair()
+ Gets a ChunkCoordIntPair representing the Chunk's position.<T extends Entity>
voidgetEntitiesOfTypeWithinAAAB(java.lang.Class<? extends T> oclass, AxisAlignedBB axisalignedbb, java.util.List<T> list, Predicate<? super T> predicate)
void
getEntitiesWithinAABBForEntity(Entity entity, AxisAlignedBB axisalignedbb, java.util.List<Entity> list, Predicate<? super Entity> predicate)
+ Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity.ClassInheritanceMultiMap<Entity>[]
getEntityLists()
int
getHeight(BlockPos pos)
int[]
getHeightMap()
int
getHeightValue(int i, int j)
+ Returns the value in the height map at this x, z coordinate in the chunklong
getInhabitedTime()
int
getLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos)
int
getLightSubtracted(BlockPos blockpos, int i)
int
getLowestHeight()
BlockPos
getPrecipitationHeight(BlockPos pos)
EaglercraftRandom
getRandomWithSeed(long i)
TileEntity
getTileEntity(BlockPos blockpos, Chunk.EnumCreateEntityType chunk$enumcreateentitytype)
java.util.Map<BlockPos,TileEntity>
getTileEntityMap()
int
getTopFilledSegment()
+ Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block.World
getWorld()
boolean
isAtLocation(int i, int j)
+ Checks whether the chunk is at the X/Z location specifiedboolean
isEmpty()
boolean
isLightPopulated()
boolean
isLoaded()
boolean
isPopulated()
boolean
isTerrainPopulated()
boolean
needsSaving(boolean flag)
+ Returns true if this Chunk needs to be savedvoid
onChunkLoad()
+ Called when this Chunk is loaded by the ChunkProvidervoid
onChunkUnload()
+ Called when this Chunk is unloaded by the ChunkProvidervoid
populateChunk(IChunkProvider parIChunkProvider, IChunkProvider parIChunkProvider2, int parInt1, int parInt2)
void
removeEntity(Entity entity)
+ removes entity using its y chunk coordinate as its indexvoid
removeEntityAtIndex(Entity entity, int i)
+ Removes entity at the specified index from the entity array.void
removeTileEntity(BlockPos blockpos)
void
resetRelightChecks()
+ Resets the relight check index to 0 for this Chunk.void
setBiomeArray(byte[] biomeArray)
+ Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to biome IDs.IBlockState
setBlockState(BlockPos pos, IBlockState state)
void
setChunkLoaded(boolean loaded)
void
setChunkModified()
+ Sets the isModified flag for this Chunkvoid
setHasEntities(boolean hasEntitiesIn)
void
setHeightMap(int[] newHeightMap)
void
setInhabitedTime(long newInhabitedTime)
void
setLastSaveTime(long saveTime)
void
setLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos, int i)
void
setLightPopulated(boolean lightPopulated)
void
setModified(boolean modified)
void
setStorageArrays(ExtendedBlockStorage[] newStorageArrays)
void
setTerrainPopulated(boolean terrainPopulated)
-
-
-
Constructor Detail
-
Chunk
public Chunk(World worldIn, int x, int z)
-
Chunk
public Chunk(World worldIn, ChunkPrimer primer, int x, int z)
-
-
Method Detail
-
isAtLocation
public boolean isAtLocation(int i, int j)
+ Checks whether the chunk is at the X/Z location specified
-
getHeight
public int getHeight(BlockPos pos)
-
getHeightValue
public int getHeightValue(int i, int j)
+ Returns the value in the height map at this x, z coordinate in the chunk
-
getTopFilledSegment
public int getTopFilledSegment()
+ Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block.
-
getBlockStorageArray
public ExtendedBlockStorage[] getBlockStorageArray()
+ Returns the ExtendedBlockStorage array for this Chunk.
-
generateHeightMap
protected void generateHeightMap()
+ Generates the height map for a chunk from scratch
-
generateSkylightMap
public void generateSkylightMap()
+ Generates the initial skylight map for the chunk upon generation or load.
-
getBlockLightOpacity
public int getBlockLightOpacity(BlockPos blockpos)
-
getBlock
public Block getBlock(int x, int y, int z)
-
getBlockState
public IBlockState getBlockState(BlockPos pos)
-
getBlockStateFaster
public IBlockState getBlockStateFaster(BlockPos pos)
only use with a regular "net.minecraft.util.BlockPos"!
-
getBlockMetadata
public int getBlockMetadata(BlockPos blockpos)
+ Return the metadata corresponding to the given coordinates inside a chunk.
-
setBlockState
public IBlockState setBlockState(BlockPos pos, IBlockState state)
-
getLightFor
public int getLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos)
-
setLightFor
public void setLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos, int i)
-
getLightSubtracted
public int getLightSubtracted(BlockPos blockpos, int i)
-
addEntity
public void addEntity(Entity entity)
+ Adds an entity to the chunk. Args: entity
-
removeEntity
public void removeEntity(Entity entity)
+ removes entity using its y chunk coordinate as its index
-
removeEntityAtIndex
public void removeEntityAtIndex(Entity entity, int i)
+ Removes entity at the specified index from the entity array.
-
canSeeSky
public boolean canSeeSky(BlockPos blockpos)
-
getTileEntity
public TileEntity getTileEntity(BlockPos blockpos, Chunk.EnumCreateEntityType chunk$enumcreateentitytype)
-
addTileEntity
public void addTileEntity(TileEntity tileentity)
-
addTileEntity
public void addTileEntity(BlockPos blockpos, TileEntity tileentity)
-
removeTileEntity
public void removeTileEntity(BlockPos blockpos)
-
onChunkLoad
public void onChunkLoad()
+ Called when this Chunk is loaded by the ChunkProvider
-
onChunkUnload
public void onChunkUnload()
+ Called when this Chunk is unloaded by the ChunkProvider
-
setChunkModified
public void setChunkModified()
+ Sets the isModified flag for this Chunk
-
getEntitiesWithinAABBForEntity
public void getEntitiesWithinAABBForEntity(Entity entity, AxisAlignedBB axisalignedbb, java.util.List<Entity> list, Predicate<? super Entity> predicate)
+ Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity.
-
getEntitiesOfTypeWithinAAAB
public <T extends Entity> void getEntitiesOfTypeWithinAAAB(java.lang.Class<? extends T> oclass, AxisAlignedBB axisalignedbb, java.util.List<T> list, Predicate<? super T> predicate)
-
needsSaving
public boolean needsSaving(boolean flag)
+ Returns true if this Chunk needs to be saved
-
getRandomWithSeed
public EaglercraftRandom getRandomWithSeed(long i)
-
isEmpty
public boolean isEmpty()
-
populateChunk
public void populateChunk(IChunkProvider parIChunkProvider, IChunkProvider parIChunkProvider2, int parInt1, int parInt2)
-
func_150804_b
public void func_150804_b(boolean parFlag)
-
isPopulated
public boolean isPopulated()
-
getChunkCoordIntPair
public ChunkCoordIntPair getChunkCoordIntPair()
+ Gets a ChunkCoordIntPair representing the Chunk's position.
-
getAreLevelsEmpty
public boolean getAreLevelsEmpty(int i, int j)
+ Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) or not (false).
-
setStorageArrays
public void setStorageArrays(ExtendedBlockStorage[] newStorageArrays)
-
fillChunk
public void fillChunk(byte[] parArrayOfByte, int parInt1, boolean parFlag)
+ Initialize this chunk with new binary data.
-
getBiome
public BiomeGenBase getBiome(BlockPos pos)
-
getBiomeArray
public byte[] getBiomeArray()
+ Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs.
-
setBiomeArray
public void setBiomeArray(byte[] biomeArray)
+ Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to biome IDs.
-
resetRelightChecks
public void resetRelightChecks()
+ Resets the relight check index to 0 for this Chunk.
-
enqueueRelightChecks
public void enqueueRelightChecks()
+ Called once-per-chunk-per-tick, and advances the round-robin relight check index by up to 8 blocks at a time. In a worst-case scenario, can potentially take up to 25.6 seconds, calculated via (4096/8)/20, to re-check all blocks in a chunk, which may explain lagging light updates on initial world generation.
-
func_150809_p
public void func_150809_p()
-
isLoaded
public boolean isLoaded()
-
setChunkLoaded
public void setChunkLoaded(boolean loaded)
-
getWorld
public World getWorld()
-
getHeightMap
public int[] getHeightMap()
-
setHeightMap
public void setHeightMap(int[] newHeightMap)
-
getTileEntityMap
public java.util.Map<BlockPos,TileEntity> getTileEntityMap()
-
getEntityLists
public ClassInheritanceMultiMap<Entity>[] getEntityLists()
-
isTerrainPopulated
public boolean isTerrainPopulated()
-
setTerrainPopulated
public void setTerrainPopulated(boolean terrainPopulated)
-
isLightPopulated
public boolean isLightPopulated()
-
setLightPopulated
public void setLightPopulated(boolean lightPopulated)
-
setModified
public void setModified(boolean modified)
-
setHasEntities
public void setHasEntities(boolean hasEntitiesIn)
-
setLastSaveTime
public void setLastSaveTime(long saveTime)
-
getLowestHeight
public int getLowestHeight()
-
getInhabitedTime
public long getInhabitedTime()
-
setInhabitedTime
public void setInhabitedTime(long newInhabitedTime)
-
-