Java 类net.minecraft.world.chunk.BlockStateContainer 实例源码

项目:FastAsyncWorldedit    文件:SpongeChunk_1_11.java   
public void optimize() {
    if (sectionPalettes != null) {
        return;
    }
    char[][] arrays = getCombinedIdArrays();
    char lastChar = Character.MAX_VALUE;
    for (int layer = 0; layer < 16; layer++) {
        if (getCount(layer) > 0) {
            if (sectionPalettes == null) {
                sectionPalettes = new BlockStateContainer[16];
            }
            BlockStateContainer palette = new BlockStateContainer();
            char[] blocks = getIdArray(layer);
            for (int y = 0; y < 16; y++) {
                for (int z = 0; z < 16; z++) {
                    for (int x = 0; x < 16; x++) {
                        char combinedId = blocks[FaweCache.CACHE_J[y][z][x]];
                        if (combinedId > 1) {
                            palette.set(x, y, z, Block.getBlockById(combinedId >> 4).getStateFromMeta(combinedId & 0xF));
                        }
                    }
                }
            }
        }
    }
}
项目:FastAsyncWorldedit    文件:SpongeChunk_1_12.java   
public void optimize() {
    if (sectionPalettes != null) {
        return;
    }
    char[][] arrays = getCombinedIdArrays();
    char lastChar = Character.MAX_VALUE;
    for (int layer = 0; layer < 16; layer++) {
        if (getCount(layer) > 0) {
            if (sectionPalettes == null) {
                sectionPalettes = new BlockStateContainer[16];
            }
            BlockStateContainer palette = new BlockStateContainer();
            char[] blocks = getIdArray(layer);
            for (int y = 0; y < 16; y++) {
                for (int z = 0; z < 16; z++) {
                    for (int x = 0; x < 16; x++) {
                        char combinedId = blocks[FaweCache.CACHE_J[y][z][x]];
                        if (combinedId > 1) {
                            palette.set(x, y, z, Block.getBlockById(combinedId >> 4).getStateFromMeta(combinedId & 0xF));
                        }
                    }
                }
            }
        }
    }
}
项目:FastAsyncWorldedit    文件:ForgeChunk_All.java   
public void optimize() {
    if (sectionPalettes != null) {
        return;
    }
    char[][] arrays = getCombinedIdArrays();
    char lastChar = Character.MAX_VALUE;
    for (int layer = 0; layer < 16; layer++) {
        if (getCount(layer) > 0) {
            if (sectionPalettes == null) {
                sectionPalettes = new BlockStateContainer[16];
            }
            BlockStateContainer palette = new BlockStateContainer();
            char[] blocks = getIdArray(layer);
            for (int y = 0; y < 16; y++) {
                for (int z = 0; z < 16; z++) {
                    for (int x = 0; x < 16; x++) {
                        char combinedId = blocks[FaweCache.CACHE_J[y][z][x]];
                        if (combinedId > 1) {
                            palette.set(x, y, z, Block.getBlockById(combinedId >> 4).getStateFromMeta(combinedId & 0xF));
                        }
                    }
                }
            }
        }
    }
}
项目:FastAsyncWorldedit    文件:ForgeChunk_All.java   
public void optimize() {
    if (sectionPalettes != null) {
        return;
    }
    char[][] arrays = getCombinedIdArrays();
    char lastChar = Character.MAX_VALUE;
    for (int layer = 0; layer < 16; layer++) {
        if (getCount(layer) > 0) {
            if (sectionPalettes == null) {
                sectionPalettes = new BlockStateContainer[16];
            }
            BlockStateContainer palette = new BlockStateContainer();
            char[] blocks = getIdArray(layer);
            for (int y = 0; y < 16; y++) {
                for (int z = 0; z < 16; z++) {
                    for (int x = 0; x < 16; x++) {
                        char combinedId = blocks[FaweCache.CACHE_J[y][z][x]];
                        if (combinedId > 1) {
                            palette.set(x, y, z, Block.getBlockById(combinedId >> 4).getStateFromMeta(combinedId & 0xF));
                        }
                    }
                }
            }
        }
    }
}
项目:FastAsyncWorldedit    文件:ForgeChunk_All.java   
public void optimize() {
    if (sectionPalettes != null) {
        return;
    }
    char[][] arrays = getCombinedIdArrays();
    char lastChar = Character.MAX_VALUE;
    for (int layer = 0; layer < 16; layer++) {
        if (getCount(layer) > 0) {
            if (sectionPalettes == null) {
                sectionPalettes = new BlockStateContainer[16];
            }
            BlockStateContainer palette = new BlockStateContainer();
            char[] blocks = getIdArray(layer);
            for (int y = 0; y < 16; y++) {
                for (int z = 0; z < 16; z++) {
                    for (int x = 0; x < 16; x++) {
                        char combinedId = blocks[FaweCache.CACHE_J[y][z][x]];
                        if (combinedId > 1) {
                            palette.set(x, y, z, Block.getBlockById(combinedId >> 4).getStateFromMeta(combinedId & 0xF));
                        }
                    }
                }
            }
        }
    }
}
项目:Backmemed    文件:ExtendedBlockStorage.java   
public ExtendedBlockStorage(int y, boolean storeSkylight)
{
    this.yBase = y;
    this.data = new BlockStateContainer();
    this.blocklightArray = new NibbleArray();

    if (storeSkylight)
    {
        this.skylightArray = new NibbleArray();
    }
}
项目:CustomWorldGen    文件:ExtendedBlockStorage.java   
public ExtendedBlockStorage(int y, boolean storeSkylight)
{
    this.yBase = y;
    this.data = new BlockStateContainer();
    this.blocklightArray = new NibbleArray();

    if (storeSkylight)
    {
        this.skylightArray = new NibbleArray();
    }
}
项目:FastAsyncWorldedit    文件:ForgeChunk_All.java   
public void optimize() {
    if (sectionPalettes != null) {
        return;
    }
    char[][] arrays = getCombinedIdArrays();
    char lastChar = Character.MAX_VALUE;
    for (int layer = 0; layer < 16; layer++) {
        if (getCount(layer) > 0) {
            if (sectionPalettes == null) {
                sectionPalettes = new BlockStateContainer[16];
            }
            BlockStateContainer palette = new BlockStateContainer();
            char[] blocks = getIdArray(layer);
            int index = 0;
            for (int y = 0; y < 16; y++) {
                for (int z = 0; z < 16; z++) {
                    for (int x = 0; x < 16; x++) {
                        char combinedId = blocks[index++];
                        if (combinedId > 1) {
                            palette.set(x, y, z, Block.getBlockById(combinedId >> 4).getStateFromMeta(combinedId & 0xF));
                        }
                    }
                }
            }
        }
    }
}
项目:Backmemed    文件:ExtendedBlockStorage.java   
public BlockStateContainer getData()
{
    return this.data;
}
项目:CustomWorldGen    文件:ExtendedBlockStorage.java   
public BlockStateContainer getData()
{
    return this.data;
}
项目:NoXray    文件:MixinPacketChunkData.java   
@Redirect(method = "extractChunkData", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/BlockStateContainer;write(Lnet/minecraft/network/PacketBuffer;)V"))
public void writeModified(BlockStateContainer storage, PacketBuffer buffer, PacketBuffer methodbuffer, Chunk chunk, boolean aboolean, int anunknownint){
    ((InternalBlockStateContainer)storage).writeModified(buffer);
}
项目:NoXray    文件:MixinPacketChunkData.java   
@Redirect(method = "calculateChunkSize", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/BlockStateContainer;getSerializedSize()I"))
public int caclulateModifiedSize(BlockStateContainer blockStateContainer, Chunk chunk, boolean p_189556_2_, int p_189556_3_){
    ((InternalChunk) chunk).obFuscate();
    InternalBlockStateContainer container = (InternalBlockStateContainer) blockStateContainer;
    return container.modifiedSize();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
public void setPalette(ExtendedBlockStorage section, BlockStateContainer palette) throws NoSuchFieldException, IllegalAccessException {
    Field fieldSection = ExtendedBlockStorage.class.getDeclaredField("data");
    fieldSection.setAccessible(true);
    fieldSection.set(section, palette);
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacity(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightOpacity();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getBrightness(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightValue();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacityBrightnessPair(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return MathMan.pair16(ibd.getLightOpacity(), ibd.getLightValue());
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_11.java   
public void setPalette(ExtendedBlockStorage section, BlockStateContainer palette) throws NoSuchFieldException, IllegalAccessException {
    Field fieldSection = ExtendedBlockStorage.class.getDeclaredField("data");
    fieldSection.setAccessible(true);
    fieldSection.set(section, palette);
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_11.java   
@Override
public int getOpacity(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightOpacity();
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_11.java   
@Override
public int getBrightness(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightValue();
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_11.java   
@Override
public int getOpacityBrightnessPair(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return MathMan.pair16(ibd.getLightOpacity(), ibd.getLightValue());
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_12.java   
public void setPalette(ExtendedBlockStorage section, BlockStateContainer palette) throws NoSuchFieldException, IllegalAccessException {
    Field fieldSection = ExtendedBlockStorage.class.getDeclaredField("data");
    fieldSection.setAccessible(true);
    fieldSection.set(section, palette);
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_12.java   
@Override
public int getOpacity(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightOpacity();
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_12.java   
@Override
public int getBrightness(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightValue();
}
项目:FastAsyncWorldedit    文件:SpongeQueue_1_12.java   
@Override
public int getOpacityBrightnessPair(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return MathMan.pair16(ibd.getLightOpacity(), ibd.getLightValue());
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
public void setPalette(ExtendedBlockStorage section, BlockStateContainer palette) throws NoSuchFieldException, IllegalAccessException {
    Field fieldSection = ExtendedBlockStorage.class.getDeclaredField("data");
    fieldSection.setAccessible(true);
    fieldSection.set(section, palette);
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacity(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightOpacity();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getBrightness(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightValue();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacityBrightnessPair(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return MathMan.pair16(ibd.getLightOpacity(), ibd.getLightValue());
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
public void setPalette(ExtendedBlockStorage section, BlockStateContainer palette) throws NoSuchFieldException, IllegalAccessException {
    Field fieldSection = ExtendedBlockStorage.class.getDeclaredField("data");
    fieldSection.setAccessible(true);
    fieldSection.set(section, palette);
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacity(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightOpacity();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getBrightness(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightValue();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacityBrightnessPair(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return MathMan.pair16(ibd.getLightOpacity(), ibd.getLightValue());
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
public void setPalette(ExtendedBlockStorage section, BlockStateContainer palette) throws NoSuchFieldException, IllegalAccessException {
    Field fieldSection = ExtendedBlockStorage.class.getDeclaredField("data");
    fieldSection.setAccessible(true);
    fieldSection.set(section, palette);
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacity(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightOpacity();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getBrightness(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return ibd.getLightValue();
}
项目:FastAsyncWorldedit    文件:ForgeQueue_All.java   
@Override
public int getOpacityBrightnessPair(ExtendedBlockStorage section, int x, int y, int z) {
    BlockStateContainer dataPalette = section.getData();
    IBlockState ibd = dataPalette.get(x & 15, y & 15, z & 15);
    return MathMan.pair16(ibd.getLightOpacity(), ibd.getLightValue());
}