adventure: make calls with generic component lists more usable (#9008)
This should allow the usage of ItemStack#lore and other methods with a List<TextComponent>
This commit is contained in:
@@ -2151,7 +2151,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @throws IllegalArgumentException if location is null
|
||||
+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
+ */
|
||||
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<net.kyori.adventure.text.Component> lines) throws IllegalArgumentException {
|
||||
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<? extends net.kyori.adventure.text.Component> lines) throws IllegalArgumentException {
|
||||
+ this.sendSignChange(loc, lines, DyeColor.BLACK);
|
||||
+ }
|
||||
+
|
||||
@@ -2172,7 +2172,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @throws IllegalArgumentException if dyeColor is null
|
||||
+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
+ */
|
||||
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<net.kyori.adventure.text.Component> lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException {
|
||||
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<? extends net.kyori.adventure.text.Component> lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException {
|
||||
+ this.sendSignChange(loc, lines, dyeColor, false);
|
||||
+ }
|
||||
+
|
||||
@@ -2193,7 +2193,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @throws IllegalArgumentException if dyeColor is null
|
||||
+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
+ */
|
||||
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<net.kyori.adventure.text.Component> lines, boolean hasGlowingText) throws IllegalArgumentException {
|
||||
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<? extends net.kyori.adventure.text.Component> lines, boolean hasGlowingText) throws IllegalArgumentException {
|
||||
+ this.sendSignChange(loc, lines, DyeColor.BLACK, hasGlowingText);
|
||||
+ }
|
||||
+
|
||||
@@ -2215,7 +2215,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @throws IllegalArgumentException if dyeColor is null
|
||||
+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
+ */
|
||||
+ void sendSignChange(@NotNull Location loc, @Nullable java.util.List<net.kyori.adventure.text.Component> lines, @NotNull DyeColor dyeColor, boolean hasGlowingText)
|
||||
+ void sendSignChange(@NotNull Location loc, @Nullable java.util.List<? extends net.kyori.adventure.text.Component> lines, @NotNull DyeColor dyeColor, boolean hasGlowingText)
|
||||
+ throws IllegalArgumentException;
|
||||
+ // Paper end
|
||||
+
|
||||
@@ -4136,7 +4136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param lore the lore to set
|
||||
+ */
|
||||
+ void lore(final @Nullable List<net.kyori.adventure.text.Component> lore);
|
||||
+ void lore(final @Nullable List<? extends net.kyori.adventure.text.Component> lore);
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
|
||||
@@ -139,7 +139,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param lore the lore that will be set
|
||||
+ */
|
||||
+ public void lore(@Nullable List<net.kyori.adventure.text.Component> lore) {
|
||||
+ public void lore(@Nullable List<? extends net.kyori.adventure.text.Component> lore) {
|
||||
+ ItemMeta itemMeta = getItemMeta();
|
||||
+ if (itemMeta == null) {
|
||||
+ throw new IllegalStateException("Cannot set lore on " + getType());
|
||||
|
||||
Reference in New Issue
Block a user