mirror of
https://github.com/plexusorg/Plex.git
synced 2025-06-28 06:26:41 +00:00
Add bStats
This commit is contained in:
@ -25,6 +25,7 @@ import dev.plex.world.CustomWorld;
|
||||
import java.util.UUID;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@ -52,7 +53,7 @@ public class Plex extends JavaPlugin
|
||||
|
||||
private AdminList adminList;
|
||||
|
||||
private String ranksOrPermissions;
|
||||
private String system;
|
||||
|
||||
public static Plex get()
|
||||
{
|
||||
@ -83,7 +84,7 @@ public class Plex extends JavaPlugin
|
||||
{
|
||||
config.load();
|
||||
messages.load();
|
||||
ranksOrPermissions = config.getString("commands.permissions");
|
||||
system = config.getString("commands.permissions");
|
||||
|
||||
try
|
||||
{
|
||||
@ -96,6 +97,11 @@ public class Plex extends JavaPlugin
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// https://bstats.org/plugin/bukkit/Plex/14143
|
||||
Metrics metrics = new Metrics(this, 14143);
|
||||
PlexLog.log("Enabled Metrics");
|
||||
|
||||
|
||||
if (storageType == StorageType.MONGODB)
|
||||
{
|
||||
mongoPlayerData = new MongoPlayerData();
|
||||
|
@ -88,7 +88,7 @@ public abstract class PlexCommand extends Command
|
||||
|
||||
PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(player.getUniqueId());
|
||||
|
||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
if (!plexPlayer.getRankFromString().isAtLeast(getLevel()))
|
||||
{
|
||||
@ -96,7 +96,7 @@ public abstract class PlexCommand extends Command
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (plugin.getRanksOrPermissions().equalsIgnoreCase("permissions"))
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!player.hasPermission(perms.permission()))
|
||||
{
|
||||
@ -180,14 +180,14 @@ public abstract class PlexCommand extends Command
|
||||
protected boolean checkRank(Player player, Rank rank, String permission)
|
||||
{
|
||||
PlexPlayer plexPlayer = getPlexPlayer(player);
|
||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
if (!plexPlayer.getRank().equals(rank.toString()))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.tl("noPermissionRank", ChatColor.stripColor(rank.getLoginMSG())));
|
||||
}
|
||||
}
|
||||
else if (plugin.getRanksOrPermissions().equalsIgnoreCase("permissions"))
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!player.hasPermission(permission))
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ public class CommandHandler extends PlexBase
|
||||
public CommandHandler()
|
||||
{
|
||||
List<PlexCommand> commands = Lists.newArrayList();
|
||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
commands.add(new AdminCMD());
|
||||
commands.add(new DeopAllCMD());
|
||||
|
Reference in New Issue
Block a user