@@ -103,17 +103,37 @@ public ItemStack buildItem(FPlayer fme, Permissable permissable) {
103
103
if (access == null ) {
104
104
access = Access .UNDEFINED ;
105
105
}
106
- DyeColor dyeColor = null ;
107
- try {
108
- dyeColor = DyeColor .valueOf (section .getString ("access." + access .name ().toLowerCase ()));
109
- } catch (Exception exception ) {
110
- }
111
106
112
107
ItemStack item = new ItemStack (material );
113
108
ItemMeta itemMeta = item .getItemMeta ();
114
109
115
- if (dyeColor != null ) {
116
- item .setDurability (dyeColor .getWoolData ());
110
+
111
+ String accessValue = null ;
112
+
113
+ if (access .equals (Access .ALLOW )) {
114
+ accessValue = "allow" ;
115
+ } else if (access .equals (Access .DENY )) {
116
+ accessValue = "deny" ;
117
+ } else if (access .equals (Access .UNDEFINED )) {
118
+ accessValue = "undefined" ;
119
+ }
120
+
121
+
122
+ // If under the 1.13 version we will use the colorable option.
123
+ if (!P .p .mc113 ) {
124
+ DyeColor dyeColor = null ;
125
+
126
+ try {
127
+ dyeColor = DyeColor .valueOf (section .getString ("access." + access .name ().toLowerCase ()));
128
+ } catch (Exception exception ) {
129
+ }
130
+
131
+ if (dyeColor != null ) {
132
+ item .setDurability (dyeColor .getWoolData ());
133
+ }
134
+ } else {
135
+ // so this is in 1.13 mode, our config will automatically be updated to a material instead of color because of it being removed in the new api
136
+ item .setType (Material .valueOf (P .p .getConfig ().getString ("fperm-gui.action.access." + accessValue )));
117
137
}
118
138
119
139
for (String loreLine : section .getStringList ("placeholder-item.lore" )) {
0 commit comments