public class ChunkBlockHandler extends java.lang.Object implements IChunkBlockHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
ChunkBlockHandler.ChunkProcedure
This class is the base for a process that is to be called for every coordinate stored inside a
Chunk. |
| Constructor and Description |
|---|
ChunkBlockHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(IChunkBlockHandler handler)
Adds a
IChunkBlockHandler to be managed by this ChunkBlockHandler. |
void |
callProcedure(net.minecraft.world.chunk.Chunk chunk,
ChunkBlockHandler.ChunkProcedure procedure)
Calls a
ChunkBlockHandler.ChunkProcedure for the specified Chunk. |
static ChunkBlockHandler |
get()
Gets the
ChunkBlockHandler instance. |
static java.util.List<net.minecraft.world.chunk.Chunk> |
getAffectedChunks(net.minecraft.world.World world,
net.minecraft.util.AxisAlignedBB... aabbs)
Gets the chunks colliding with the specified
AxisAlignedBB. |
java.util.List<net.minecraft.world.chunk.Chunk> |
getAffectedChunks(net.minecraft.world.World world,
int x,
int z,
int distance)
Gets the chunks inside distance from coordinates.
|
void |
onChunkWatched(net.minecraftforge.event.world.ChunkWatchEvent.Watch event)
Called when a client requests a
Chunk from the server only. |
void |
onDataLoad(net.minecraftforge.event.world.ChunkDataEvent.Load event)
Called when a
Chunk is loaded on the server. |
void |
onDataSave(net.minecraftforge.event.world.ChunkDataEvent.Save event)
Called when a
Chunk is saved on the server. |
void |
setCoords(int chunkX,
int chunkZ,
long[] coords)
Client only.
|
boolean |
updateCoordinates(net.minecraft.world.chunk.Chunk chunk,
net.minecraft.util.BlockPos pos,
net.minecraft.block.state.IBlockState oldState,
net.minecraft.block.state.IBlockState newState)
Updates chunk coordinates.
|
public void callProcedure(net.minecraft.world.chunk.Chunk chunk,
ChunkBlockHandler.ChunkProcedure procedure)
ChunkBlockHandler.ChunkProcedure for the specified Chunk.chunk - the chunkprocedure - the procedurepublic void addHandler(IChunkBlockHandler handler)
IChunkBlockHandler to be managed by this ChunkBlockHandler.handler - the handlerpublic boolean updateCoordinates(net.minecraft.world.chunk.Chunk chunk,
net.minecraft.util.BlockPos pos,
net.minecraft.block.state.IBlockState oldState,
net.minecraft.block.state.IBlockState newState)
Chunk.setBlockState(BlockPos, IBlockState).IBlockListener for that chunk.updateCoordinates in interface IChunkBlockHandlerchunk - the chunkpos - the posoldState - the old statenewState - the new statepublic void onDataLoad(net.minecraftforge.event.world.ChunkDataEvent.Load event)
Chunk is loaded on the server.event - the eventpublic void onDataSave(net.minecraftforge.event.world.ChunkDataEvent.Save event)
Chunk is saved on the server.event - the eventpublic void onChunkWatched(net.minecraftforge.event.world.ChunkWatchEvent.Watch event)
Chunk from the server only.event - the eventpublic void setCoords(int chunkX,
int chunkZ,
long[] coords)
ChunkBlockMessage.chunkX - the chunk xchunkZ - the chunk zcoords - the coordspublic java.util.List<net.minecraft.world.chunk.Chunk> getAffectedChunks(net.minecraft.world.World world,
int x,
int z,
int distance)
world - the worldx - the xz - the zdistance - the sizepublic static java.util.List<net.minecraft.world.chunk.Chunk> getAffectedChunks(net.minecraft.world.World world,
net.minecraft.util.AxisAlignedBB... aabbs)
AxisAlignedBB.world - the worldaabbs - the aabbspublic static ChunkBlockHandler get()
ChunkBlockHandler instance.