Package cn.nukkit.blockstate
Class BlockStateRegistry
java.lang.Object
cn.nukkit.blockstate.BlockStateRegistry
@PowerNukkitOnly
@Since("1.4.0.0-PN")
@ParametersAreNonnullByDefault
public final class BlockStateRegistry
extends Object
保存着从
BlockState
-> runtimeid 的注册表-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
close()
static void
copyBlockPaletteBytes
(byte[] target, int targetIndex) static MutableBlockState
createMutableState
(int blockId) static MutableBlockState
createMutableState
(int blockId, int bigMeta) static MutableBlockState
createMutableState
(int blockId, Number storage) static void
static Integer
getBlockId
(String persistenceName) static int
getBlockIdByRuntimeId
(int runtimeId) static byte[]
static int
static int
static BlockState
getBlockStateByRuntimeId
(int runtimeId) static BlockState
static int
static String
getKnownBlockStateIdByRuntimeId
(int runtimeId) static int
getKnownRuntimeIdByBlockStateId
(String stateId) static String
getPersistenceName
(int blockId) static BlockProperties
getProperties
(int blockId) static int
getRuntimeId
(int blockId) static int
getRuntimeId
(int blockId, int meta) Deprecated.static int
getRuntimeId
(BlockState state) static int
getRuntimeIdByBlockStateHash
(int blockStateHash) static int
static void
putBlockPaletteBytes
(BinaryStream stream) static OK<?>
registerCustomBlockState
(List<CustomBlock> blockCustoms) static void
registerPersistenceName
(int blockId, String persistenceName)
-
Field Details
-
BIG_META_MASK
- See Also:
-
blockPaletteVersion
-
-
Method Details
-
getBlockIdByRuntimeId
-
getRuntimeId
-
getRuntimeId
-
getRuntimeId
@PowerNukkitOnly @Since("1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="getRuntimeId(BlockState state)", since="1.3.0.0-PN") public static int getRuntimeId(int blockId, int meta) Deprecated. -
getKnownBlockStateIdByRuntimeId
@PowerNukkitOnly @Since("1.5.2.0-PN") @Nullable public static String getKnownBlockStateIdByRuntimeId(int runtimeId) -
getKnownRuntimeIdByBlockStateId
@PowerNukkitOnly @Since("1.5.2.0-PN") public static int getKnownRuntimeIdByBlockStateId(String stateId) -
getRuntimeIdByBlockStateHash
@PowerNukkitXOnly @Since("1.20.0-r3") public static int getRuntimeIdByBlockStateHash(int blockStateHash) -
getBlockStateByRuntimeId
@PowerNukkitOnly @Since("1.4.0.0-PN") @Nullable public static BlockState getBlockStateByRuntimeId(int runtimeId) - Returns:
null
if the runtime id does not matches any known block state.
-
getPersistenceNames
-
getPersistenceName
-
registerPersistenceName
@PowerNukkitOnly @Since("1.4.0.0-PN") public static void registerPersistenceName(int blockId, String persistenceName) -
registerCustomBlockState
@PowerNukkitOnly @Since("1.6.0.0-PNX") public static OK<?> registerCustomBlockState(List<CustomBlock> blockCustoms) -
deleteCustomBlockState
-
getBlockPaletteDataVersion
-
getBlockPaletteBytes
-
putBlockPaletteBytes
-
getBlockPaletteLength
-
copyBlockPaletteBytes
@PowerNukkitOnly @Since("1.4.0.0-PN") public static void copyBlockPaletteBytes(byte[] target, int targetIndex) -
getProperties
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public static BlockProperties getProperties(int blockId) -
createMutableState
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public static MutableBlockState createMutableState(int blockId) -
createMutableState
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public static MutableBlockState createMutableState(int blockId, int bigMeta) -
createMutableState
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public static MutableBlockState createMutableState(int blockId, Number storage) - Throws:
InvalidBlockStateException
-
getUpdateBlockRegistration
-
getBlockId
@PowerNukkitOnly @Since("1.4.0.0-PN") @Nullable public static Integer getBlockId(String persistenceName) -
getFallbackRuntimeId
-
getFallbackBlockState
-
close
-