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 classChunk.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 voidaddEntity(Entity entity)+ Adds an entity to the chunk.voidaddTileEntity(TileEntity tileentity)voidaddTileEntity(BlockPos blockpos, TileEntity tileentity)booleancanSeeSky(BlockPos blockpos)voidenqueueRelightChecks()+ Called once-per-chunk-per-tick, and advances the round-robin relight check index by up to 8 blocks at a time.voidfillChunk(byte[] parArrayOfByte, int parInt1, boolean parFlag)+ Initialize this chunk with new binary data.voidfunc_150804_b(boolean parFlag)voidfunc_150809_p()protected voidgenerateHeightMap()+ Generates the height map for a chunk from scratchvoidgenerateSkylightMap()+ Generates the initial skylight map for the chunk upon generation or load.booleangetAreLevelsEmpty(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).BiomeGenBasegetBiome(BlockPos pos)byte[]getBiomeArray()+ Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs.BlockgetBlock(int x, int y, int z)BlockgetBlock(BlockPos blockpos)intgetBlockLightOpacity(BlockPos blockpos)intgetBlockMetadata(BlockPos blockpos)+ Return the metadata corresponding to the given coordinates inside a chunk.IBlockStategetBlockState(BlockPos pos)IBlockStategetBlockStateFaster(BlockPos pos)only use with a regular "net.minecraft.util.BlockPos"!ExtendedBlockStorage[]getBlockStorageArray()+ Returns the ExtendedBlockStorage array for this Chunk.ChunkCoordIntPairgetChunkCoordIntPair()+ 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)voidgetEntitiesWithinAABBForEntity(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()intgetHeight(BlockPos pos)int[]getHeightMap()intgetHeightValue(int i, int j)+ Returns the value in the height map at this x, z coordinate in the chunklonggetInhabitedTime()intgetLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos)intgetLightSubtracted(BlockPos blockpos, int i)intgetLowestHeight()BlockPosgetPrecipitationHeight(BlockPos pos)EaglercraftRandomgetRandomWithSeed(long i)TileEntitygetTileEntity(BlockPos blockpos, Chunk.EnumCreateEntityType chunk$enumcreateentitytype)java.util.Map<BlockPos,TileEntity>getTileEntityMap()intgetTopFilledSegment()+ Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block.WorldgetWorld()booleanisAtLocation(int i, int j)+ Checks whether the chunk is at the X/Z location specifiedbooleanisEmpty()booleanisLightPopulated()booleanisLoaded()booleanisPopulated()booleanisTerrainPopulated()booleanneedsSaving(boolean flag)+ Returns true if this Chunk needs to be savedvoidonChunkLoad()+ Called when this Chunk is loaded by the ChunkProvidervoidonChunkUnload()+ Called when this Chunk is unloaded by the ChunkProvidervoidpopulateChunk(IChunkProvider parIChunkProvider, IChunkProvider parIChunkProvider2, int parInt1, int parInt2)voidremoveEntity(Entity entity)+ removes entity using its y chunk coordinate as its indexvoidremoveEntityAtIndex(Entity entity, int i)+ Removes entity at the specified index from the entity array.voidremoveTileEntity(BlockPos blockpos)voidresetRelightChecks()+ Resets the relight check index to 0 for this Chunk.voidsetBiomeArray(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.IBlockStatesetBlockState(BlockPos pos, IBlockState state)voidsetChunkLoaded(boolean loaded)voidsetChunkModified()+ Sets the isModified flag for this ChunkvoidsetHasEntities(boolean hasEntitiesIn)voidsetHeightMap(int[] newHeightMap)voidsetInhabitedTime(long newInhabitedTime)voidsetLastSaveTime(long saveTime)voidsetLightFor(EnumSkyBlock enumskyblock, BlockPos blockpos, int i)voidsetLightPopulated(boolean lightPopulated)voidsetModified(boolean modified)voidsetStorageArrays(ExtendedBlockStorage[] newStorageArrays)voidsetTerrainPopulated(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)
-
-