f perms now works in 1.13
This commit is contained in:
parent
397775b3ed
commit
207c4daab1
@ -103,18 +103,38 @@ public enum PermissableAction {
|
|||||||
if (access == null) {
|
if (access == null) {
|
||||||
access = Access.UNDEFINED;
|
access = Access.UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ItemStack item = new ItemStack(material);
|
||||||
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
DyeColor dyeColor = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dyeColor = DyeColor.valueOf(section.getString("access." + access.name().toLowerCase()));
|
dyeColor = DyeColor.valueOf(section.getString("access." + access.name().toLowerCase()));
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack item = new ItemStack(material);
|
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
|
||||||
|
|
||||||
if (dyeColor != null) {
|
if (dyeColor != null) {
|
||||||
item.setDurability(dyeColor.getWoolData());
|
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")) {
|
for (String loreLine : section.getStringList("placeholder-item.lore")) {
|
||||||
lore.add(replacePlaceholders(loreLine, fme, permissable));
|
lore.add(replacePlaceholders(loreLine, fme, permissable));
|
||||||
|
@ -520,6 +520,7 @@ fperm-gui:
|
|||||||
tntfill: 41
|
tntfill: 41
|
||||||
chest: 42
|
chest: 42
|
||||||
spawner: 38
|
spawner: 38
|
||||||
|
home: 49
|
||||||
|
|
||||||
# Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color
|
# Material to show, if the material is colorable eg: Wool, Stained Clay it will update with it's access color
|
||||||
materials:
|
materials:
|
||||||
@ -549,6 +550,7 @@ fperm-gui:
|
|||||||
tntfill: STAINED_GLASS
|
tntfill: STAINED_GLASS
|
||||||
chest: STAINED_GLASS
|
chest: STAINED_GLASS
|
||||||
spawner: STAINED_GLASS
|
spawner: STAINED_GLASS
|
||||||
|
home: STAINED_GLASS
|
||||||
# Same dummy items format as above
|
# Same dummy items format as above
|
||||||
dummy-items:
|
dummy-items:
|
||||||
'0':
|
'0':
|
||||||
|
Loading…
Reference in New Issue
Block a user