|  | 
| 61 | 61 |  * <b>/give @p minecraft:dirt 1 10</b> where 1 is the item amount, and 10 is the data value. The material {@link #DIRT} with a data value of {@code 10} doesn't exist. | 
| 62 | 62 |  * | 
| 63 | 63 |  * @author Crypto Morin | 
| 64 |  | - * @version 11.0.0 | 
|  | 64 | + * @version 11.2.0 | 
| 65 | 65 |  * @see Material | 
| 66 | 66 |  * @see ItemStack | 
| 67 | 67 |  */ | 
| @@ -1009,36 +1009,36 @@ public enum XMaterial { | 
| 1009 | 1009 |     POTATOES("POTATO"), | 
| 1010 | 1010 |     POTION, | 
| 1011 | 1011 |     POTTED_ACACIA_SAPLING(4, "FLOWER_POT"), | 
| 1012 |  | -    POTTED_ALLIUM(2, "RED_ROSE", "FLOWER_POT"), | 
|  | 1012 | +    POTTED_ALLIUM(2, "FLOWER_POT"), | 
| 1013 | 1013 |     POTTED_AZALEA_BUSH, | 
| 1014 |  | -    POTTED_AZURE_BLUET(3, "RED_ROSE", "FLOWER_POT"), | 
|  | 1014 | +    POTTED_AZURE_BLUET(3, "FLOWER_POT"), | 
| 1015 | 1015 |     POTTED_BAMBOO, | 
| 1016 | 1016 |     POTTED_BIRCH_SAPLING(2, "FLOWER_POT"), | 
| 1017 |  | -    POTTED_BLUE_ORCHID(1, "RED_ROSE", "FLOWER_POT"), | 
|  | 1017 | +    POTTED_BLUE_ORCHID(1, "FLOWER_POT"), | 
| 1018 | 1018 |     POTTED_BROWN_MUSHROOM("FLOWER_POT"), | 
| 1019 | 1019 |     POTTED_CACTUS("FLOWER_POT"), | 
| 1020 | 1020 |     POTTED_CORNFLOWER, | 
| 1021 | 1021 |     POTTED_CRIMSON_FUNGUS, | 
| 1022 | 1022 |     POTTED_CRIMSON_ROOTS, | 
| 1023 |  | -    POTTED_DANDELION("YELLOW_FLOWER", "FLOWER_POT"), | 
|  | 1023 | +    POTTED_DANDELION("FLOWER_POT"), | 
| 1024 | 1024 |     POTTED_DARK_OAK_SAPLING(5, "FLOWER_POT"), | 
| 1025 | 1025 |     POTTED_DEAD_BUSH("FLOWER_POT"), | 
| 1026 |  | -    POTTED_FERN(2, "LONG_GRASS", "FLOWER_POT"), | 
|  | 1026 | +    POTTED_FERN(2, "FLOWER_POT"), | 
| 1027 | 1027 |     POTTED_FLOWERING_AZALEA_BUSH, | 
| 1028 | 1028 |     POTTED_JUNGLE_SAPLING(3, "FLOWER_POT"), | 
| 1029 | 1029 |     POTTED_LILY_OF_THE_VALLEY, | 
| 1030 | 1030 |     POTTED_MANGROVE_PROPAGULE, | 
| 1031 | 1031 |     POTTED_OAK_SAPLING("FLOWER_POT"), | 
| 1032 |  | -    POTTED_ORANGE_TULIP(5, "RED_ROSE", "FLOWER_POT"), | 
| 1033 |  | -    POTTED_OXEYE_DAISY(8, "RED_ROSE", "FLOWER_POT"), | 
| 1034 |  | -    POTTED_PINK_TULIP(7, "RED_ROSE", "FLOWER_POT"), | 
| 1035 |  | -    POTTED_POPPY("RED_ROSE", "FLOWER_POT"), | 
|  | 1032 | +    POTTED_ORANGE_TULIP(5, "FLOWER_POT"), | 
|  | 1033 | +    POTTED_OXEYE_DAISY(8, "FLOWER_POT"), | 
|  | 1034 | +    POTTED_PINK_TULIP(7, "FLOWER_POT"), | 
|  | 1035 | +    POTTED_POPPY("FLOWER_POT"), | 
| 1036 | 1036 |     POTTED_RED_MUSHROOM("FLOWER_POT"), | 
| 1037 |  | -    POTTED_RED_TULIP(4, "RED_ROSE", "FLOWER_POT"), | 
|  | 1037 | +    POTTED_RED_TULIP(4, "FLOWER_POT"), | 
| 1038 | 1038 |     POTTED_SPRUCE_SAPLING(1, "FLOWER_POT"), | 
| 1039 | 1039 |     POTTED_WARPED_FUNGUS, | 
| 1040 | 1040 |     POTTED_WARPED_ROOTS, | 
| 1041 |  | -    POTTED_WHITE_TULIP(6, "RED_ROSE", "FLOWER_POT"), | 
|  | 1041 | +    POTTED_WHITE_TULIP(6, "FLOWER_POT"), | 
| 1042 | 1042 |     POTTED_WITHER_ROSE, | 
| 1043 | 1043 |     POWDER_SNOW, | 
| 1044 | 1044 |     POWDER_SNOW_BUCKET, | 
| @@ -1127,6 +1127,10 @@ public enum XMaterial { | 
| 1127 | 1127 |     RED_CARPET(14, "CARPET"), | 
| 1128 | 1128 |     RED_CONCRETE(14, "CONCRETE"), | 
| 1129 | 1129 |     RED_CONCRETE_POWDER(14, "CONCRETE_POWDER"), | 
|  | 1130 | +    /** | 
|  | 1131 | +     * 1.13 renamed to ROSE_RED | 
|  | 1132 | +     * 1.14 renamed to RED_DYE | 
|  | 1133 | +     */ | 
| 1130 | 1134 |     RED_DYE(1, "INK_SACK", "ROSE_RED"), | 
| 1131 | 1135 |     RED_GLAZED_TERRACOTTA, | 
| 1132 | 1136 |     RED_MUSHROOM, | 
| @@ -1429,6 +1433,10 @@ public enum XMaterial { | 
| 1429 | 1433 |     YELLOW_CARPET(4, "CARPET"), | 
| 1430 | 1434 |     YELLOW_CONCRETE(4, "CONCRETE"), | 
| 1431 | 1435 |     YELLOW_CONCRETE_POWDER(4, "CONCRETE_POWDER"), | 
|  | 1436 | +    /** | 
|  | 1437 | +     * 1.13 renamed to DANDELION_YELLOW | 
|  | 1438 | +     * 1.14 renamed to YELLOW_DYE | 
|  | 1439 | +     */ | 
| 1432 | 1440 |     YELLOW_DYE(11, "INK_SACK", "DANDELION_YELLOW"), | 
| 1433 | 1441 |     YELLOW_GLAZED_TERRACOTTA, | 
| 1434 | 1442 |     YELLOW_SHULKER_BOX, | 
| @@ -1570,45 +1578,6 @@ public enum XMaterial { | 
| 1570 | 1578 | 
 | 
| 1571 | 1579 |     XMaterial(String... legacy) {this(0, legacy);} | 
| 1572 | 1580 | 
 | 
| 1573 |  | -    /** | 
| 1574 |  | -     * Checks if the version is 1.13 Aquatic Update or higher. | 
| 1575 |  | -     * An invocation of this method yields the cached result from the expression: | 
| 1576 |  | -     * <p> | 
| 1577 |  | -     * <blockquote> | 
| 1578 |  | -     * {@link #supports(int) 13}} | 
| 1579 |  | -     * </blockquote> | 
| 1580 |  | -     * | 
| 1581 |  | -     * @return true if 1.13 or higher. | 
| 1582 |  | -     * @see #getVersion() | 
| 1583 |  | -     * @see #supports(int) | 
| 1584 |  | -     * @since 1.0.0 | 
| 1585 |  | -     * @deprecated Use {@code XMaterial.supports(13)} instead. This method name can be confusing. | 
| 1586 |  | -     */ | 
| 1587 |  | -    @Deprecated | 
| 1588 |  | -    public static boolean isNewVersion() { | 
| 1589 |  | -        return Data.ISFLAT; | 
| 1590 |  | -    } | 
| 1591 |  | - | 
| 1592 |  | -    /** | 
| 1593 |  | -     * This is just an extra method that can be used for many cases. | 
| 1594 |  | -     * It can be used in {@link org.bukkit.event.player.PlayerInteractEvent} | 
| 1595 |  | -     * or when accessing {@link org.bukkit.entity.Player#getMainHand()}, | 
| 1596 |  | -     * or other compatibility related methods. | 
| 1597 |  | -     * <p> | 
| 1598 |  | -     * An invocation of this method yields exactly the same result as the expression: | 
| 1599 |  | -     * <p> | 
| 1600 |  | -     * <blockquote> | 
| 1601 |  | -     * !{@link #supports(int)} 9 | 
| 1602 |  | -     * </blockquote> | 
| 1603 |  | -     * | 
| 1604 |  | -     * @since 2.0.0 | 
| 1605 |  | -     * @deprecated Use {@code !XMaterial.supports(9)} instead. | 
| 1606 |  | -     */ | 
| 1607 |  | -    @Deprecated | 
| 1608 |  | -    public static boolean isOneEight() { | 
| 1609 |  | -        return !supports(9); | 
| 1610 |  | -    } | 
| 1611 |  | - | 
| 1612 | 1581 |     /** | 
| 1613 | 1582 |      * Gets the XMaterial with this name similar to {@link #valueOf(String)} | 
| 1614 | 1583 |      * without throwing an exception. | 
| @@ -1757,11 +1726,15 @@ public static XMaterial matchXMaterial(@Nonnull ItemStack item) { | 
| 1757 | 1726 |         } | 
| 1758 | 1727 | 
 | 
| 1759 | 1728 |         // Refer to the enum for info. | 
| 1760 |  | -        // Currently this is the only material with a non-zero data value | 
|  | 1729 | +        // Currently, these are the only materials with a non-zero data value | 
| 1761 | 1730 |         // that has been renamed after the flattening update. | 
| 1762 |  | -        // If this happens to more materials in the future, | 
| 1763 |  | -        // I might have to change then system. | 
| 1764 |  | -        if (Data.ISFLAT && !supports(14) && material.equals("CACTUS_GREEN")) return GREEN_DYE; | 
|  | 1731 | +        // If this happens to more materials in the future, I might have to change the system. | 
|  | 1732 | +        if (supports(13) && !supports(14)) { | 
|  | 1733 | +            // https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/diff/src/main/java/org/bukkit/Material.java?until=67d908a9830c71267ee740f5bddd728ce9c64cc7 | 
|  | 1734 | +            if (material.equals("CACTUS_GREEN")) return GREEN_DYE; | 
|  | 1735 | +            if (material.equals("ROSE_RED")) return RED_DYE; | 
|  | 1736 | +            if (material.equals("DANDELION_YELLOW")) return YELLOW_DYE; | 
|  | 1737 | +        } | 
| 1765 | 1738 | 
 | 
| 1766 | 1739 |         // Check FILLED_MAP enum for more info. | 
| 1767 | 1740 |         // if (!Data.ISFLAT && item.hasItemMeta() && item.getItemMeta() instanceof org.bukkit.inventory.meta.MapMeta) return FILLED_MAP; | 
| @@ -2162,7 +2135,8 @@ public boolean isSupported() { | 
| 2162 | 2135 |      * @param alternateMaterial the material to get if this one is not supported. | 
| 2163 | 2136 |      * @return this material or the {@code alternateMaterial} if not supported. | 
| 2164 | 2137 |      */ | 
| 2165 |  | -    public XMaterial or(XMaterial alternateMaterial) { | 
|  | 2138 | +    @Nullable | 
|  | 2139 | +    public XMaterial or(@Nullable XMaterial alternateMaterial) { | 
| 2166 | 2140 |         return isSupported() ? this : alternateMaterial; | 
| 2167 | 2141 |     } | 
| 2168 | 2142 | 
 | 
|  | 
0 commit comments