Package net.glowstone.GlowChunk

Examples of net.glowstone.GlowChunk.ChunkSection


        return sy < 0 || sy >= sections.length || (sections[sy] == null);
    }

    @Override
    public int getBlockTypeId(int x, int y, int z) {
        ChunkSection section = getSection(y);
        return section == null ? 0 : section.types[section.index(x, y, z)] >> 4;
    }
View Full Code Here


        return section == null ? 0 : section.types[section.index(x, y, z)] >> 4;
    }

    @Override
    public int getBlockData(int x, int y, int z) {
        ChunkSection section = getSection(y);
        return section == null ? 0 : section.types[section.index(x, y, z)] & 0xF;
    }
View Full Code Here

        return section == null ? 0 : section.types[section.index(x, y, z)] & 0xF;
    }

    @Override
    public int getBlockSkyLight(int x, int y, int z) {
        ChunkSection section = getSection(y);
        return section == null ? 15 : section.skyLight.get(section.index(x, y, z));
    }
View Full Code Here

        return section == null ? 15 : section.skyLight.get(section.index(x, y, z));
    }

    @Override
    public int getBlockEmittedLight(int x, int y, int z) {
        ChunkSection section = getSection(y);
        return section == null ? 0 : section.blockLight.get(section.index(x, y, z));
    }
View Full Code Here

            char[] types = new char[rawTypes.length];
            for (int i = 0; i < rawTypes.length; i++) {
                types[i] = (char) (((extTypes == null ? 0 : extTypes.get(i)) << 12) | ((rawTypes[i] & 0xff) << 4) | data.get(i));
            }
            sections[y] = new ChunkSection(types, skyLight, blockLight);
        }

        // initialize the chunk
        chunk.initializeSections(sections);
        chunk.setPopulated(levelTag.getBool("TerrainPopulated"));
View Full Code Here

        // chunk sections
        List<CompoundTag> sectionTags = new ArrayList<>();
        GlowChunkSnapshot snapshot = chunk.getChunkSnapshot(true, true, false);
        ChunkSection[] sections = snapshot.getRawSections();
        for (byte i = 0; i < sections.length; ++i) {
            ChunkSection sec = sections[i];
            if (sec == null) continue;

            CompoundTag sectionTag = new CompoundTag();
            sectionTag.putByte("Y", i);
View Full Code Here

TOP

Related Classes of net.glowstone.GlowChunk.ChunkSection

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.