Don't let Sign extend SignSide, mark API as experimental

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot
2023-05-24 20:30:51 -04:00
parent 0ca2940380
commit 3ccdb11aab
2 changed files with 27 additions and 16 deletions

View File

@@ -1,23 +1,24 @@
package org.bukkit.block; package org.bukkit.block;
import org.bukkit.DyeColor;
import org.bukkit.block.sign.Side; import org.bukkit.block.sign.Side;
import org.bukkit.block.sign.SignSide; import org.bukkit.block.sign.SignSide;
import org.bukkit.material.Colorable;
import org.jetbrains.annotations.ApiStatus.Experimental;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
* Represents a captured state of either a SignPost or a WallSign. * Represents a captured state of either a SignPost or a WallSign.
*/ */
public interface Sign extends SignSide, TileState { public interface Sign extends TileState, Colorable {
/** /**
* Gets all the lines of text currently on the {@link Side#FRONT} of this sign. * Gets all the lines of text currently on the {@link Side#FRONT} of this sign.
* *
* @return Array of Strings containing each line of text * @return Array of Strings containing each line of text
* @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#getLines()}. * @see #getSide(Side)
*/ */
@Deprecated
@NotNull @NotNull
@Override
public String[] getLines(); public String[] getLines();
/** /**
@@ -28,11 +29,9 @@ public interface Sign extends SignSide, TileState {
* @param index Line number to get the text from, starting at 0 * @param index Line number to get the text from, starting at 0
* @return Text on the given line * @return Text on the given line
* @throws IndexOutOfBoundsException Thrown when the line does not exist * @throws IndexOutOfBoundsException Thrown when the line does not exist
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#getLine(int)}. * @see #getSide(Side)
*/ */
@Deprecated
@NotNull @NotNull
@Override
public String getLine(int index) throws IndexOutOfBoundsException; public String getLine(int index) throws IndexOutOfBoundsException;
/** /**
@@ -44,10 +43,8 @@ public interface Sign extends SignSide, TileState {
* @param index Line number to set the text at, starting from 0 * @param index Line number to set the text at, starting from 0
* @param line New text to set at the specified index * @param line New text to set at the specified index
* @throws IndexOutOfBoundsException If the index is out of the range 0..3 * @throws IndexOutOfBoundsException If the index is out of the range 0..3
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setLine(int, String)}. * @see #getSide(Side)
*/ */
@Deprecated
@Override
public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException; public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException;
/** /**
@@ -76,28 +73,40 @@ public interface Sign extends SignSide, TileState {
* Gets whether this sign has glowing text. Only affects the {@link Side#FRONT}. * Gets whether this sign has glowing text. Only affects the {@link Side#FRONT}.
* *
* @return if this sign has glowing text * @return if this sign has glowing text
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#isGlowingText()}. * @see #getSide(Side)
*/ */
@Deprecated
@Override
public boolean isGlowingText(); public boolean isGlowingText();
/** /**
* Sets whether this sign has glowing text. Only affects the {@link Side#FRONT}. * Sets whether this sign has glowing text. Only affects the {@link Side#FRONT}.
* *
* @param glowing if this sign has glowing text * @param glowing if this sign has glowing text
* @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setGlowingText(boolean)}. * @see #getSide(Side)
*/ */
@Deprecated
@Override
public void setGlowingText(boolean glowing); public void setGlowingText(boolean glowing);
/**
* {@inheritDoc}
*
* @see #getSide(Side)
*/
@NotNull
public DyeColor getColor();
/**
* {@inheritDoc}
*
* @see #getSide(Side)
*/
public void setColor(@NotNull DyeColor color);
/** /**
* Return the side of the sign. * Return the side of the sign.
* *
* @param side the side of the sign * @param side the side of the sign
* @return the selected side of the sign * @return the selected side of the sign
*/ */
@Experimental
@NotNull @NotNull
public SignSide getSide(@NotNull Side side); public SignSide getSide(@NotNull Side side);
} }

View File

@@ -1,11 +1,13 @@
package org.bukkit.block.sign; package org.bukkit.block.sign;
import org.bukkit.material.Colorable; import org.bukkit.material.Colorable;
import org.jetbrains.annotations.ApiStatus.Experimental;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/** /**
* Represents a side of a sign. * Represents a side of a sign.
*/ */
@Experimental
public interface SignSide extends Colorable { public interface SignSide extends Colorable {
/** /**