Skip to content

Commit

Permalink
add warning to base_color tags/mechs, for #2015
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 1, 2019
1 parent 9fe1291 commit 1ec01ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Expand Up @@ -907,8 +907,12 @@ public String getAttribute(Attribute attribute) {
// @description
// Returns the base color of the banner at this location.
// For the list of possible colors, see <@link url http://bit.ly/1dydq12>.
// As of 1.13+, this tag is no longer relevant.
// -->
if (attribute.startsWith("base_color")) {
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13)) {
Debug.echoError("Base_Color tag no longer relevant: banner types are now distinct materials.");
}
DyeColor color = ((Banner) getBlockStateForTag(attribute)).getBaseColor();
return new ElementTag(color != null ? color.name() : "BLACK").getAttribute(attribute.fulfill(1));
}
Expand Down Expand Up @@ -2964,10 +2968,14 @@ else if (getBlock().getType() == Material.FLOWER_POT) {
// @description
// Changes the base color of the banner at this location.
// For the list of possible colors, see <@link url http://bit.ly/1dydq12>.
// As of 1.13+, this mechanism is no longer relevant.
// @tags
// <LocationTag.base_color>
// -->
if (mechanism.matches("base_color")) {
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_13)) {
Debug.echoError("Base_Color mechanism no longer relevant: banner types are now distinct materials.");
}
Banner banner = (Banner) getBlockState();
banner.setBaseColor(DyeColor.valueOf(mechanism.getValue().asString().toUpperCase()));
banner.update();
Expand Down
Expand Up @@ -97,7 +97,9 @@ public static void registermainProperties() {

// register core ItemTag properties
PropertyParser.registerProperty(ItemApple.class, ItemTag.class);
PropertyParser.registerProperty(ItemBaseColor.class, ItemTag.class);
if (NMSHandler.getVersion().isAtMost(NMSVersion.v1_12)) {
PropertyParser.registerProperty(ItemBaseColor.class, ItemTag.class);
}
PropertyParser.registerProperty(ItemBook.class, ItemTag.class);
PropertyParser.registerProperty(ItemDisplayname.class, ItemTag.class);
PropertyParser.registerProperty(ItemDurability.class, ItemTag.class);
Expand Down
Expand Up @@ -89,6 +89,7 @@ public String getAttribute(Attribute attribute) {
// @description
// Gets the base color of a banner.
// For the list of possible colors, see <@link url http://bit.ly/1dydq12>.
// As of 1.13+, this tag is no longer relevant.
// -->
if (attribute.startsWith("base_color")) {
DyeColor baseColor = getBaseColor();
Expand Down Expand Up @@ -126,6 +127,7 @@ public void adjust(Mechanism mechanism) {
// @description
// Changes the base color of a banner.
// For the list of possible colors, see <@link url http://bit.ly/1dydq12>.
// As of 1.13+, this mechanism is no longer relevant.
// @tags
// <ItemTag.base_color>
// -->
Expand Down

0 comments on commit 1ec01ee

Please sign in to comment.