Class 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)
    • Field Detail

      • xPosition

        public final int xPosition
      • zPosition

        public final int zPosition
    • Constructor Detail

      • Chunk

        public Chunk​(World worldIn,
                     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)
      • 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.
      • 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)
      • 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
      • isEmpty

        public boolean isEmpty()
      • populateChunk

        public void populateChunk​(IChunkProvider parIChunkProvider,
                                  IChunkProvider parIChunkProvider2,
                                  int parInt1,
                                  int parInt2)
      • getPrecipitationHeight

        public BlockPos getPrecipitationHeight​(BlockPos pos)
      • 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).
      • fillChunk

        public void fillChunk​(byte[] parArrayOfByte,
                              int parInt1,
                              boolean parFlag)
        + Initialize this chunk with new binary data.
      • 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)
      • 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)