Search in sources :

Example 6 with ChunkRenderable

use of io.xol.chunkstories.api.rendering.world.chunk.ChunkRenderable in project chunkstories by Hugobros3.

the class HashMapWorldRegionsHolder method markChunkForReRender.

public void markChunkForReRender(int chunkX, int chunkY, int chunkZ) {
    int worldSizeInChunks = world.getWorldInfo().getSize().sizeInChunks;
    if (chunkX < 0)
        chunkX += worldSizeInChunks;
    if (chunkY < 0)
        chunkY += worldSizeInChunks;
    if (chunkZ < 0)
        chunkZ += worldSizeInChunks;
    chunkX = chunkX % worldSizeInChunks;
    chunkZ = chunkZ % worldSizeInChunks;
    if (chunkY < 0 || chunkY >= worldSizeInChunks)
        return;
    Chunk c = getChunk(chunkX, chunkY, chunkZ);
    if (c != null && c instanceof ChunkRenderable)
        ((ChunkRenderable) c).meshUpdater().requestMeshUpdate();
}
Also used : ChunkRenderable(io.xol.chunkstories.api.rendering.world.chunk.ChunkRenderable) Chunk(io.xol.chunkstories.api.world.chunk.Chunk) CubicChunk(io.xol.chunkstories.world.chunk.CubicChunk)

Aggregations

ChunkRenderable (io.xol.chunkstories.api.rendering.world.chunk.ChunkRenderable)6 Chunk (io.xol.chunkstories.api.world.chunk.Chunk)5 CubicChunk (io.xol.chunkstories.world.chunk.CubicChunk)3 Entity (io.xol.chunkstories.api.entity.Entity)2 Voxel (io.xol.chunkstories.api.voxel.Voxel)2 ChunksIterator (io.xol.chunkstories.api.world.chunk.ChunksIterator)2 ChunkRenderDataHolder (io.xol.chunkstories.renderer.chunks.ChunkRenderDataHolder)2 ClientChunk (io.xol.chunkstories.world.chunk.ClientChunk)2 Location (io.xol.chunkstories.api.Location)1 EntityLiving (io.xol.chunkstories.api.entity.EntityLiving)1 EntityControllable (io.xol.chunkstories.api.entity.interfaces.EntityControllable)1 UnexecutableTaskException (io.xol.chunkstories.api.exceptions.tasks.UnexecutableTaskException)1 WorldException (io.xol.chunkstories.api.exceptions.world.WorldException)1 PacketVoxelUpdate (io.xol.chunkstories.api.net.packets.PacketVoxelUpdate)1 CameraInterface (io.xol.chunkstories.api.rendering.CameraInterface)1 Font (io.xol.chunkstories.api.rendering.text.FontRenderer.Font)1 VoxelBakerCubic (io.xol.chunkstories.api.rendering.voxel.VoxelBakerCubic)1 VoxelBakerHighPoly (io.xol.chunkstories.api.rendering.voxel.VoxelBakerHighPoly)1 VoxelDynamicRenderer (io.xol.chunkstories.api.rendering.voxel.VoxelDynamicRenderer)1 VoxelRenderer (io.xol.chunkstories.api.rendering.voxel.VoxelRenderer)1