diff --git a/CHANGELOG.md b/CHANGELOG.md index f2445be13..7233181c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,4 +10,21 @@ Items: ### Changes: - No longer add the contents of `DisplayData` to the `Items` section on `/crazycrates reload` -- Lowercase shield pattern types and colors which also fixed a display issue, so previous shield pattern/color configs work. They no longer need to be typed like GRADIENT_UP:LIGHT_GRAY, you can simply type gradient_up:light_gray \ No newline at end of file +- Lowercase shield pattern types and colors which also fixed a display issue, so previous shield pattern/color configs work. They no longer need to be typed like GRADIENT_UP:LIGHT_GRAY, you can simply type gradient_up:light_gray +- Deprecated `Patterns` in favor of `DisplayPatterns`, it will be removed in the next major version of Minecraft. +```yml + '6': + # The name of the item to display in the gui. + DisplayName: "Fancy Shield" + # The enchants to display in the gui. + DisplayItem: "shield" + # A list of patterns: https://jd.papermc.io/paper/1.21/org/bukkit/block/banner/PatternType.html + # The patterns don't need to be uppercased. you can type them lowercased along with the colors. + # Patterns have to be laid out in a specific order, otherwise it won't look right. + # This also applies to the Items section. + DisplayPatterns: + - "base:white" + - "gradient_up:light_gray" + - "straight_cross:light_blue" + - "flower:light_blue" +``` \ No newline at end of file diff --git a/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java b/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java index 051657c45..7cbc870bc 100644 --- a/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java +++ b/src/main/java/com/badbones69/crazycrates/api/objects/Prize.java @@ -240,9 +240,9 @@ public final boolean hasPermission(@NotNull final Player player) { if (this.section.contains("Lore")) { if (MiscUtils.isLogging()) { List.of( - "Detected deprecated usage of Lore in Prize " + this.sectionName + " in " + this.crateName + ".yml, please change Lore to DisplayLore", - "Lore will be removed in the next major version of Minecraft in favor of DisplayLore.", - "This does not apply to ANYWHERE outside of the Prizes, It also does not apply to the Items section in prizes." + "Deprecated usage of Patterns in your Prize " + this.sectionName + " in " + this.crateName + ".yml, please change Lore to DisplayLore", + "Lore will be removed in the next major version of Minecraft in favor of DisplayLore", + "You can turn my nagging off in config.yml, verbose_logging: true -> false" ).forEach(this.plugin.getComponentLogger()::warn); } @@ -254,11 +254,25 @@ public final boolean hasPermission(@NotNull final Player player) { builder.setDamage(this.section.getInt("DisplayDamage", 0)); if (this.section.contains("Patterns")) { + if (MiscUtils.isLogging()) { + List.of( + "Deprecated usage of Patterns in your Prize " + this.sectionName + " in " + this.crateName + ".yml, please change Patterns to DisplayPatterns", + "Patterns will be removed in the next major version of Minecraft in favor of DisplayPattern", + "You can turn my nagging off in config.yml, verbose_logging: true -> false" + ).forEach(this.plugin.getComponentLogger()::warn); + } + for (final String pattern : this.section.getStringList("Patterns")) { builder.addPattern(pattern.toLowerCase()); } } + if (this.section.contains("DisplayPatterns")) { + for (final String pattern : this.section.getStringList("DisplayPatterns")) { + builder.addPattern(pattern.toLowerCase()); + } + } + builder.setItemFlags(this.section.getStringList("Flags")); builder.setHidingItemFlags(this.section.getBoolean("HideItemFlags", false)); diff --git a/src/main/resources/crates/CrateExample.yml b/src/main/resources/crates/CrateExample.yml index d3ef334bc..f9b1ae6ae 100644 --- a/src/main/resources/crates/CrateExample.yml +++ b/src/main/resources/crates/CrateExample.yml @@ -263,7 +263,7 @@ Crate: # The patterns don't need to be uppercased. you can type them lowercased along with the colors. # Patterns have to be laid out in a specific order, otherwise it won't look right. # This also applies to the Items section. - Patterns: + DisplayPatterns: - "base:white" - "gradient_up:light_gray" - "straight_cross:light_blue"