Class BlockStateValues
java.lang.Object
org.geysermc.connector.network.translators.world.block.BlockStateValues
Used for block entities if the Java block state contains Bedrock block information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intstatic intstatic intstatic intstatic intstatic int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetBannerColor(int state)Banner colors are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock.static bytegetBedColor(int state)Bed colors are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock.static it.unimi.dsi.fastutil.ints.Int2ByteMapThe block state in Java and Bedrock both contain the conditional bit, however command block block entity tags in Bedrock need the conditional information.static it.unimi.dsi.fastutil.ints.Int2ObjectMap<DoubleChestValue>All double chest values are part of the block state in Java and part of the block entity tag in Bedrock.static it.unimi.dsi.fastutil.ints.Int2ObjectMap<String>Get the Int2ObjectMap of flower pot block states to containing plantThis returns a Map interface so IntelliJ doesn't complain aboutInt2BooleanMap.compute(int, BiFunction)not returning null.static intgetNoteblockPitch(int state)The note that noteblocks output when hit is part of the block state in Java but sent as a BlockEventPacket in Bedrock.static it.unimi.dsi.fastutil.ints.Int2BooleanMapGet the Int2BooleanMap showing if a piston block state is extended or not.static bytegetShulkerBoxDirection(int state)Shulker box directions are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock.static bytegetSkullRotation(int state)Skull rotations are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock.static bytegetSkullVariant(int state)Skull variations are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock.static it.unimi.dsi.fastutil.ints.Int2IntMapSkull rotations are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock.static floatgetSlipperiness(int state)Get the slipperiness of a block.static intgetWaterLevel(int state)Get the level of water from the block state.static booleanisStickyPiston(int blockState)static voidstoreBlockStateValues(String javaId, int javaBlockState, com.fasterxml.jackson.databind.JsonNode blockData)Determines if the block state contains Bedrock block information
-
Field Details
-
JAVA_AIR_ID
public static final int JAVA_AIR_ID- See Also:
- Constant Field Values
-
JAVA_BELL_ID
public static int JAVA_BELL_ID -
JAVA_COBWEB_ID
public static int JAVA_COBWEB_ID -
JAVA_FURNACE_ID
public static int JAVA_FURNACE_ID -
JAVA_FURNACE_LIT_ID
public static int JAVA_FURNACE_LIT_ID -
JAVA_SPAWNER_ID
public static int JAVA_SPAWNER_ID -
JAVA_WATER_ID
public static int JAVA_WATER_ID
-
-
Constructor Details
-
BlockStateValues
public BlockStateValues()
-
-
Method Details
-
storeBlockStateValues
public static void storeBlockStateValues(String javaId, int javaBlockState, com.fasterxml.jackson.databind.JsonNode blockData)Determines if the block state contains Bedrock block information- Parameters:
javaId- The Java Identifier of the blockjavaBlockState- the Java Block State of the blockblockData- JsonNode of info about the block from blocks.json
-
getBannerColor
public static int getBannerColor(int state)Banner colors are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. This gives an integer color that Bedrock can use.- Parameters:
state- BlockState of the block- Returns:
- Banner color integer or -1 if no color
-
getBedColor
public static byte getBedColor(int state)Bed colors are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. This gives a byte color that Bedrock can use - Bedrock needs a byte in the final tag.- Parameters:
state- BlockState of the block- Returns:
- Bed color byte or -1 if no color
-
getCommandBlockValues
public static it.unimi.dsi.fastutil.ints.Int2ByteMap getCommandBlockValues()The block state in Java and Bedrock both contain the conditional bit, however command block block entity tags in Bedrock need the conditional information.- Returns:
- the list of all command blocks and if they are conditional (1 or 0)
-
getDoubleChestValues
All double chest values are part of the block state in Java and part of the block entity tag in Bedrock. This gives the DoubleChestValue that can be calculated into the final tag.- Returns:
- The map of all DoubleChestValues.
-
getFlowerPotValues
Get the Int2ObjectMap of flower pot block states to containing plant- Returns:
- Int2ObjectMap of flower pot values
-
getLecternBookStates
This returns a Map interface so IntelliJ doesn't complain aboutInt2BooleanMap.compute(int, BiFunction)not returning null.- Returns:
- the lectern book state map pointing to book present state
-
getNoteblockPitch
public static int getNoteblockPitch(int state)The note that noteblocks output when hit is part of the block state in Java but sent as a BlockEventPacket in Bedrock. This gives an integer pitch that Bedrock can use.- Parameters:
state- BlockState of the block- Returns:
- note block note integer or -1 if not present
-
getPistonValues
public static it.unimi.dsi.fastutil.ints.Int2BooleanMap getPistonValues()Get the Int2BooleanMap showing if a piston block state is extended or not.- Returns:
- the Int2BooleanMap of piston extensions.
-
isStickyPiston
public static boolean isStickyPiston(int blockState) -
getSkullVariant
public static byte getSkullVariant(int state)Skull variations are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. This gives a byte variant ID that Bedrock can use.- Parameters:
state- BlockState of the block- Returns:
- Skull variant byte or -1 if no variant
-
getSkullRotation
public static byte getSkullRotation(int state)Skull rotations are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. This gives a byte rotation that Bedrock can use.- Parameters:
state- BlockState of the block- Returns:
- Skull rotation value or -1 if no value
-
getSkullWallDirections
public static it.unimi.dsi.fastutil.ints.Int2IntMap getSkullWallDirections()Skull rotations are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. This gives a integer rotation that Bedrock can use.- Returns:
- Skull wall rotation value with the blockstate
-
getShulkerBoxDirection
public static byte getShulkerBoxDirection(int state)Shulker box directions are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. This gives a byte direction that Bedrock can use.- Parameters:
state- BlockState of the block- Returns:
- Shulker direction value or -1 if no value
-
getWaterLevel
public static int getWaterLevel(int state)Get the level of water from the block state. This is used in FishingHookEntity to create splash sounds when the hook hits the water.- Parameters:
state- BlockState of the block- Returns:
- The water level or -1 if the block isn't water
-
getSlipperiness
public static float getSlipperiness(int state)Get the slipperiness of a block. This is used in ItemEntity to calculate the friction on an item as it slides across the ground- Parameters:
state- BlockState of the block- Returns:
- The block's slipperiness
-