Package org.terasology.world.chunks

Examples of org.terasology.world.chunks.LitChunk


    }

    @Override
    public byte getLight(int x, int y, int z) {
        Vector3i chunkPos = TeraMath.calcChunkPos(x, y, z);
        LitChunk chunk = chunkProvider.getChunk(chunkPos);
        if (chunk != null) {
            Vector3i blockPos = TeraMath.calcBlockPos(x, y, z);
            return chunk.getLight(blockPos);
        }
        logger.warn("Attempted to access unavailable chunk via light at {}, {}, {}", x, y, z);
        return 0;
    }
View Full Code Here


    }

    @Override
    public byte getSunlight(int x, int y, int z) {
        Vector3i chunkPos = TeraMath.calcChunkPos(x, y, z);
        LitChunk chunk = chunkProvider.getChunk(chunkPos);
        if (chunk != null) {
            Vector3i blockPos = TeraMath.calcBlockPos(x, y, z);
            return chunk.getSunlight(blockPos);
        }
        logger.warn("Attempted to access unavailable chunk via sunlight at {}, {}, {}", x, y, z);
        return 0;
    }
View Full Code Here

    }

    @Override
    public byte getTotalLight(int x, int y, int z) {
        Vector3i chunkPos = TeraMath.calcChunkPos(x, y, z);
        LitChunk chunk = chunkProvider.getChunk(chunkPos);
        if (chunk != null) {
            Vector3i blockPos = TeraMath.calcBlockPos(x, y, z);
            return (byte) Math.max(chunk.getSunlight(blockPos), chunk.getLight(blockPos));
        }
        logger.warn("Attempted to access unavailable chunk via total light at {}, {}, {}", x, y, z);
        return 0;
    }
View Full Code Here

        return chunkProvider.getChunk(TeraMath.calcChunkPos(pos));
    }

    @Override
    public byte getValueAt(Vector3i pos) {
        LitChunk chunk = getChunk(pos);
        if (chunk != null) {
            return getValueAt(chunk, TeraMath.calcBlockPos(pos.x, pos.y, pos.z));
        }
        return UNAVAILABLE;
    }
View Full Code Here

            for (BatchPropagator propagator : propagators) {
                // Propagate Inwards
                for (Side side : Side.values()) {
                    Vector3i adjChunkPos = side.getAdjacentPos(chunk.getPosition());
                    LitChunk adjChunk = chunkProvider.getChunkUnready(adjChunkPos);
                    if (adjChunk != null) {
                        propagator.propagateBetween(adjChunk, chunk, side.reverse(), false);
                    }
                }

                // Propagate Outwards
                for (Side side : Side.values()) {
                    Vector3i adjChunkPos = side.getAdjacentPos(chunk.getPosition());
                    LitChunk adjChunk = chunkProvider.getChunk(adjChunkPos);
                    if (adjChunk != null) {
                        propagator.propagateBetween(chunk, adjChunk, side, true);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.terasology.world.chunks.LitChunk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.