1 | package sh.okx.rankup.util; | |
2 | ||
3 | import org.bukkit.Material; | |
4 | ||
5 | public class ItemUtil { | |
6 | private static boolean flattened; | |
7 | ||
8 | static { | |
9 | try { | |
10 | Material.valueOf("BLACK_STAINED_GLASS_PANE"); | |
11 | flattened = true; | |
12 | } catch (IllegalArgumentException e) { | |
13 | flattened = false; | |
14 | } | |
15 | } | |
16 | ||
17 | /** | |
18 | * Determines if a server is post-flattening or pre-flattening. | |
19 | * The flattening is the name for the event where, instead of using durability to represent | |
20 | * similar items, Mojang decided to use distinct item types for each item. | |
21 | * This caused many {@link Material} names to change, making some things incompatible. | |
22 | * The flattening happened in 1.13. | |
23 | * | |
24 | * @return true if the server is post-flattening (server versions 1.13, 1.14, 1.15) or false if it is pre-flattening (1.12, 1.11, 1.10 etc) | |
25 | */ | |
26 | public static boolean isServerFlattened() { | |
27 |
2
1. isServerFlattened : replaced boolean return with true for sh/okx/rankup/util/ItemUtil::isServerFlattened → SURVIVED 2. isServerFlattened : replaced boolean return with false for sh/okx/rankup/util/ItemUtil::isServerFlattened → KILLED |
return flattened; |
28 | } | |
29 | } | |
Mutations | ||
27 |
1.1 2.2 |