f perms now works in 1.13

This commit is contained in:
ProSavage 2018-08-05 01:05:14 -05:00
parent 397775b3ed
commit 207c4daab1
2 changed files with 29 additions and 7 deletions

View File

@ -103,17 +103,37 @@ public enum PermissableAction {
if (access == null) {
access = Access.UNDEFINED;
}
DyeColor dyeColor = null;
try {
dyeColor = DyeColor.valueOf(section.getString("access." + access.name().toLowerCase()));
} catch (Exception exception) {
}
ItemStack item = new ItemStack(material);
ItemMeta itemMeta = item.getItemMeta();
if (dyeColor != null) {
item.setDurability(dyeColor.getWoolData());
String accessValue = null;
if (access.equals(Access.ALLOW)) {
accessValue = "allow";
} else if (access.equals(Access.DENY)) {
accessValue = "deny";
} else if (access.equals(Access.UNDEFINED)) {
accessValue = "undefined";
}
// If under the 1.13 version we will use the colorable option.
if (!P.p.mc113) {
DyeColor dyeColor = null;
try {
dyeColor = DyeColor.valueOf(section.getString("access." + access.name().toLowerCase()));
} catch (Exception exception) {
}
if (dyeColor != null) {
item.setDurability(dyeColor.getWoolData());
}
} else {
// 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
item.setType(Material.valueOf(P.p.getConfig().getString("fperm-gui.action.access." + accessValue)));
}
for (String loreLine : section.getStringList("placeholder-item.lore")) {

View File

@ -520,6 +520,7 @@ fperm-gui:
tntfill: 41
chest: 42
spawner: 38
home: 49
# Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color
materials:
@ -549,6 +550,7 @@ fperm-gui:
tntfill: STAINED_GLASS
chest: STAINED_GLASS
spawner: STAINED_GLASS
home: STAINED_GLASS
# Same dummy items format as above
dummy-items:
'0':