Package org.geysermc.geyser.util
Class SignUtils
java.lang.Object
org.geysermc.geyser.util.SignUtils
Provides utilities for interacting with signs. Mainly, it deals with the widths of each character.
Since Bedrock auto-wraps signs and Java does not, we have to take this into account when translating signs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum character width that a hanging sign can hold in both Java and Bedrock.static final intThe maximum character width that a non-hanging sign can hold in both Java and Bedrock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetCharacterWidth(char c) Gets the Minecraft width of a characterstatic intgetSignWidthMax(boolean hanging)
-
Field Details
-
SIGN_WIDTH_MAX
public static final int SIGN_WIDTH_MAXThe maximum character width that a non-hanging sign can hold in both Java and Bedrock- See Also:
-
HANGING_SIGN_WIDTH_MAX
public static final int HANGING_SIGN_WIDTH_MAXThe maximum character width that a hanging sign can hold in both Java and Bedrock. Hanging signs are narrower.- See Also:
-
-
Constructor Details
-
SignUtils
public SignUtils()
-
-
Method Details
-
getCharacterWidth
public static int getCharacterWidth(char c) Gets the Minecraft width of a character- Parameters:
c- character to determine- Returns:
- width of the character
-
getSignWidthMax
public static int getSignWidthMax(boolean hanging)
-