public final class WorldUtils extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
NIBBLE_MASK |
Modifier and Type | Method and Description |
---|---|
static int |
blockArrayIndex(int x,
int y,
int z)
Gets the index of a block in a section
|
static ChunkLocation |
chunkLocation(int x,
int z)
Gets the chunk location from a position X and Y
|
static byte |
fromNibbleArray(byte[] nibbleArray,
int index)
The byte world nibble array byte search
|
static int |
heightIndex(int relX,
int relZ) |
static int |
intScale(int min,
int max,
double value)
Scales a value, useful for world generation
|
static String |
regionFile(ChunkLocation location)
Gets the name of a region file for a given chunklocation
|
static String |
regionFile(int x,
int z)
Gets a region file name for a given x and y location in the world
|
static int |
section(int y)
Get section index from y height
|
public static final byte NIBBLE_MASK
public static int section(int y)
y
- the y height specifiedpublic static ChunkLocation chunkLocation(int x, int z)
x
- the specified xz
- the specified zpublic static String regionFile(ChunkLocation location)
location
- the location to get the region file forpublic static String regionFile(int x, int z)
x
- the specified xz
- the specified zpublic static int blockArrayIndex(int x, int y, int z)
x
- the specified xy
- the y height specifiedz
- the specified zpublic static byte fromNibbleArray(byte[] nibbleArray, int index)
nibbleArray
- the nibble array to search fromindex
- the nibble indexpublic static int intScale(int min, int max, double value)
min
- the minimum required outputmax
- the maximum required outputvalue
- the value to scale between min and max, should be between -1 and 1public static int heightIndex(int relX, int relZ)
Copyright © 2016. All rights reserved.