rename FullDataPoint -> FullDataPointUtil and move to util package
This commit is contained in:
+8
-8
@@ -8,7 +8,7 @@ import com.seibel.lod.api.interfaces.data.IDhApiTerrainDataRepo;
|
||||
import com.seibel.lod.api.objects.math.DhApiVec3i;
|
||||
import com.seibel.lod.core.api.internal.SharedApi;
|
||||
import com.seibel.lod.core.datatype.full.IFullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.FullDataPoint;
|
||||
import com.seibel.lod.core.util.FullDataPointUtil;
|
||||
import com.seibel.lod.core.datatype.full.FullDataPointIdMap;
|
||||
import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
@@ -237,8 +237,8 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
|
||||
if (dataPoint != 0)
|
||||
{
|
||||
int requestedY = nullableBlockYPos;
|
||||
int bottomY = FullDataPoint.getBottomY(dataPoint) + levelMinimumHeight;
|
||||
int height = FullDataPoint.getHeight(dataPoint);
|
||||
int bottomY = FullDataPointUtil.getBottomY(dataPoint) + levelMinimumHeight;
|
||||
int height = FullDataPointUtil.getHeight(dataPoint);
|
||||
int topY = bottomY + height;
|
||||
|
||||
// does this datapoint contain the requested Y position?
|
||||
@@ -270,15 +270,15 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
|
||||
|
||||
private static DhApiTerrainDataPoint generateApiDatapoint(IDhApiLevelWrapper levelWrapper, FullDataPointIdMap mapping, byte detailLevel, long dataPoint)
|
||||
{
|
||||
IBlockStateWrapper blockState = mapping.getBlockStateWrapper(FullDataPoint.getId(dataPoint));
|
||||
IBiomeWrapper biomeWrapper = mapping.getBiomeWrapper(FullDataPoint.getId(dataPoint));
|
||||
IBlockStateWrapper blockState = mapping.getBlockStateWrapper(FullDataPointUtil.getId(dataPoint));
|
||||
IBiomeWrapper biomeWrapper = mapping.getBiomeWrapper(FullDataPointUtil.getId(dataPoint));
|
||||
|
||||
int bottomY = FullDataPoint.getBottomY(dataPoint) + levelWrapper.getMinHeight();
|
||||
int height = FullDataPoint.getHeight(dataPoint);
|
||||
int bottomY = FullDataPointUtil.getBottomY(dataPoint) + levelWrapper.getMinHeight();
|
||||
int height = FullDataPointUtil.getHeight(dataPoint);
|
||||
int topY = bottomY + height;
|
||||
|
||||
return new DhApiTerrainDataPoint(detailLevel,
|
||||
FullDataPoint.getLight(dataPoint), topY, bottomY,
|
||||
FullDataPointUtil.getLight(dataPoint), topY, bottomY,
|
||||
blockState, biomeWrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.datatype.full.accessor;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.FullDataPoint;
|
||||
import com.seibel.lod.core.util.FullDataPointUtil;
|
||||
import com.seibel.lod.core.datatype.full.FullDataPointIdMap;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class FullArrayView implements IFullDataView
|
||||
long[] newData = new long[sourceData.length];
|
||||
for (int i = 0; i < newData.length; i++)
|
||||
{
|
||||
newData[i] = FullDataPoint.remap(remappedIds, sourceData[i]);
|
||||
newData[i] = FullDataPointUtil.remap(remappedIds, sourceData[i]);
|
||||
}
|
||||
target.dataArrays[target.offset + x * target.dataSize + o] = newData;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.datatype.full.accessor;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.FullDataPoint;
|
||||
import com.seibel.lod.core.util.FullDataPointUtil;
|
||||
import com.seibel.lod.core.datatype.full.FullDataPointIdMap;
|
||||
|
||||
public class SingleFullArrayView implements IFullDataView
|
||||
@@ -74,7 +74,7 @@ public class SingleFullArrayView implements IFullDataView
|
||||
long[] newData = new long[sourceData.length];
|
||||
for (int i = 0; i < newData.length; i++)
|
||||
{
|
||||
newData[i] = FullDataPoint.remap(remappedEntryIds, sourceData[i]);
|
||||
newData[i] = FullDataPointUtil.remap(remappedEntryIds, sourceData[i]);
|
||||
}
|
||||
target.dataArrays[target.offset] = newData;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class SingleFullArrayView implements IFullDataView
|
||||
long[] newData = new long[sourceData.length];
|
||||
for (int i = 0; i < newData.length; i++)
|
||||
{
|
||||
newData[i] = FullDataPoint.remap(remappedEntryIds, sourceData[i]);
|
||||
newData[i] = FullDataPointUtil.remap(remappedEntryIds, sourceData[i]);
|
||||
}
|
||||
target.dataArrays[target.offset] = newData;
|
||||
}
|
||||
|
||||
+5
-4
@@ -14,6 +14,7 @@ import com.seibel.lod.core.pos.DhSectionPos;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.lod.core.pos.DhBlockPos;
|
||||
import com.seibel.lod.core.util.FullDataPointUtil;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.wrapperInterfaces.IWrapperFactory;
|
||||
import com.seibel.lod.core.wrapperInterfaces.block.IBlockStateWrapper;
|
||||
@@ -170,10 +171,10 @@ public class FullToColumnTransformer {
|
||||
int offset = 0;
|
||||
for (int i = 0; i < data.getSingleLength(); i++) {
|
||||
long fullData = data.getSingle(i);
|
||||
int bottomY = FullDataPoint.getBottomY(fullData);
|
||||
int blockHeight = FullDataPoint.getHeight(fullData);
|
||||
int id = FullDataPoint.getId(fullData);
|
||||
int light = FullDataPoint.getLight(fullData);
|
||||
int bottomY = FullDataPointUtil.getBottomY(fullData);
|
||||
int blockHeight = FullDataPointUtil.getHeight(fullData);
|
||||
int id = FullDataPointUtil.getId(fullData);
|
||||
int light = FullDataPointUtil.getLight(fullData);
|
||||
IBiomeWrapper biome = mapping.getBiomeWrapper(id);
|
||||
IBlockStateWrapper block = mapping.getBlockStateWrapper(id);
|
||||
if (block.equals(AIR)) continue;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.seibel.lod.core.datatype.transform;
|
||||
|
||||
import com.seibel.lod.core.datatype.full.sources.ChunkSizedFullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.FullDataPoint;
|
||||
import com.seibel.lod.core.util.FullDataPointUtil;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import com.seibel.lod.core.wrapperInterfaces.IWrapperFactory;
|
||||
@@ -34,7 +34,7 @@ public class LodDataBuilder {
|
||||
byte newLight = (byte) ((chunk.getBlockLight(x,y+1,z) << 4) + chunk.getSkyLight(x,y+1,z));
|
||||
|
||||
if (!newBiome.equals(biome) || !newBlockState.equals(blockState)) {
|
||||
longs.add(FullDataPoint.encode(mappedId, lastY-y, y+1 - chunk.getMinBuildHeight(), light));
|
||||
longs.add(FullDataPointUtil.encode(mappedId, lastY-y, y+1 - chunk.getMinBuildHeight(), light));
|
||||
biome = newBiome;
|
||||
blockState = newBlockState;
|
||||
mappedId = chunkData.getMapping().addIfNotPresentAndGetId(biome, blockState);
|
||||
@@ -47,7 +47,7 @@ public class LodDataBuilder {
|
||||
// lastY = y;
|
||||
// }
|
||||
}
|
||||
longs.add(FullDataPoint.encode(mappedId, lastY-y, y+1 - chunk.getMinBuildHeight(), light));
|
||||
longs.add(FullDataPointUtil.encode(mappedId, lastY-y, y+1 - chunk.getMinBuildHeight(), light));
|
||||
|
||||
chunkData.setSingleColumn(longs.toArray(new long[0]), x, z);
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package com.seibel.lod.core.file.subDimMatching;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.datatype.full.IFullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.sources.ChunkSizedFullDataSource;
|
||||
import com.seibel.lod.core.datatype.full.FullDataPoint;
|
||||
import com.seibel.lod.core.util.FullDataPointUtil;
|
||||
import com.seibel.lod.core.datatype.full.accessor.SingleFullArrayView;
|
||||
import com.seibel.lod.core.datatype.transform.LodDataBuilder;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
@@ -246,7 +246,7 @@ public class SubDimensionLevelMatcher implements AutoCloseable
|
||||
// does any data exist in this column?
|
||||
for (long dataPoint : rawSingleColumn)
|
||||
{
|
||||
if (dataPoint != FullDataPoint.EMPTY_DATA_POINT)
|
||||
if (dataPoint != FullDataPointUtil.EMPTY_DATA_POINT)
|
||||
{
|
||||
// at least one datapoint exists in this chunk
|
||||
testLodDataExists = true;
|
||||
|
||||
+3
-4
@@ -1,11 +1,10 @@
|
||||
package com.seibel.lod.core.datatype.full;
|
||||
package com.seibel.lod.core.util;
|
||||
|
||||
//
|
||||
|
||||
import com.seibel.lod.core.util.LodUtil;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
import static com.seibel.lod.core.datatype.column.accessor.ColumnFormatUtil.MAX_WORLD_Y_SIZE;
|
||||
import static com.seibel.lod.core.util.RenderDatapointUtil.MAX_WORLD_Y_SIZE;
|
||||
|
||||
/**
|
||||
* <code>
|
||||
@@ -31,7 +30,7 @@ import static com.seibel.lod.core.datatype.column.accessor.ColumnFormatUtil.MAX_
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
public class FullDataPoint
|
||||
public class FullDataPointUtil
|
||||
{
|
||||
/** Represents the data held by an empty data point */
|
||||
public static final int EMPTY_DATA_POINT = 0;
|
||||
Reference in New Issue
Block a user