diff --git a/src/main/java/org/spongepowered/api/block/entity/Sign.java b/src/main/java/org/spongepowered/api/block/entity/Sign.java index 044d46671a..16ffab6ddb 100644 --- a/src/main/java/org/spongepowered/api/block/entity/Sign.java +++ b/src/main/java/org/spongepowered/api/block/entity/Sign.java @@ -25,6 +25,7 @@ package org.spongepowered.api.block.entity; import net.kyori.adventure.text.Component; +import org.spongepowered.api.data.DataHolder; import org.spongepowered.api.data.Keys; import org.spongepowered.api.data.value.ListValue; import org.spongepowered.api.data.value.Value; @@ -52,4 +53,35 @@ default Value.Mutable glowingText() { return this.requireValue(Keys.GLOWING_TEXT).asMutable(); } + default Value.Mutable waxed() { + return this.requireValue(Keys.SIGN_WAXED).asMutable(); + } + + default SignText backText() { + return this.require(Keys.SIGN_BACK_TEXT); + } + default SignText frontText() { + return this.require(Keys.SIGN_FRONT_TEXT); + } + + interface SignText extends DataHolder.Mutable { + /** + * Gets the {@link org.spongepowered.api.data.value.ListValue.Mutable} of {@link Component} for the {@link Sign} + * to show. + * + * @return The list of text lines + */ + default ListValue.Mutable lines() { + return this.requireValue(Keys.SIGN_LINES).asMutable(); + } + + /** + * {@return Whether this sign has glowing text}. + */ + default Value.Mutable glowingText() { + return this.requireValue(Keys.GLOWING_TEXT).asMutable(); + } + + // TODO color? + } } diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index 485ee56fe2..be6972f6a0 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -1143,8 +1143,8 @@ public final class Keys { public static final Key> GRASS_COLOR_MODIFIER = Keys.key(ResourceKey.sponge("grass_color_modifier"), GrassColorModifier.class); /** - * Whether a {@link Sign} has glowing text (from dying - * with {@link ItemTypes#GLOW_INK_SAC}). + * Whether a {@link org.spongepowered.api.block.entity.Sign.SignText} has glowing text (from dying + * with {@link ItemTypes#GLOW_INK_SAC}). When using it on {@link Sign} this refers to the {@link #SIGN_FRONT_TEXT} only. */ public static final Key> GLOWING_TEXT = Keys.key(ResourceKey.sponge("glowing_text"), Boolean.class); @@ -2749,10 +2749,16 @@ public final class Keys { public static final Key> SHOW_BOTTOM = Keys.key(ResourceKey.sponge("show_bottom"), Boolean.class); /** - * The lines displayed on a {@link Sign}. + * The lines of a {@link org.spongepowered.api.block.entity.Sign.SignText}. + * When using it on {@link Sign} this refers to the {@link #SIGN_FRONT_TEXT} only. */ public static final Key> SIGN_LINES = Keys.listKey(ResourceKey.sponge("sign_lines"), Component.class); + public static final Key> SIGN_BACK_TEXT = Keys.key(ResourceKey.sponge("sign_back_text"), Sign.SignText.class); + public static final Key> SIGN_FRONT_TEXT = Keys.key(ResourceKey.sponge("sign_front_text"), Sign.SignText.class); + + public static final Key> SIGN_WAXED = Keys.key(ResourceKey.sponge("sign_waxed"), Boolean.class); + /** * The size of a {@link Slime}. * or