public class ChunkSection1_9to1_8 extends Object implements ChunkSection
Modifier and Type | Field and Description |
---|---|
static int |
LIGHT_LENGTH
Length of the sky and block light nibble arrays.
|
static int |
SIZE
Size (dimensions) of blocks in a chunks section.
|
Constructor and Description |
---|
ChunkSection1_9to1_8() |
Modifier and Type | Method and Description |
---|---|
int |
getBlock(int x,
int y,
int z)
Gets a block state id (< 1.13: block_id << 4 | data & 0xF)
|
int |
getBlockId(int x,
int y,
int z)
Gets a block id (without data)
/!\ YOU SHOULD NOT USE THIS ON 1.13
|
int |
getExpectedSize()
Get expected size of this chunks section.
|
List<Integer> |
getPalette() |
boolean |
hasSkyLight()
Check if sky light is present
|
void |
setBlock(int idx,
int type,
int data)
Set a block in the chunks based on the index
|
void |
setBlock(int x,
int y,
int z,
int type,
int data)
Set a block in the chunks
|
void |
setBlockLight(byte[] data)
Set the block light array
|
void |
setFlatBlock(int x,
int y,
int z,
int type)
Set a block state in the chunk
|
void |
setSkyLight(byte[] data)
Set the sky light array
|
void |
writeBlockLight(io.netty.buffer.ByteBuf output)
Write the block light to a buffer
|
void |
writeBlocks(io.netty.buffer.ByteBuf output)
Write the blocks to a buffer.
|
void |
writeBlocks1_13(io.netty.buffer.ByteBuf output)
Write the blocks in 1.13 format to a buffer.
|
void |
writeSkyLight(io.netty.buffer.ByteBuf output)
Write the sky light to a buffer
|
public static final int SIZE
public static final int LIGHT_LENGTH
public void setBlock(int x, int y, int z, int type, int data)
setBlock
in interface ChunkSection
x
- Block Xy
- Block Yz
- Block Ztype
- The type of the blockdata
- The data value of the blockpublic void setFlatBlock(int x, int y, int z, int type)
ChunkSection
setFlatBlock
in interface ChunkSection
x
- Block Xy
- Block Yz
- Block Ztype
- The block state idpublic int getBlockId(int x, int y, int z)
ChunkSection
getBlockId
in interface ChunkSection
x
- Block Xy
- Block Yz
- Block Zpublic int getBlock(int x, int y, int z)
ChunkSection
getBlock
in interface ChunkSection
x
- Block Xy
- Block Yz
- Block Zpublic void setBlock(int idx, int type, int data)
idx
- Indextype
- The type of the blockdata
- The data value of the blockpublic void setBlockLight(byte[] data)
data
- The value to set the block light topublic void setSkyLight(byte[] data)
data
- The value to set the sky light topublic void writeBlocks(io.netty.buffer.ByteBuf output) throws Exception
writeBlocks
in interface ChunkSection
output
- The buffer to write to.Exception
- Throws if it failed to write.public void writeBlocks1_13(io.netty.buffer.ByteBuf output) throws Exception
ChunkSection
writeBlocks1_13
in interface ChunkSection
output
- The buffer to write to.Exception
- Throws if it failed to write.public void writeBlockLight(io.netty.buffer.ByteBuf output)
writeBlockLight
in interface ChunkSection
output
- The buffer to write topublic void writeSkyLight(io.netty.buffer.ByteBuf output)
writeSkyLight
in interface ChunkSection
output
- The buffer to write topublic List<Integer> getPalette()
getPalette
in interface ChunkSection
public boolean hasSkyLight()
hasSkyLight
in interface ChunkSection
Copyright © 2016–2018. All rights reserved.