Search in sources :

Example 1 with ArrayImmutableBlockBuffer

use of org.spongepowered.common.world.volume.buffer.block.ArrayImmutableBlockBuffer in project SpongeCommon by SpongePowered.

the class SpongeBlockVolumeFactory method createImmutableFromBufferData.

private ArrayImmutableBlockBuffer createImmutableFromBufferData(final ArrayMutableBlockBuffer arrayBuffer) {
    final BlockBackingData data = arrayBuffer.getCopiedBackingData();
    final Palette.Immutable<BlockState, BlockType> immutablePalette = arrayBuffer.getPalette().asImmutable();
    return new ArrayImmutableBlockBuffer(immutablePalette, arrayBuffer.min(), arrayBuffer.size(), data);
}
Also used : Palette(org.spongepowered.api.world.schematic.Palette) BlockState(org.spongepowered.api.block.BlockState) BlockType(org.spongepowered.api.block.BlockType) ArrayImmutableBlockBuffer(org.spongepowered.common.world.volume.buffer.block.ArrayImmutableBlockBuffer) BlockBackingData(org.spongepowered.common.world.volume.buffer.block.BlockBackingData)

Aggregations

BlockState (org.spongepowered.api.block.BlockState)1 BlockType (org.spongepowered.api.block.BlockType)1 Palette (org.spongepowered.api.world.schematic.Palette)1 ArrayImmutableBlockBuffer (org.spongepowered.common.world.volume.buffer.block.ArrayImmutableBlockBuffer)1 BlockBackingData (org.spongepowered.common.world.volume.buffer.block.BlockBackingData)1