diff --git a/pom.xml b/pom.xml index fbd0c1bb..774a145b 100644 --- a/pom.xml +++ b/pom.xml @@ -90,11 +90,6 @@ http://maven.sk89q.com/repo/ - - CodeMC - https://repo.codemc.org/repository/maven-public - - papermc https://papermc.io/repo/repository/maven-public/ @@ -150,9 +145,9 @@ - com.github.libraryaddict - LibsDisguises - 31672fce7b + com.github.TFPatches + TF-LibsDisguises + 0cfa32159a @@ -236,6 +231,12 @@ 3.12.1.GA + + org.projectlombok + lombok + 1.18.10 + + diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java index 756694b1..20cc105e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java @@ -4,6 +4,7 @@ import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.util.FLog; +import me.libraryaddict.disguise.BlockedDisguises; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -101,19 +102,12 @@ public class LibsDisguisesBridge extends FreedomService return; } - if (state) - { - server.getPluginManager().disablePlugin(libsDisguises); - } - else - { - server.getPluginManager().disablePlugin(libsDisguises); - } + BlockedDisguises.disabled = !state; } public boolean isDisguisesEnabled() { - return !getLibsDisguisesPlugin().isEnabled(); + return !BlockedDisguises.disabled; } public boolean isEnabled() diff --git a/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java b/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java index 63fe27af..5ebc094d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/permissions/PermissionManager.java @@ -66,7 +66,7 @@ public class PermissionManager extends FreedomService seniorAdminPermissions.addAll(telnetAdminPermissions); permissions.put(Rank.SENIOR_ADMIN, seniorAdminPermissions); - int count = operatorPermissions.size() + masterBuilderPermissions.size() + masterBuilderPermissions.size() + superAdminPermissions.size() + telnetAdminPermissions.size() + seniorAdminPermissions.size(); + int count = PermissionEntry.OPERATORS.getEntry().size() + PermissionEntry.MASTER_BUILDERS.getEntry().size() + PermissionEntry.SUPER_ADMINS.getEntry().size() + PermissionEntry.TELNET_ADMINS.getEntry().size() + PermissionEntry.SENIOR_ADMINS.getEntry().size(); FLog.info("Loaded " + count + " permission nodes"); } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/shop/Shop.java b/src/main/java/me/totalfreedom/totalfreedommod/shop/Shop.java index 511b2cd8..1bc2d62b 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/shop/Shop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/shop/Shop.java @@ -318,25 +318,9 @@ public class Shop extends FreedomService player.sendMessage(getShopPrefix() + " " + ChatColor.GREEN + "Successfully purchased the \"" + shopItem.getColoredName() + ChatColor.GREEN + "\" for " + ChatColor.GOLD + price + ChatColor.GREEN + "!"); - if (shopItem.equals(ShopItem.GRAPPLING_HOOK)) + if (shopItem.getCommand() != null) { - player.sendMessage(ChatColor.GREEN + "Run /grapplinghook to get one!"); - } - else if (shopItem.equals(ShopItem.LIGHTNING_ROD)) - { - player.sendMessage(ChatColor.GREEN + "Run /lightningrod to get one!"); - } - else if (shopItem.equals(ShopItem.FIRE_BALL)) - { - player.sendMessage(ChatColor.GREEN + "Run /fireball to get one!"); - } - else if (shopItem.equals(ShopItem.RIDEABLE_PEARL)) - { - player.sendMessage(ChatColor.GREEN + "Run /rideablepearl to get one!"); - } - else if (shopItem.equals(ShopItem.STACKING_POTATO)) - { - player.sendMessage(ChatColor.GREEN + "Run /stackingpotato to get one!"); + player.sendMessage(ChatColor.GREEN + "Run " + shopItem.getCommand() + " to get one!"); } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/shop/ShopItem.java b/src/main/java/me/totalfreedom/totalfreedommod/shop/ShopItem.java index 947d32c6..96531050 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/shop/ShopItem.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/shop/ShopItem.java @@ -7,11 +7,11 @@ import org.bukkit.Material; public enum ShopItem { - GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 10, ConfigEntry.SHOP_PRICES_GRAPPLING_HOOK, ChatColor.GREEN, "grapplingHook"), - LIGHTNING_ROD("Lightning Rod", Material.BLAZE_ROD, 12, ConfigEntry.SHOP_PRICES_LIGHTNING_ROD, ChatColor.LIGHT_PURPLE, "lightningRod"), - FIRE_BALL("Fire Ball", Material.FIRE_CHARGE, 14, ConfigEntry.SHOP_PRICES_FIRE_BALL, ChatColor.RED, "fireBall"), - RIDEABLE_PEARL("Rideable Ender Pearl", Material.ENDER_PEARL, 16, ConfigEntry.SHOP_PRICES_RIDEABLE_PEARL, ChatColor.DARK_PURPLE, "rideablePearl"), - STACKING_POTATO("Stacking Potato", Material.POTATO, 22, ConfigEntry.SHOP_PRICES_STACKING_POTATO, ChatColor.YELLOW, "stackingPotato"); + GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 10, ConfigEntry.SHOP_PRICES_GRAPPLING_HOOK, ChatColor.GREEN, "grapplingHook", "/grapplinghook"), + LIGHTNING_ROD("Lightning Rod", Material.BLAZE_ROD, 12, ConfigEntry.SHOP_PRICES_LIGHTNING_ROD, ChatColor.LIGHT_PURPLE, "lightningRod", "/lightningrod"), + FIRE_BALL("Fire Ball", Material.FIRE_CHARGE, 14, ConfigEntry.SHOP_PRICES_FIRE_BALL, ChatColor.RED, "fireBall", "/fireball"), + RIDEABLE_PEARL("Rideable Ender Pearl", Material.ENDER_PEARL, 16, ConfigEntry.SHOP_PRICES_RIDEABLE_PEARL, ChatColor.DARK_PURPLE, "rideablePearl", "/rideablepearl"), + STACKING_POTATO("Stacking Potato", Material.POTATO, 22, ConfigEntry.SHOP_PRICES_STACKING_POTATO, ChatColor.YELLOW, "stackingPotato", "/stackingpotato"); /* Shop GUI Layout: @@ -36,8 +36,10 @@ public enum ShopItem private final ChatColor color; @Getter private final String dataName; + @Getter + private final String command; - ShopItem(String name, Material icon, int slot, ConfigEntry cost, ChatColor color, String dataName) + ShopItem(String name, Material icon, int slot, ConfigEntry cost, ChatColor color, String dataName, String command) { this.name = name; this.icon = icon; @@ -45,6 +47,7 @@ public enum ShopItem this.cost = cost; this.color = color; this.dataName = dataName; + this.command = command; } public String getColoredName()