Files
EndlessIDs/src/main/java/com/falsepattern/endlessids/constants/VanillaConstants.java
T
2025-06-05 11:35:10 +02:00

70 lines
2.8 KiB
Java

/*
* EndlessIDs
*
* Copyright (C) 2022-2025 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the words "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.constants;
@SuppressWarnings("unused")
public class VanillaConstants {
//Tunables
public static final int bitsPerID = 12;
public static final int bitsPerMetadata = 4;
public static final int countCorrectionBits = 0;
public static final int watchableBits = 5;
public static final int bitsPerBiome = 8;
public static final int bitsPerEntity = 8;
//BlockItemIDs
public static final int nibblesPerID = bitsPerID / 4;
public static final int bytesPerID = (nibblesPerID + 1) / 2;
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
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 itemIDCount = 32000;
public static final int maxItemID = itemIDCount - 1;
public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata;
public static final int nibblesPerBlock = bitsPerBlock / 4;
public static final int nibblesPerSubChunk = nibblesPerBlock * 16 * 16 * 16;
public static final int bytesPerSubChunk = (nibblesPerSubChunk + 1) / 2;
//BiomeIDs
public static final int biomeIDCount = 1 << bitsPerBiome;
public static final int biomeIDMask = biomeIDCount - 1;
public static final int biomeIDNull = biomeIDMask;
public static final int bytesPerBiome = (bitsPerBiome + 7) / 8;
//DataWatcher
public static final int watchableCount = 1 << watchableBits;
public static final int maxWatchableID = watchableCount - 1;
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
//EntityIDs
public static final int entityIDCount = 1 << bitsPerEntity;
public static final int maxEntityID = entityIDCount - 1;
}