mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-16 17:16:11 +00:00
Remove hardcoding of heightmap compressed long size (#1668)
This commit is contained in:
parent
05f80f23b9
commit
465c81d193
@ -11,6 +11,7 @@ import com.fastasyncworldedit.core.queue.IChunkGet;
|
|||||||
import com.fastasyncworldedit.core.queue.IChunkSet;
|
import com.fastasyncworldedit.core.queue.IChunkSet;
|
||||||
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
|
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
|
||||||
import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
|
import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
|
||||||
|
import com.fastasyncworldedit.core.util.MathMan;
|
||||||
import com.fastasyncworldedit.core.util.collection.AdaptedMap;
|
import com.fastasyncworldedit.core.util.collection.AdaptedMap;
|
||||||
import com.google.common.base.Suppliers;
|
import com.google.common.base.Suppliers;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
@ -173,7 +174,8 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHeightmapToGet(HeightMapType type, int[] data) {
|
public void setHeightmapToGet(HeightMapType type, int[] data) {
|
||||||
BitArrayUnstretched bitArray = new BitArrayUnstretched(9, 256);
|
// height + 1 to match server internal
|
||||||
|
BitArrayUnstretched bitArray = new BitArrayUnstretched(MathMan.log2nlz(getChunk().getHeight() + 1), 256);
|
||||||
bitArray.fromRaw(data);
|
bitArray.fromRaw(data);
|
||||||
Heightmap.Types nativeType = Heightmap.Types.valueOf(type.name());
|
Heightmap.Types nativeType = Heightmap.Types.valueOf(type.name());
|
||||||
Heightmap heightMap = getChunk().heightmaps.get(nativeType);
|
Heightmap heightMap = getChunk().heightmaps.get(nativeType);
|
||||||
|
@ -11,6 +11,7 @@ import com.fastasyncworldedit.core.queue.IChunkGet;
|
|||||||
import com.fastasyncworldedit.core.queue.IChunkSet;
|
import com.fastasyncworldedit.core.queue.IChunkSet;
|
||||||
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
|
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
|
||||||
import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
|
import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
|
||||||
|
import com.fastasyncworldedit.core.util.MathMan;
|
||||||
import com.fastasyncworldedit.core.util.collection.AdaptedMap;
|
import com.fastasyncworldedit.core.util.collection.AdaptedMap;
|
||||||
import com.google.common.base.Suppliers;
|
import com.google.common.base.Suppliers;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
@ -175,7 +176,8 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHeightmapToGet(HeightMapType type, int[] data) {
|
public void setHeightmapToGet(HeightMapType type, int[] data) {
|
||||||
BitArrayUnstretched bitArray = new BitArrayUnstretched(9, 256);
|
// height + 1 to match server internal
|
||||||
|
BitArrayUnstretched bitArray = new BitArrayUnstretched(MathMan.log2nlz(getChunk().getHeight() + 1), 256);
|
||||||
bitArray.fromRaw(data);
|
bitArray.fromRaw(data);
|
||||||
Heightmap.Types nativeType = Heightmap.Types.valueOf(type.name());
|
Heightmap.Types nativeType = Heightmap.Types.valueOf(type.name());
|
||||||
Heightmap heightMap = getChunk().heightmaps.get(nativeType);
|
Heightmap heightMap = getChunk().heightmaps.get(nativeType);
|
||||||
|
@ -11,6 +11,7 @@ import com.fastasyncworldedit.core.queue.IChunkGet;
|
|||||||
import com.fastasyncworldedit.core.queue.IChunkSet;
|
import com.fastasyncworldedit.core.queue.IChunkSet;
|
||||||
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
|
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
|
||||||
import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
|
import com.fastasyncworldedit.core.queue.implementation.blocks.CharGetBlocks;
|
||||||
|
import com.fastasyncworldedit.core.util.MathMan;
|
||||||
import com.fastasyncworldedit.core.util.collection.AdaptedMap;
|
import com.fastasyncworldedit.core.util.collection.AdaptedMap;
|
||||||
import com.google.common.base.Suppliers;
|
import com.google.common.base.Suppliers;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
@ -178,7 +179,8 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHeightmapToGet(HeightMapType type, int[] data) {
|
public void setHeightmapToGet(HeightMapType type, int[] data) {
|
||||||
BitArrayUnstretched bitArray = new BitArrayUnstretched(9, 256);
|
// height + 1 to match server internal
|
||||||
|
BitArrayUnstretched bitArray = new BitArrayUnstretched(MathMan.log2nlz(getChunk().getHeight() + 1), 256);
|
||||||
bitArray.fromRaw(data);
|
bitArray.fromRaw(data);
|
||||||
Heightmap.Types nativeType = Heightmap.Types.valueOf(type.name());
|
Heightmap.Types nativeType = Heightmap.Types.valueOf(type.name());
|
||||||
Heightmap heightMap = getChunk().heightmaps.get(nativeType);
|
Heightmap heightMap = getChunk().heightmaps.get(nativeType);
|
||||||
|
Loading…
Reference in New Issue
Block a user