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
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3
5 changed files with 24 additions and 42 deletions

17
pom.xml
View File

@ -90,11 +90,6 @@
<url>http://maven.sk89q.com/repo/</url> <url>http://maven.sk89q.com/repo/</url>
</repository> </repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository> <repository>
<id>papermc</id> <id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url> <url>https://papermc.io/repo/repository/maven-public/</url>
@ -150,9 +145,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.libraryaddict</groupId> <groupId>com.github.TFPatches</groupId>
<artifactId>LibsDisguises</artifactId> <artifactId>TF-LibsDisguises</artifactId>
<version>31672fce7b</version> <version>0cfa32159a</version>
</dependency> </dependency>
<dependency> <dependency>
@ -236,6 +231,12 @@
<version>3.12.1.GA</version> <version>3.12.1.GA</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -4,6 +4,7 @@ import me.libraryaddict.disguise.DisguiseAPI;
import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.LibsDisguises;
import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.libraryaddict.disguise.BlockedDisguises;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
@ -101,19 +102,12 @@ public class LibsDisguisesBridge extends FreedomService
return; return;
} }
if (state) BlockedDisguises.disabled = !state;
{
server.getPluginManager().disablePlugin(libsDisguises);
}
else
{
server.getPluginManager().disablePlugin(libsDisguises);
}
} }
public boolean isDisguisesEnabled() public boolean isDisguisesEnabled()
{ {
return !getLibsDisguisesPlugin().isEnabled(); return !BlockedDisguises.disabled;
} }
public boolean isEnabled() public boolean isEnabled()

View File

@ -66,7 +66,7 @@ public class PermissionManager extends FreedomService
seniorAdminPermissions.addAll(telnetAdminPermissions); seniorAdminPermissions.addAll(telnetAdminPermissions);
permissions.put(Rank.SENIOR_ADMIN, seniorAdminPermissions); 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"); 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 + "!"); 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!"); player.sendMessage(ChatColor.GREEN + "Run " + shopItem.getCommand() + " 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!");
} }
} }

View File

@ -7,11 +7,11 @@ import org.bukkit.Material;
public enum ShopItem public enum ShopItem
{ {
GRAPPLING_HOOK("Grappling Hook", Material.FISHING_ROD, 10, ConfigEntry.SHOP_PRICES_GRAPPLING_HOOK, ChatColor.GREEN, "grapplingHook"), 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"), 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"), 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"), 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"); STACKING_POTATO("Stacking Potato", Material.POTATO, 22, ConfigEntry.SHOP_PRICES_STACKING_POTATO, ChatColor.YELLOW, "stackingPotato", "/stackingpotato");
/* /*
Shop GUI Layout: Shop GUI Layout:
@ -36,8 +36,10 @@ public enum ShopItem
private final ChatColor color; private final ChatColor color;
@Getter @Getter
private final String dataName; 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.name = name;
this.icon = icon; this.icon = icon;
@ -45,6 +47,7 @@ public enum ShopItem
this.cost = cost; this.cost = cost;
this.color = color; this.color = color;
this.dataName = dataName; this.dataName = dataName;
this.command = command;
} }
public String getColoredName() public String getColoredName()