mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
Add bStats
This commit is contained in:
parent
4a05d90c17
commit
fe53f5c49f
@ -30,6 +30,8 @@ dependencies {
|
|||||||
library 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
|
library 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
|
||||||
library 'org.apache.httpcomponents:httpclient:4.5.13'
|
library 'org.apache.httpcomponents:httpclient:4.5.13'
|
||||||
compileOnly 'io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT'
|
compileOnly 'io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT'
|
||||||
|
implementation 'org.bstats:bstats-base:3.0.0'
|
||||||
|
implementation 'org.bstats:bstats-bukkit:3.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'dev.plex'
|
group = 'dev.plex'
|
||||||
@ -38,6 +40,7 @@ description = 'Plex'
|
|||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveClassifier.set("")
|
archiveClassifier.set("")
|
||||||
|
relocate 'org.bstats', 'dev.plex'
|
||||||
}
|
}
|
||||||
|
|
||||||
bukkit {
|
bukkit {
|
||||||
|
@ -25,6 +25,7 @@ import dev.plex.world.CustomWorld;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ public class Plex extends JavaPlugin
|
|||||||
|
|
||||||
private AdminList adminList;
|
private AdminList adminList;
|
||||||
|
|
||||||
private String ranksOrPermissions;
|
private String system;
|
||||||
|
|
||||||
public static Plex get()
|
public static Plex get()
|
||||||
{
|
{
|
||||||
@ -83,7 +84,7 @@ public class Plex extends JavaPlugin
|
|||||||
{
|
{
|
||||||
config.load();
|
config.load();
|
||||||
messages.load();
|
messages.load();
|
||||||
ranksOrPermissions = config.getString("commands.permissions");
|
system = config.getString("commands.permissions");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -96,6 +97,11 @@ public class Plex extends JavaPlugin
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://bstats.org/plugin/bukkit/Plex/14143
|
||||||
|
Metrics metrics = new Metrics(this, 14143);
|
||||||
|
PlexLog.log("Enabled Metrics");
|
||||||
|
|
||||||
|
|
||||||
if (storageType == StorageType.MONGODB)
|
if (storageType == StorageType.MONGODB)
|
||||||
{
|
{
|
||||||
mongoPlayerData = new MongoPlayerData();
|
mongoPlayerData = new MongoPlayerData();
|
||||||
|
@ -88,7 +88,7 @@ public abstract class PlexCommand extends Command
|
|||||||
|
|
||||||
PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(player.getUniqueId());
|
PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(player.getUniqueId());
|
||||||
|
|
||||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||||
{
|
{
|
||||||
if (!plexPlayer.getRankFromString().isAtLeast(getLevel()))
|
if (!plexPlayer.getRankFromString().isAtLeast(getLevel()))
|
||||||
{
|
{
|
||||||
@ -96,7 +96,7 @@ public abstract class PlexCommand extends Command
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (plugin.getRanksOrPermissions().equalsIgnoreCase("permissions"))
|
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||||
{
|
{
|
||||||
if (!player.hasPermission(perms.permission()))
|
if (!player.hasPermission(perms.permission()))
|
||||||
{
|
{
|
||||||
@ -180,14 +180,14 @@ public abstract class PlexCommand extends Command
|
|||||||
protected boolean checkRank(Player player, Rank rank, String permission)
|
protected boolean checkRank(Player player, Rank rank, String permission)
|
||||||
{
|
{
|
||||||
PlexPlayer plexPlayer = getPlexPlayer(player);
|
PlexPlayer plexPlayer = getPlexPlayer(player);
|
||||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||||
{
|
{
|
||||||
if (!plexPlayer.getRank().equals(rank.toString()))
|
if (!plexPlayer.getRank().equals(rank.toString()))
|
||||||
{
|
{
|
||||||
throw new CommandFailException(PlexUtils.tl("noPermissionRank", ChatColor.stripColor(rank.getLoginMSG())));
|
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))
|
if (!player.hasPermission(permission))
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ public class CommandHandler extends PlexBase
|
|||||||
public CommandHandler()
|
public CommandHandler()
|
||||||
{
|
{
|
||||||
List<PlexCommand> commands = Lists.newArrayList();
|
List<PlexCommand> commands = Lists.newArrayList();
|
||||||
if (plugin.getRanksOrPermissions().equalsIgnoreCase("ranks"))
|
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||||
{
|
{
|
||||||
commands.add(new AdminCMD());
|
commands.add(new AdminCMD());
|
||||||
commands.add(new DeopAllCMD());
|
commands.add(new DeopAllCMD());
|
||||||
|
Loading…
Reference in New Issue
Block a user