Package net.minecraft

Class SharedConstants

java.lang.Object
net.minecraft.SharedConstants

public class SharedConstants extends Object
Shared global constants.

Note: The majority of the fields within this class are public static final with constant expressions (constants), and are inlined by the Java compiler at all places which reference these constant fields. Therefore, changing the value of these constant fields will have no effect on already compiled code.

In addition, it is presumed that a large portion of these constant fields (such as those prefixed with DEBUG_ are used as 'flags', for manually toggling code meant for use by Mojang developers in debugging. Therefore, optimizing compilers (which include the Java compiler) may omit the code hidden behind disabled flags, and will result in these flags having no apparent use in the code (when in reality, the optimizing compiler has removed the code which uses them).

See Also:
  • Field Details

    • SNAPSHOT

      @Deprecated public static final boolean SNAPSHOT
      Deprecated.
      Use getCurrentVersion() and
      invalid reference
      com.mojang.bridge.game.GameVersion#isStable()
      instead.
      Indicates whether the currently running game version is a snapshot version.
      See Also:
    • WORLD_VERSION

      @Deprecated public static final int WORLD_VERSION
      Deprecated.
      Use getCurrentVersion() and
      invalid reference
      com.mojang.bridge.game.GameVersion#getWorldVersion()
      instead.
      The numeric format number for worlds used by this game version.
      See Also:
    • SERIES

      @Deprecated public static final String SERIES
      Deprecated.
      See Also:
    • RELEASE_NETWORK_PROTOCOL_VERSION

      @Deprecated public static final int RELEASE_NETWORK_PROTOCOL_VERSION
      Deprecated.
      The numeric format number for the networking protocol used by the release target of this game version.

      This protocol version is used when this game version is a release version, not a snapshots. For snapshots, see SNAPSHOT_NETWORK_PROTOCOL_VERSION.

      See Also:
    • SNAPSHOT_NETWORK_PROTOCOL_VERSION

      @Deprecated public static final int SNAPSHOT_NETWORK_PROTOCOL_VERSION
      Deprecated.
      The numeric format number for the networking protocol used by the snapshot of this game version.

      This protocol version is used when this game version is a snapshot version. For releases, see RELEASE_NETWORK_PROTOCOL_VERSION.

      The actual networking protocol version used in snapshot versions is the combination (bitwise OR) of this number and the bit at the position marked by SNAPSHOT_PROTOCOL_BIT.

      See Also:
    • SNBT_NAG_VERSION

      public static final int SNBT_NAG_VERSION
      See Also:
    • SNAPSHOT_PROTOCOL_BIT

      private static final int SNAPSHOT_PROTOCOL_BIT
      The bit in the networking protocol version for denoting snapshot versions.
      See Also:
    • CRASH_EAGERLY

      public static final boolean CRASH_EAGERLY
      See Also:
    • RESOURCE_PACK_FORMAT_MAJOR

      @Deprecated public static final int RESOURCE_PACK_FORMAT_MAJOR
      Deprecated.
      See Also:
    • RESOURCE_PACK_FORMAT_MINOR

      @Deprecated public static final int RESOURCE_PACK_FORMAT_MINOR
      Deprecated.
      See Also:
    • DATA_PACK_FORMAT_MAJOR

      @Deprecated public static final int DATA_PACK_FORMAT_MAJOR
      Deprecated.
      See Also:
    • DATA_PACK_FORMAT_MINOR

      @Deprecated public static final int DATA_PACK_FORMAT_MINOR
      Deprecated.
      See Also:
    • LANGUAGE_FORMAT

      @Deprecated public static final int LANGUAGE_FORMAT
      Deprecated.
      See Also:
    • REPORT_FORMAT_VERSION

      public static final int REPORT_FORMAT_VERSION
      See Also:
    • DATA_VERSION_TAG

      public static final String DATA_VERSION_TAG
      The key for the NBT tag which contains the data version of some data, for use in datafixing.

      For various objects, their stored data in a CompoundTag will usually contain a IntTag indexed with this key, which stores the data version when the data for that object was written out. This is used by the datafixer system to determine which fixers needs to be applied to the data.

      See Also:
    • RPC_MANAGEMENT_SERVER_API_VERSION

      public static final String RPC_MANAGEMENT_SERVER_API_VERSION
      See Also:
    • DEBUG_FLAG_PREFIX

      public static final String DEBUG_FLAG_PREFIX
      See Also:
    • DEBUG_ENABLED

      public static final boolean DEBUG_ENABLED
    • DEBUG_PRINT_PROPERTIES

      private static final boolean DEBUG_PRINT_PROPERTIES
    • FIX_TNT_DUPE

      public static final boolean FIX_TNT_DUPE
      See Also:
    • FIX_SAND_DUPE

      public static final boolean FIX_SAND_DUPE
      See Also:
    • DEBUG_OPEN_INCOMPATIBLE_WORLDS

      public static final boolean DEBUG_OPEN_INCOMPATIBLE_WORLDS
    • DEBUG_ALLOW_LOW_SIM_DISTANCE

      public static final boolean DEBUG_ALLOW_LOW_SIM_DISTANCE
    • DEBUG_HOTKEYS

      public static final boolean DEBUG_HOTKEYS
    • DEBUG_UI_NARRATION

      public static final boolean DEBUG_UI_NARRATION
    • DEBUG_SHUFFLE_UI_RENDERING_ORDER

      public static final boolean DEBUG_SHUFFLE_UI_RENDERING_ORDER
    • DEBUG_SHUFFLE_MODELS

      public static final boolean DEBUG_SHUFFLE_MODELS
    • DEBUG_RENDER_UI_LAYERING_RECTANGLES

      public static final boolean DEBUG_RENDER_UI_LAYERING_RECTANGLES
    • DEBUG_PATHFINDING

      public static final boolean DEBUG_PATHFINDING
    • DEBUG_WATER

      public static final boolean DEBUG_WATER
    • DEBUG_HEIGHTMAP

      public static final boolean DEBUG_HEIGHTMAP
    • DEBUG_COLLISION

      public static final boolean DEBUG_COLLISION
    • DEBUG_SHOW_LOCAL_SERVER_ENTITY_HIT_BOXES

      public static final boolean DEBUG_SHOW_LOCAL_SERVER_ENTITY_HIT_BOXES
    • DEBUG_SUPPORT_BLOCKS

      public static final boolean DEBUG_SUPPORT_BLOCKS
    • DEBUG_SHAPES

      public static final boolean DEBUG_SHAPES
    • DEBUG_NEIGHBORSUPDATE

      public static final boolean DEBUG_NEIGHBORSUPDATE
    • DEBUG_EXPERIMENTAL_REDSTONEWIRE_UPDATE_ORDER

      public static final boolean DEBUG_EXPERIMENTAL_REDSTONEWIRE_UPDATE_ORDER
    • DEBUG_STRUCTURES

      public static final boolean DEBUG_STRUCTURES
    • DEBUG_LIGHT

      public static final boolean DEBUG_LIGHT
    • DEBUG_SKY_LIGHT_SECTIONS

      public static final boolean DEBUG_SKY_LIGHT_SECTIONS
    • DEBUG_SOLID_FACE

      public static final boolean DEBUG_SOLID_FACE
    • DEBUG_CHUNKS

      public static final boolean DEBUG_CHUNKS
    • DEBUG_GAME_EVENT_LISTENERS

      public static final boolean DEBUG_GAME_EVENT_LISTENERS
    • DEBUG_DUMP_TEXTURE_ATLAS

      public static final boolean DEBUG_DUMP_TEXTURE_ATLAS
    • DEBUG_DUMP_INTERPOLATED_TEXTURE_FRAMES

      public static final boolean DEBUG_DUMP_INTERPOLATED_TEXTURE_FRAMES
    • DEBUG_STRUCTURE_EDIT_MODE

      public static final boolean DEBUG_STRUCTURE_EDIT_MODE
    • DEBUG_SAVE_STRUCTURES_AS_SNBT

      public static final boolean DEBUG_SAVE_STRUCTURES_AS_SNBT
    • DEBUG_SYNCHRONOUS_GL_LOGS

      public static final boolean DEBUG_SYNCHRONOUS_GL_LOGS
    • DEBUG_VERBOSE_SERVER_EVENTS

      public static final boolean DEBUG_VERBOSE_SERVER_EVENTS
    • DEBUG_NAMED_RUNNABLES

      public static final boolean DEBUG_NAMED_RUNNABLES
    • DEBUG_GOAL_SELECTOR

      public static final boolean DEBUG_GOAL_SELECTOR
    • DEBUG_VILLAGE_SECTIONS

      public static final boolean DEBUG_VILLAGE_SECTIONS
    • DEBUG_BRAIN

      public static final boolean DEBUG_BRAIN
    • DEBUG_POI

      public static final boolean DEBUG_POI
    • DEBUG_BEES

      public static final boolean DEBUG_BEES
    • DEBUG_RAIDS

      public static final boolean DEBUG_RAIDS
    • DEBUG_BLOCK_BREAK

      public static final boolean DEBUG_BLOCK_BREAK
    • DEBUG_MONITOR_TICK_TIMES

      public static final boolean DEBUG_MONITOR_TICK_TIMES
    • DEBUG_KEEP_JIGSAW_BLOCKS_DURING_STRUCTURE_GEN

      public static final boolean DEBUG_KEEP_JIGSAW_BLOCKS_DURING_STRUCTURE_GEN
    • DEBUG_DONT_SAVE_WORLD

      public static final boolean DEBUG_DONT_SAVE_WORLD
    • DEBUG_LARGE_DRIPSTONE

      public static final boolean DEBUG_LARGE_DRIPSTONE
    • DEBUG_CARVERS

      public static final boolean DEBUG_CARVERS
    • DEBUG_ORE_VEINS

      public static final boolean DEBUG_ORE_VEINS
    • DEBUG_SCULK_CATALYST

      public static final boolean DEBUG_SCULK_CATALYST
    • DEBUG_BYPASS_REALMS_VERSION_CHECK

      public static final boolean DEBUG_BYPASS_REALMS_VERSION_CHECK
    • DEBUG_SOCIAL_INTERACTIONS

      public static final boolean DEBUG_SOCIAL_INTERACTIONS
    • DEBUG_VALIDATE_RESOURCE_PATH_CASE

      public static final boolean DEBUG_VALIDATE_RESOURCE_PATH_CASE
    • DEBUG_UNLOCK_ALL_TRADES

      public static final boolean DEBUG_UNLOCK_ALL_TRADES
    • DEBUG_BREEZE_MOB

      public static final boolean DEBUG_BREEZE_MOB
    • DEBUG_TRIAL_SPAWNER_DETECTS_SHEEP_AS_PLAYERS

      public static final boolean DEBUG_TRIAL_SPAWNER_DETECTS_SHEEP_AS_PLAYERS
    • DEBUG_VAULT_DETECTS_SHEEP_AS_PLAYERS

      public static final boolean DEBUG_VAULT_DETECTS_SHEEP_AS_PLAYERS
    • DEBUG_FORCE_ONBOARDING_SCREEN

      public static final boolean DEBUG_FORCE_ONBOARDING_SCREEN
    • DEBUG_CURSOR_POS

      public static final boolean DEBUG_CURSOR_POS
    • DEBUG_DEFAULT_SKIN_OVERRIDE

      public static final boolean DEBUG_DEFAULT_SKIN_OVERRIDE
    • DEBUG_PANORAMA_SCREENSHOT

      public static final boolean DEBUG_PANORAMA_SCREENSHOT
    • DEBUG_CHASE_COMMAND

      public static final boolean DEBUG_CHASE_COMMAND
    • DEBUG_VERBOSE_COMMAND_ERRORS

      public static final boolean DEBUG_VERBOSE_COMMAND_ERRORS
    • DEBUG_DEV_COMMANDS

      public static final boolean DEBUG_DEV_COMMANDS
    • DEBUG_IGNORE_LOCAL_MOB_CAP

      public static final boolean DEBUG_IGNORE_LOCAL_MOB_CAP
    • DEBUG_DISABLE_LIQUID_SPREADING

      public static final boolean DEBUG_DISABLE_LIQUID_SPREADING
    • DEBUG_AQUIFERS

      public static final boolean DEBUG_AQUIFERS
    • DEBUG_JFR_PROFILING_ENABLE_LEVEL_LOADING

      public static final boolean DEBUG_JFR_PROFILING_ENABLE_LEVEL_LOADING
    • DEBUG_ENTITY_BLOCK_INTERSECTION

      public static final boolean DEBUG_ENTITY_BLOCK_INTERSECTION
    • debugGenerateSquareTerrainWithoutNoise

      public static boolean debugGenerateSquareTerrainWithoutNoise
    • DEBUG_ONLY_GENERATE_HALF_THE_WORLD

      public static final boolean DEBUG_ONLY_GENERATE_HALF_THE_WORLD
    • DEBUG_DISABLE_FLUID_GENERATION

      public static final boolean DEBUG_DISABLE_FLUID_GENERATION
    • DEBUG_DISABLE_AQUIFERS

      public static final boolean DEBUG_DISABLE_AQUIFERS
    • DEBUG_DISABLE_SURFACE

      public static final boolean DEBUG_DISABLE_SURFACE
    • DEBUG_DISABLE_CARVERS

      public static final boolean DEBUG_DISABLE_CARVERS
    • DEBUG_DISABLE_STRUCTURES

      public static final boolean DEBUG_DISABLE_STRUCTURES
    • DEBUG_DISABLE_FEATURES

      public static final boolean DEBUG_DISABLE_FEATURES
    • DEBUG_DISABLE_ORE_VEINS

      public static final boolean DEBUG_DISABLE_ORE_VEINS
    • DEBUG_DISABLE_BLENDING

      public static final boolean DEBUG_DISABLE_BLENDING
    • DEBUG_DISABLE_BELOW_ZERO_RETROGENERATION

      public static final boolean DEBUG_DISABLE_BELOW_ZERO_RETROGENERATION
    • DEFAULT_MINECRAFT_PORT

      public static final int DEFAULT_MINECRAFT_PORT
      The default port used by Minecraft for communication between servers and clients.

      This is not a registered port at the Internet Assigned Numbers Authority, and therefore may conflict with existing applications. Minecraft servers may be hosted at other ports, in which case the clients must supply the correct port when connecting to the server.

      See Also:
    • DEBUG_SUBTITLES

      public static final boolean DEBUG_SUBTITLES
    • DEBUG_FAKE_LATENCY_MS

      public static final int DEBUG_FAKE_LATENCY_MS
    • DEBUG_FAKE_JITTER_MS

      public static final int DEBUG_FAKE_JITTER_MS
    • NETTY_LEAK_DETECTION

      public static final io.netty.util.ResourceLeakDetector.Level NETTY_LEAK_DETECTION
    • COMMAND_STACK_TRACES

      public static final boolean COMMAND_STACK_TRACES
    • DEBUG_WORLD_RECREATE

      public static final boolean DEBUG_WORLD_RECREATE
    • DEBUG_SHOW_SERVER_DEBUG_VALUES

      public static final boolean DEBUG_SHOW_SERVER_DEBUG_VALUES
    • DEBUG_FEATURE_COUNT

      public static final boolean DEBUG_FEATURE_COUNT
    • DEBUG_FORCE_TELEMETRY

      public static final boolean DEBUG_FORCE_TELEMETRY
    • DEBUG_DONT_SEND_TELEMETRY_TO_BACKEND

      public static final boolean DEBUG_DONT_SEND_TELEMETRY_TO_BACKEND
    • MAXIMUM_TICK_TIME_NANOS

      public static final long MAXIMUM_TICK_TIME_NANOS
    • MAXIMUM_BLOCK_EXPLOSION_RESISTANCE

      public static final float MAXIMUM_BLOCK_EXPLOSION_RESISTANCE
      See Also:
    • USE_WORKFLOWS_HOOKS

      public static final boolean USE_WORKFLOWS_HOOKS
      See Also:
    • USE_DEVONLY

      public static final boolean USE_DEVONLY
      See Also:
    • CHECK_DATA_FIXER_SCHEMA

      public static boolean CHECK_DATA_FIXER_SCHEMA
    • IS_RUNNING_IN_IDE

      public static boolean IS_RUNNING_IN_IDE
    • IS_RUNNING_WITH_JDWP

      public static final boolean IS_RUNNING_WITH_JDWP
    • WORLD_RESOLUTION

      public static final int WORLD_RESOLUTION
      See Also:
    • MAX_CHAT_LENGTH

      public static final int MAX_CHAT_LENGTH
      The maximum length of a chat message that can be typed by a player.
      See Also:
    • MAX_USER_INPUT_COMMAND_LENGTH

      public static final int MAX_USER_INPUT_COMMAND_LENGTH
      See Also:
    • MAX_FUNCTION_COMMAND_LENGTH

      public static final int MAX_FUNCTION_COMMAND_LENGTH
      See Also:
    • MAX_PLAYER_NAME_LENGTH

      public static final int MAX_PLAYER_NAME_LENGTH
      See Also:
    • MAX_CHAINED_NEIGHBOR_UPDATES

      public static final int MAX_CHAINED_NEIGHBOR_UPDATES
      See Also:
    • MAX_RENDER_DISTANCE

      public static final int MAX_RENDER_DISTANCE
      See Also:
    • ILLEGAL_FILE_CHARACTERS

      public static final char[] ILLEGAL_FILE_CHARACTERS
      The characters which may not form part of a file's name. Used in various file processing methods to replace these illegal characters with valid characters, such as the underscore "_".

      This collection of characters is a subset of the forbidden characters listed in the documentation for Microsoft Windows, with the addition of the backtick (`).

      See Also:
    • TICKS_PER_SECOND

      public static final int TICKS_PER_SECOND
      The amount of game ticks within a real-life second.

      This is not guaranteed by a running server to be an accurate measurement of real-life seconds. Heavy load on the server may cause the actual tick-to-second ratio to go below this defined ratio.

      See Also:
    • MILLIS_PER_TICK

      public static final int MILLIS_PER_TICK
      See Also:
    • TICKS_PER_MINUTE

      public static final int TICKS_PER_MINUTE
      The amount of game ticks within a real-life minute. This is equal to TICKS_PER_SECOND * 60, and falls under the same guarantees and restrictions as TICKS_PER_SECOND.
      See Also:
    • TICKS_PER_GAME_DAY

      public static final int TICKS_PER_GAME_DAY
      The amount of game ticks within a game day. A game day is defined as 20 real-life minutes, so this is equal to TICKS_PER_MINUTE * 20. This falls under the same guarantees and restrictions as TICKS_PER_SECOND.
      See Also:
    • AVERAGE_GAME_TICKS_PER_RANDOM_TICK_PER_BLOCK

      public static final float AVERAGE_GAME_TICKS_PER_RANDOM_TICK_PER_BLOCK
      See Also:
    • AVERAGE_RANDOM_TICKS_PER_BLOCK_PER_MINUTE

      public static final float AVERAGE_RANDOM_TICKS_PER_BLOCK_PER_MINUTE
      See Also:
    • AVERAGE_RANDOM_TICKS_PER_BLOCK_PER_GAME_DAY

      public static final float AVERAGE_RANDOM_TICKS_PER_BLOCK_PER_GAME_DAY
      See Also:
    • WORLD_ICON_SIZE

      public static final int WORLD_ICON_SIZE
      See Also:
    • CURRENT_VERSION

      @Nullable private static WorldVersion CURRENT_VERSION
  • Constructor Details

    • SharedConstants

      public SharedConstants()
  • Method Details

    • prefixDebugFlagName

      private static String prefixDebugFlagName(String pName)
    • booleanProperty

      private static boolean booleanProperty(String pName)
    • debugFlag

      private static boolean debugFlag(String pName)
    • debugIntValue

      private static int debugIntValue(String pName)
    • setVersion

      public static void setVersion(WorldVersion pVersion)
      Sets the world version, failing if a different world version is already present.
      Parameters:
      pVersion - the world version to set
      Throws:
      IllegalStateException - if a different world version has already been set previously
    • tryDetectVersion

      public static void tryDetectVersion()
    • getCurrentVersion

      public static WorldVersion getCurrentVersion()
    • getProtocolVersion

      public static int getProtocolVersion()
    • debugVoidTerrain

      public static boolean debugVoidTerrain(ChunkPos pChunkPos)