mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-18 18:29:08 +00:00
remove magic constants, start implementing id extension to 24 bits
This commit is contained in:
23 files changed
+202
-66
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package com.falsepattern.endlessids.constants;
|
||||
|
||||
public class ExtendedConstants {
|
||||
//Tunables
|
||||
public static final int bitsPerID = 16;
|
||||
public static final int bitsPerMetadata = 4;
|
||||
public static final int countCorrectionBits = 1;
|
||||
|
||||
public static final int watchableBits = 7;
|
||||
|
||||
//IDs
|
||||
public static final int nibblesPerID = bitsPerID / 4;
|
||||
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
|
||||
|
||||
public static final int bytesPerID = (nibblesPerID + 1) / 2;
|
||||
public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2;
|
||||
|
||||
public static final int blockIDMask = (1 << bitsPerID) - 1;
|
||||
public static final int blockIDCount = 1 << (bitsPerID - countCorrectionBits);
|
||||
public static final int maxBlockID = blockIDCount - 1;
|
||||
|
||||
public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata;
|
||||
public static final int nibblesPerBlock = bitsPerBlock / 4;
|
||||
public static final int nibblesPerEBS = nibblesPerBlock * 16 * 16 * 16;
|
||||
public static final int bytesPerEBS = nibblesPerEBS / 2;
|
||||
public static final int bytesPerChunk = 256 + bytesPerEBS * 16;
|
||||
|
||||
//DataWatcher
|
||||
public static final int watchableCount = 1 << watchableBits;
|
||||
public static final int maxWatchableID = watchableCount - 1;
|
||||
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
|
||||
}
|
||||
Reference in new issue
Block a user