Examples of ChunkSection


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

Examples of net.glowstone.GlowChunk.ChunkSection

        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

Examples of net.glowstone.GlowChunk.ChunkSection

        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

Examples of net.glowstone.GlowChunk.ChunkSection

        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

Examples of net.glowstone.GlowChunk.ChunkSection

            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

Examples of net.glowstone.GlowChunk.ChunkSection

        // 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

Examples of net.minecraft.server.ChunkSection

    }
    Object[] sections = ChunkRef.getSections(CommonNMS.getNative(chunk));
    final int secIndex = y >> 4;
    Object section = sections[secIndex];
    if (section == null) {
      section = sections[secIndex] = new ChunkSection(y >> 4 << 4, !CommonNMS.getNative(chunk.getWorld()).worldProvider.g);
    }
    ChunkSectionRef.setTypeId(section, x, y, z, typeId);
    ChunkSectionRef.setData(section, x, y, z, data);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.