Add EDhApiDetailLevel as a reference on DH detail levels
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.seibel.lod.api.enums;
|
||||
|
||||
/**
|
||||
* BLOCK - Detail Level: 0, width 1 block, <br>
|
||||
* CHUNK - Detail Level: 4, width 16 block, <br>
|
||||
* REGION - Detail Level: 9, width 512 block <br> <br>
|
||||
*
|
||||
* Detail levels in Distant Horizons represent how large a section (of either LODs or MC chunks)
|
||||
* is, with the smallest being 0 (1 block wide). <br>
|
||||
* The width of a detail level can be calculated by putting the detail level to the power of 2. <br>
|
||||
* Example for the chunk detail level (4): 2^4 = 16 blocks wide <Br><br>
|
||||
*
|
||||
* This enum doesn't contain all valid detail levels, only those most likely to be needed.
|
||||
* Detail levels 1,2,3, ... 255 are all technically valid detail levels
|
||||
* (although anything beyond {@link EDhApiDetailLevel#REGION} may be difficult deal with).
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 2022-12-5
|
||||
*/
|
||||
public enum EDhApiDetailLevel
|
||||
{
|
||||
// Reminder:
|
||||
// when adding items up the API minor version
|
||||
// when removing items up the API major version
|
||||
|
||||
/**
|
||||
* detail level: 0 <Br>
|
||||
* width in Blocks: 1
|
||||
*/
|
||||
BLOCK(0, 1),
|
||||
/**
|
||||
* detail level: 4 <Br>
|
||||
* width in Blocks: 16
|
||||
*/
|
||||
CHUNK(4, 16),
|
||||
/**
|
||||
* detail level: 9 <Br>
|
||||
* width in Blocks: 512
|
||||
*/
|
||||
REGION(9, 512);
|
||||
|
||||
|
||||
public final int detailLevel;
|
||||
public final int widthInBlocks;
|
||||
|
||||
EDhApiDetailLevel(int detailLevel, int widthInBlocks)
|
||||
{
|
||||
this.detailLevel = detailLevel;
|
||||
this.widthInBlocks = widthInBlocks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -96,33 +96,25 @@ public class LodUtil
|
||||
ColorUtil.rgbToInt(255, 255, 255)};
|
||||
|
||||
|
||||
public static final byte DETAIL_OPTIONS = 10;
|
||||
|
||||
/** 512 blocks wide */
|
||||
public static final byte REGION_DETAIL_LEVEL = DETAIL_OPTIONS - 1;
|
||||
public static final byte REGION_DETAIL_LEVEL = 9;
|
||||
/** 16 blocks wide */
|
||||
public static final byte CHUNK_DETAIL_LEVEL = 4;
|
||||
/** 1 block wide */
|
||||
public static final byte BLOCK_DETAIL_LEVEL = 0;
|
||||
|
||||
//public static final short MAX_VERTICAL_DATA = 4;
|
||||
|
||||
/**
|
||||
* measured in Blocks <br>
|
||||
* detail level max - 1
|
||||
* 256 blocks
|
||||
* detail level 9
|
||||
* 512 x 512 blocks
|
||||
*/
|
||||
public static final short REGION_WIDTH = 1 << REGION_DETAIL_LEVEL;
|
||||
public static final short REGION_WIDTH = 512;
|
||||
/**
|
||||
* measured in Blocks <br>
|
||||
* detail level 4
|
||||
* 16 x 16 blocks
|
||||
*/
|
||||
public static final short CHUNK_WIDTH = 16;
|
||||
/**
|
||||
* measured in Blocks <br>
|
||||
* detail level 0
|
||||
*/
|
||||
public static final short BLOCK_WIDTH = 1;
|
||||
|
||||
|
||||
/** number of chunks wide */
|
||||
|
||||
Reference in New Issue
Block a user