gen mode + 1 of what was before

This commit is contained in:
cola98765
2022-02-20 10:54:17 +01:00
parent 9765da97a6
commit f3f3c3d54d
2 changed files with 11 additions and 14 deletions
@@ -38,7 +38,7 @@ public enum DistanceGenerationMode
/**
* Don't generate anything except just load in already existing chunks
*/
NONE((byte) 0),
NONE((byte) 1),
/**
* Only generate the biomes and use biome
@@ -47,7 +47,7 @@ public enum DistanceGenerationMode
* Doesn't generate height, everything is shown at sea level.
* Multithreaded - Fastest (2-5 ms)
*/
BIOME_ONLY((byte) 1),
BIOME_ONLY((byte) 2),
/**
* Same as BIOME_ONLY, except instead
@@ -55,7 +55,7 @@ public enum DistanceGenerationMode
* different biome types (mountain, ocean, forest, etc.)
* use predetermined heights to simulate having height data.
*/
BIOME_ONLY_SIMULATE_HEIGHT((byte) 2),
BIOME_ONLY_SIMULATE_HEIGHT((byte) 3),
/**
* Generate the world surface,
@@ -63,7 +63,7 @@ public enum DistanceGenerationMode
* or structures.
* Multithreaded - Faster (10-20 ms)
*/
SURFACE((byte) 3),
SURFACE((byte) 4),
/**
* Generate everything except structures.
@@ -71,7 +71,7 @@ public enum DistanceGenerationMode
* since some features cause concurrentModification exceptions.
* Multithreaded - Fast (15-20 ms)
*/
FEATURES((byte) 4),
FEATURES((byte) 5),
/**
* Ask the server to generate/load each chunk.
@@ -80,7 +80,7 @@ public enum DistanceGenerationMode
* are adding the mod on a pre-existing world.
* Singlethreaded - Slow (15-50 ms, with spikes up to 200 ms)
*/
FULL((byte) 5);
FULL((byte) 6);
public static DistanceGenerationMode RENDERABLE = DistanceGenerationMode.BIOME_ONLY;
@@ -89,10 +89,7 @@ public class DataPointUtil
public static long createVoidDataPoint(int generationMode)
{
long dataPoint = 0;
dataPoint |= (generationMode & GEN_TYPE_MASK) << GEN_TYPE_SHIFT;
dataPoint |= VOID_SETTER;
return dataPoint;
return (generationMode & GEN_TYPE_MASK) << GEN_TYPE_SHIFT;
}
public static long createDataPoint(int height, int depth, int color, int lightSky, int lightBlock, int generationMode)
@@ -140,8 +137,8 @@ public class DataPointUtil
long height = (dataPoint >>> 26) & 0x3FF;
long depth = (dataPoint >>> 16) & 0x3FF;
if (height == depth || (dataPoint & 0b10)==1) {
return createVoidDataPoint((int) ((dataPoint >>> 2) & 0xFF));
if (height == depth || (dataPoint & 0b10)==0b10) {
return createVoidDataPoint((int) ((dataPoint >>> 2) & 0b111) + 1);
}
return ((dataPoint >>> 60) & 0xF) << ALPHA_SHIFT
| ((dataPoint >>> 52) & 0xFF) << RED_SHIFT
@@ -150,7 +147,7 @@ public class DataPointUtil
| ((dataPoint >>> 26) & 0x3FF) << HEIGHT_SHIFT
| ((dataPoint >>> 16) & 0x3FF) << DEPTH_SHIFT
| ((dataPoint >>> 8) & 0xFF) << SKY_LIGHT_SHIFT
| ((dataPoint >>> 2) & 0xFF) << GEN_TYPE_SHIFT;
| (((dataPoint >>> 2) & 0xFF) + 1) << GEN_TYPE_SHIFT;
}
public static short getHeight(long dataPoint)
@@ -202,7 +199,7 @@ public class DataPointUtil
public static boolean isVoid(long dataPoint)
{
return getHeight(dataPoint) == getDepth(dataPoint);
return (((dataPoint >>> DEPTH_SHIFT) & HEIGHT_DEPTH_MASK) == 0);
}
public static boolean doesItExist(long dataPoint)