public class GlowChunk extends Object implements org.bukkit.Chunk
Modifier and Type | Class and Description |
---|---|
static class |
GlowChunk.Key
A chunk key represents the X and Z coordinates of a chunk in a manner suitable for use as a
key in a hash table or set.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEPTH
The depth of a chunk (y axis).
|
static int |
HEIGHT
The height of a chunk (z axis).
|
static int |
SEC_COUNT
The number of chunk sections in a single chunk column.
|
static int |
SEC_DEPTH
The Y depth of a single chunk section.
|
static int |
WIDTH
The width of a chunk (x axis).
|
Modifier and Type | Method and Description |
---|---|
void |
addTick() |
void |
automaticHeightMap()
Automatically fill the height map after chunks have been initialized.
|
BlockEntity |
createEntity(int cx,
int cy,
int cz,
int type)
If needed, create a new block entity at the given location.
|
int |
getBiome(int x,
int z)
Gets the biome of a column within this chunk.
|
GlowBlock |
getBlock(int x,
int y,
int z) |
GlowBlockState[] |
getBlockEntities()
Returns the states of the block entities (e.g.
|
byte |
getBlockLight(int x,
int z,
int y)
Gets the block light level of a block within this chunk.
|
GlowChunkSnapshot |
getChunkSnapshot() |
GlowChunkSnapshot |
getChunkSnapshot(boolean includeMaxBlockY,
boolean includeBiome,
boolean includeBiomeTempRain) |
double |
getClampedRegionalDifficulty() |
org.bukkit.entity.Entity[] |
getEntities() |
BlockEntity |
getEntity(int x,
int y,
int z)
Attempt to get the block entity located at the given coordinates.
|
int |
getHeight(int x,
int z)
Get the height map value of a column within this chunk.
|
long |
getInhabitedTime() |
int |
getMetaData(int x,
int z,
int y)
Gets the metadata of a block within this chunk.
|
Collection<BlockEntity> |
getRawBlockEntities() |
Collection<GlowEntity> |
getRawEntities() |
double |
getRegionalDifficulty() |
ChunkSection[] |
getSections()
The array of chunk sections this chunk contains, or null if it is unloaded.
|
byte |
getSkyLight(int x,
int z,
int y)
Gets the sky light level of a block within this chunk.
|
GlowBlockState[] |
getTileEntities()
Deprecated.
|
int |
getType(int x,
int z,
int y)
Gets the type of a block within this chunk.
|
GlowWorld |
getWorld()
The world of this chunk.
|
int |
getX()
The x-coordinate of this chunk.
|
int |
getZ()
The z-coordinate of this chunk.
|
void |
initializeSections(ChunkSection[] initSections)
Initialize this chunk from the given sections.
|
boolean |
isLoaded() |
boolean |
isPopulated()
Whether the chunk has been populated by special features.
|
boolean |
isSlimeChunk()
Formula taken from Minecraft Gamepedia.
|
boolean |
load() |
boolean |
load(boolean generate) |
void |
setBiome(int x,
int z,
int biome)
Sets the biome of a column within this chunk.
|
void |
setBiomes(byte... newBiomes)
Set the entire biome array of this chunk.
|
void |
setBlockLight(int x,
int z,
int y,
int blockLight)
Sets the block light level of a block within this chunk.
|
void |
setHeightMap(int... newHeightMap)
Set the entire height map of this chunk.
|
void |
setInhabitedTime(long inhabitedTime) |
void |
setIsSlimeChunk(int isSlimeChunk) |
void |
setMetaData(int x,
int z,
int y,
int metaData)
Sets the metadata of a block within this chunk.
|
void |
setPopulated(boolean populated)
Whether the chunk has been populated by special features.
|
void |
setSkyLight(int x,
int z,
int y,
int skyLight)
Sets the sky light level of a block within this chunk.
|
void |
setType(int x,
int z,
int y,
int type)
Sets the type of a block within this chunk.
|
ChunkDataMessage |
toMessage()
Creates a new
ChunkDataMessage which can be sent to a client to stream this entire
chunk to them. |
ChunkDataMessage |
toMessage(boolean skylight)
Creates a new
ChunkDataMessage which can be sent to a client to stream this entire
chunk to them. |
ChunkDataMessage |
toMessage(boolean skylight,
boolean entireChunk)
Creates a new
ChunkDataMessage which can be sent to a client to stream parts of this
chunk to them. |
ChunkDataMessage |
toMessage(boolean skylight,
boolean entireChunk,
io.netty.buffer.ByteBufAllocator alloc) |
String |
toString() |
boolean |
unload() |
boolean |
unload(boolean save) |
boolean |
unload(boolean save,
boolean safe) |
public static final int WIDTH
public static final int HEIGHT
public static final int DEPTH
public static final int SEC_DEPTH
public static final int SEC_COUNT
public GlowBlock getBlock(int x, int y, int z)
getBlock
in interface org.bukkit.Chunk
public org.bukkit.entity.Entity[] getEntities()
getEntities
in interface org.bukkit.Chunk
public Collection<GlowEntity> getRawEntities()
@Deprecated public GlowBlockState[] getTileEntities()
getTileEntities
in interface org.bukkit.Chunk
public GlowBlockState[] getBlockEntities()
public Collection<BlockEntity> getRawBlockEntities()
public boolean isSlimeChunk()
isSlimeChunk
in interface org.bukkit.Chunk
public GlowChunkSnapshot getChunkSnapshot()
getChunkSnapshot
in interface org.bukkit.Chunk
public GlowChunkSnapshot getChunkSnapshot(boolean includeMaxBlockY, boolean includeBiome, boolean includeBiomeTempRain)
getChunkSnapshot
in interface org.bukkit.Chunk
public boolean isLoaded()
isLoaded
in interface org.bukkit.Chunk
public boolean load()
load
in interface org.bukkit.Chunk
public boolean load(boolean generate)
load
in interface org.bukkit.Chunk
public boolean unload()
unload
in interface org.bukkit.Chunk
public boolean unload(boolean save)
unload
in interface org.bukkit.Chunk
public boolean unload(boolean save, boolean safe)
unload
in interface org.bukkit.Chunk
public void initializeSections(ChunkSection[] initSections)
initSections
- The ChunkSection
s to use. Should have a length of 16.public BlockEntity createEntity(int cx, int cy, int cz, int type)
cx
- the X coordinate of the BlockEntitycy
- the Y coordinate of the BlockEntitycz
- the Z coordinate of the BlockEntitytype
- the type of BlockEntitypublic BlockEntity getEntity(int x, int y, int z)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.public int getType(int x, int z, int y)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.public void setType(int x, int z, int y, int type)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.type
- The type.public int getMetaData(int x, int z, int y)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.public void setMetaData(int x, int z, int y, int metaData)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.metaData
- The metadata.public byte getSkyLight(int x, int z, int y)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.public void setSkyLight(int x, int z, int y, int skyLight)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.skyLight
- The sky light level.public byte getBlockLight(int x, int z, int y)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.public void setBlockLight(int x, int z, int y, int blockLight)
x
- The X coordinate.z
- The Z coordinate.y
- The Y coordinate.blockLight
- The block light level.public int getBiome(int x, int z)
x
- The X coordinate.z
- The Z coordinate.public void setBiome(int x, int z, int biome)
x
- The X coordinate.z
- The Z coordinate.biome
- The biome.public void setBiomes(byte... newBiomes)
newBiomes
- The biome array.public int getHeight(int x, int z)
x
- The X coordinate.z
- The Z coordinate.public double getRegionalDifficulty()
public double getClampedRegionalDifficulty()
public void setHeightMap(int... newHeightMap)
newHeightMap
- The height map.public void automaticHeightMap()
public ChunkDataMessage toMessage()
ChunkDataMessage
which can be sent to a client to stream this entire
chunk to them.ChunkDataMessage
.public ChunkDataMessage toMessage(boolean skylight)
ChunkDataMessage
which can be sent to a client to stream this entire
chunk to them.skylight
- Whether to include skylight data.ChunkDataMessage
.public ChunkDataMessage toMessage(boolean skylight, boolean entireChunk)
ChunkDataMessage
which can be sent to a client to stream parts of this
chunk to them.skylight
- Whether to include skylight data.entireChunk
- Whether to send all chunk sections.ChunkDataMessage
.public ChunkDataMessage toMessage(boolean skylight, boolean entireChunk, io.netty.buffer.ByteBufAllocator alloc)
public void addTick()
public GlowWorld getWorld()
getWorld
in interface org.bukkit.Chunk
public int getX()
getX
in interface org.bukkit.Chunk
public int getZ()
getZ
in interface org.bukkit.Chunk
public ChunkSection[] getSections()
public boolean isPopulated()
public void setPopulated(boolean populated)
populated
- Population status.public void setIsSlimeChunk(int isSlimeChunk)
public long getInhabitedTime()
public void setInhabitedTime(long inhabitedTime)
Copyright © 2021. All rights reserved.