Guess I had to modify LibsDisguises after all

This commit is contained in:
Seth
2020-07-07 01:36:29 -07:00
parent c333a6ee39
commit d74eeec113
5 changed files with 24 additions and 42 deletions

View File

@ -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()

View File

@ -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");
}

View File

@ -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!");
}
}

View File

@ -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()