Java Code Examples for net.minecraft.world.chunk.storage.ExtendedBlockStorage#getMetadataArray()
The following examples show how to use
net.minecraft.world.chunk.storage.ExtendedBlockStorage#getMetadataArray() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ForgeQueue_All.java From FastAsyncWorldedit with GNU General Public License v3.0 | 6 votes |
@Override public int getCombinedId4Data(ExtendedBlockStorage ls, int x, int y, int z) { byte[] ids = ls.getBlockLSBArray(); NibbleArray currentDataArray = ls.getMetadataArray(); NibbleArray currentExtraArray = ls.getBlockMSBArray(); int i = FaweCache.CACHE_J[y & 15][z & 15][x & 15]; int id = (ids[i] & 0xFF); if (currentExtraArray != null) { id += (currentExtraArray.get(x & 15, y & 15, z & 15)) << 8; } if (currentDataArray != null && FaweCache.hasData(id)) { return (id << 4) + currentDataArray.get(x & 15, y & 15, z & 15); } else { return (id << 4); } }
Example 2
Source File: ChunkManager.java From mapwriter with MIT License | 6 votes |
public static MwChunk copyToMwChunk(Chunk chunk) { byte[][] msbArray = new byte[16][]; byte[][] lsbArray = new byte[16][]; byte[][] metaArray = new byte[16][]; byte[][] lightingArray = new byte[16][]; ExtendedBlockStorage[] storageArrays = chunk.getBlockStorageArray(); if (storageArrays != null) { for (ExtendedBlockStorage storage : storageArrays) { if (storage != null) { int y = (storage.getYLocation() >> 4) & 0xf; lsbArray[y] = storage.getBlockLSBArray(); msbArray[y] = (storage.getBlockMSBArray() != null) ? storage.getBlockMSBArray().data : null; metaArray[y] = (storage.getMetadataArray() != null) ? storage.getMetadataArray().data : null; lightingArray[y] = (storage.getBlocklightArray() != null) ? storage.getBlocklightArray().data : null; } } } return new MwChunk(chunk.xPosition, chunk.zPosition, chunk.worldObj.provider.dimensionId, msbArray, lsbArray, metaArray, lightingArray, chunk.getBiomeArray()); }