Big update

This commit is contained in:
Telesphoreo 2022-01-03 21:04:39 -06:00
parent 921a62cd58
commit 88c70e84cc
59 changed files with 407 additions and 296 deletions

21
pom.xml
View File

@ -32,17 +32,10 @@
<dependency> <dependency>
<groupId>io.papermc.paper</groupId> <groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version> <version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.6</version>
<scope>compile</scope>
</dependency>
<!-- UTILITIES --> <!-- UTILITIES -->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
@ -54,14 +47,14 @@
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20210307</version> <version>20211205</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.8.0</version> <version>2.11.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -76,13 +69,13 @@
<dependency> <dependency>
<groupId>dev.morphia.morphia</groupId> <groupId>dev.morphia.morphia</groupId>
<artifactId>morphia-core</artifactId> <artifactId>morphia-core</artifactId>
<version>2.2.2</version> <version>2.2.3</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>3.6.3</version> <version>4.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -106,8 +99,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version> <version>3.8.1</version>
<configuration> <configuration>
<source>16</source> <source>17</source>
<target>16</target> <target>17</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@ -1,7 +1,5 @@
package dev.plex; package dev.plex;
import lombok.Getter;
import lombok.Setter;
import dev.plex.admin.AdminList; import dev.plex.admin.AdminList;
import dev.plex.banning.BanManager; import dev.plex.banning.BanManager;
import dev.plex.cache.MongoPlayerData; import dev.plex.cache.MongoPlayerData;
@ -19,6 +17,8 @@ import dev.plex.storage.StorageType;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import dev.plex.world.CustomWorld; import dev.plex.world.CustomWorld;
import lombok.Getter;
import lombok.Setter;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@Getter @Getter

View File

@ -1,10 +1,11 @@
package dev.plex.admin; package dev.plex.admin;
import java.util.UUID; import dev.plex.rank.enums.Rank;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import dev.plex.rank.enums.Rank;
import java.util.UUID;
@Getter @Getter
@Setter @Setter

View File

@ -6,7 +6,9 @@ import dev.morphia.Datastore;
import dev.morphia.query.Query; import dev.morphia.query.Query;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.storage.StorageType; import dev.plex.storage.StorageType;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -14,7 +16,6 @@ import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import dev.plex.rank.enums.Rank;
public class AdminList public class AdminList
{ {
@ -31,7 +32,6 @@ public class AdminList
admins.remove(uuid); admins.remove(uuid);
} }
public List<String> getAllAdmins() public List<String> getAllAdmins()
{ {
List<String> admins = Lists.newArrayList(); List<String> admins = Lists.newArrayList();

View File

@ -3,9 +3,10 @@ package dev.plex.cache;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.storage.StorageType; import dev.plex.storage.StorageType;
import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.UUID;
public class DataUtils public class DataUtils
{ {
/* PLEX PLAYER METHODS */ /* PLEX PLAYER METHODS */

View File

@ -7,6 +7,7 @@ import dev.morphia.query.experimental.filters.Filters;
import dev.morphia.query.experimental.updates.UpdateOperators; import dev.morphia.query.experimental.updates.UpdateOperators;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import java.util.UUID; import java.util.UUID;
public class MongoPlayerData public class MongoPlayerData

View File

@ -3,6 +3,7 @@ package dev.plex.cache;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.player.PunishedPlayer; import dev.plex.player.PunishedPlayer;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;

View File

@ -4,6 +4,7 @@ import com.google.common.reflect.TypeToken;
import com.google.gson.Gson; import com.google.gson.Gson;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;

View File

@ -1,6 +1,7 @@
package dev.plex.command; package dev.plex.command;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import java.util.List; import java.util.List;
public interface IPlexCommand public interface IPlexCommand

View File

@ -2,6 +2,8 @@ package dev.plex.command;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.cache.DataUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException; import dev.plex.command.exception.CommandArgumentException;
@ -9,24 +11,19 @@ import dev.plex.command.exception.CommandFailException;
import dev.plex.command.exception.PlayerNotFoundException; import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import dev.plex.cache.DataUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.*;
import org.bukkit.command.CommandMap;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public abstract class PlexCommand extends Command implements TabExecutor, IPlexCommand public abstract class PlexCommand extends Command implements TabExecutor, IPlexCommand
{ {
protected static Plex plugin = Plex.get(); protected static Plex plugin = Plex.get();
@ -55,7 +52,7 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC
this.level = perms.level(); this.level = perms.level();
this.commandSource = perms.source(); this.commandSource = perms.source();
getMap().register("", this); getMap().register("plex", this);
} }

View File

@ -1,9 +1,10 @@
package dev.plex.command.annotation; package dev.plex.command.annotation;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface CommandPermissions public @interface CommandPermissions

View File

@ -1,17 +1,14 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.cache.DataUtils;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.ConsoleOnlyException; import dev.plex.command.exception.ConsoleOnlyException;
import dev.plex.command.exception.PlayerNotFoundException; import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import dev.plex.cache.DataUtils;
import dev.plex.command.PlexCommand;
import dev.plex.event.AdminAddEvent; import dev.plex.event.AdminAddEvent;
import dev.plex.event.AdminRemoveEvent; import dev.plex.event.AdminRemoveEvent;
import dev.plex.event.AdminSetRankEvent; import dev.plex.event.AdminSetRankEvent;
@ -21,6 +18,10 @@ import dev.plex.util.PlexUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.SENIOR_ADMIN, source = RequiredCommandSource.ANY)
@CommandParameters(usage = "/<command> <add | remove | setrank | list> [player] [rank]", aliases = "saconfig,slconfig,adminconfig,adminmanage", description = "Manage all admins") @CommandParameters(usage = "/<command> <add | remove | setrank | list> [player] [rank]", aliases = "saconfig,slconfig,adminconfig,adminmanage", description = "Manage all admins")
public class AdminCMD extends PlexCommand public class AdminCMD extends PlexCommand
@ -51,6 +52,7 @@ public class AdminCMD extends PlexCommand
if (!sender.isConsoleSender()) if (!sender.isConsoleSender())
{ {
sender.send(tl("consoleOnly"));
throw new ConsoleOnlyException(); throw new ConsoleOnlyException();
} }
@ -165,7 +167,6 @@ public class AdminCMD extends PlexCommand
} }
sender.send("Admins: " + StringUtils.join(plugin.getAdminList().getAllAdmins(), ", ")); sender.send("Admins: " + StringUtils.join(plugin.getAdminList().getAllAdmins(), ", "));
return;
} }
} }

View File

@ -1,24 +1,17 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import io.papermc.lib.PaperLib; import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME) @CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME)
@CommandParameters(aliases = "aw", description = "Teleport to the adminworld") @CommandParameters(aliases = "aw", description = "Teleport to the adminworld")
public class AdminworldCMD extends PlexCommand public class AdminworldCMD extends PlexCommand
@ -35,7 +28,7 @@ public class AdminworldCMD extends PlexCommand
if (args.length == 0) if (args.length == 0)
{ {
Location loc = new Location(Bukkit.getWorld("adminworld"), 0, 50, 0); Location loc = new Location(Bukkit.getWorld("adminworld"), 0, 50, 0);
PaperLib.teleportAsync(sender.getPlayer(), loc); sender.getPlayer().teleportAsync(loc);
send(tl("teleportedToWorld", "adminworld")); send(tl("teleportedToWorld", "adminworld"));
} }
} }

View File

@ -1,20 +1,20 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException; import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "gma", description = "Set your own or another player's gamemode to adventure mode") @CommandParameters(aliases = "gma", description = "Set your own or another player's gamemode to adventure mode")
public class AdventureCMD extends PlexCommand public class AdventureCMD extends PlexCommand

View File

@ -1,18 +1,18 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.cache.DataUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.PlayerNotFoundException; import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import dev.plex.punishment.Punishment;
import dev.plex.punishment.PunishmentType;
import dev.plex.cache.DataUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.player.PunishedPlayer; import dev.plex.player.PunishedPlayer;
import dev.plex.punishment.Punishment;
import dev.plex.punishment.PunishmentType;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;

View File

@ -1,20 +1,20 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException; import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "gmc", description = "Set your own or another player's gamemode to creative mode") @CommandParameters(aliases = "gmc", description = "Set your own or another player's gamemode to creative mode")
public class CreativeCMD extends PlexCommand public class CreativeCMD extends PlexCommand

View File

@ -1,33 +1,26 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException; import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.exception.CommandFailException; import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import dev.plex.world.BlockMapChunkGenerator; import dev.plex.world.BlockMapChunkGenerator;
import dev.plex.world.CustomWorld; import dev.plex.world.CustomWorld;
import org.bukkit.Bukkit; import org.bukkit.*;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Enderman; import org.bukkit.entity.Enderman;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Strider; import org.bukkit.entity.Strider;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import java.util.*;
@CommandParameters(description = "Subliminal message.") @CommandParameters(description = "Subliminal message.")
@CommandPermissions(source = RequiredCommandSource.IN_GAME) @CommandPermissions(source = RequiredCommandSource.IN_GAME)
public class FionnCMD extends PlexCommand public class FionnCMD extends PlexCommand

View File

@ -1,24 +1,17 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import io.papermc.lib.PaperLib; import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME) @CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME)
@CommandParameters(description = "Teleport to the flatlands") @CommandParameters(description = "Teleport to the flatlands")
public class FlatlandsCMD extends PlexCommand public class FlatlandsCMD extends PlexCommand
@ -34,7 +27,7 @@ public class FlatlandsCMD extends PlexCommand
if (args.length == 0) if (args.length == 0)
{ {
Location loc = new Location(Bukkit.getWorld("flatlands"), 0, 50, 0); Location loc = new Location(Bukkit.getWorld("flatlands"), 0, 50, 0);
PaperLib.teleportAsync(sender.getPlayer(), loc); sender.getPlayer().teleportAsync(loc);
send(tl("teleportedToWorld", "flatlands")); send(tl("teleportedToWorld", "flatlands"));
} }
} }

View File

@ -1,25 +1,24 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException; import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.player.PunishedPlayer;
import dev.plex.punishment.Punishment; import dev.plex.punishment.Punishment;
import dev.plex.punishment.PunishmentType; import dev.plex.punishment.PunishmentType;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player;
import java.time.Instant; import java.time.Instant;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.player.PunishedPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player;
@CommandParameters(description = "Freeze a player on the server", usage = "/<command> <player>") @CommandParameters(description = "Freeze a player on the server", usage = "/<command> <player>")
@CommandPermissions(level = Rank.ADMIN) @CommandPermissions(level = Rank.ADMIN)
public class FreezeCMD extends PlexCommand public class FreezeCMD extends PlexCommand

View File

@ -1,24 +1,17 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import io.papermc.lib.PaperLib; import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME) @CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.IN_GAME)
@CommandParameters(aliases = "mbw", description = "Teleport to the Master Builder world") @CommandParameters(aliases = "mbw", description = "Teleport to the Master Builder world")
public class MasterbuilderworldCMD extends PlexCommand public class MasterbuilderworldCMD extends PlexCommand
@ -35,7 +28,7 @@ public class MasterbuilderworldCMD extends PlexCommand
if (args.length == 0) if (args.length == 0)
{ {
Location loc = new Location(Bukkit.getWorld("masterbuilderworld"), 0, 50, 0); Location loc = new Location(Bukkit.getWorld("masterbuilderworld"), 0, 50, 0);
PaperLib.teleportAsync(sender.getPlayer(), loc); sender.getPlayer().teleportAsync(loc);
send(tl("teleportedToWorld", "Master Builder world")); send(tl("teleportedToWorld", "Master Builder world"));
} }
} }

View File

@ -1,21 +1,22 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException; import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.List;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.json.simple.JSONArray; import org.json.simple.JSONArray;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException; import org.json.simple.parser.ParseException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.List;
@CommandParameters(description = "Get the name history of a player", usage = "/<command> <player>", aliases = "nh") @CommandParameters(description = "Get the name history of a player", usage = "/<command> <player>", aliases = "nh")
@CommandPermissions(level = Rank.OP) @CommandPermissions(level = Rank.OP)
public class NameHistoryCMD extends PlexCommand public class NameHistoryCMD extends PlexCommand

View File

@ -1,16 +1,17 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import java.util.List;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List;
@CommandParameters(description = "Op everyone on the server", aliases = "opa") @CommandParameters(description = "Op everyone on the server", aliases = "opa")
@CommandPermissions(level = Rank.ADMIN) @CommandPermissions(level = Rank.ADMIN)
public class OpAllCMD extends PlexCommand public class OpAllCMD extends PlexCommand

View File

@ -1,16 +1,17 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException; import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import java.util.List;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List;
@CommandParameters(description = "Op a player on the server", usage = "/<command> <player>") @CommandParameters(description = "Op a player on the server", usage = "/<command> <player>")
@CommandPermissions(level = Rank.OP) @CommandPermissions(level = Rank.OP)
public class OpCMD extends PlexCommand public class OpCMD extends PlexCommand

View File

@ -1,35 +1,53 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import java.util.Arrays;
import java.util.List;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "plexhelp", description = "Help with plex") @CommandParameters(usage = "/<command> [reload]", aliases = "plexhelp", description = "Show information about Plex or reload it")
public class PlexCMD extends PlexCommand public class PlexCMD extends PlexCommand {
{ public PlexCMD() {
public PlexCMD()
{
super("plex"); super("plex");
} }
@Override @Override
public void execute(CommandSource sender, String[] args) public void execute(CommandSource sender, String[] args) {
{ if (args.length == 0) {
send(ChatColor.LIGHT_PURPLE + "Plex. The long awaited TotalFreedomMod rewrite starts here..."); send(ChatColor.LIGHT_PURPLE + "Plex. The long awaited TotalFreedomMod rewrite starts here...");
send(ChatColor.LIGHT_PURPLE + "Plugin version: " + ChatColor.GOLD + "1.0"); send(ChatColor.LIGHT_PURPLE + "Plugin version: " + ChatColor.GOLD + "1.0");
return;
}
if (args[0].equals("reload"))
{
if (!plugin.getRankManager().isSeniorAdmin(sender.getPlexPlayer()))
{
send(tl("noPermission"));
return;
}
Plex.get().config.load();
send("Reloaded config file");
Plex.get().messages.load();
send("Reloaded messages file");
Plex.get().getRankManager().importDefaultRanks();
send("Imported ranks");
send("Plex successfully reloaded.");
} else {
throw new CommandArgumentException();
}
} }
@Override @Override
public List<String> onTabComplete(CommandSource sender, String[] args) public List<String> onTabComplete(CommandSource sender, String[] args) {
{ return List.of("reload");
return Arrays.asList("Telesphoreo", "super", "Taahh");
} }
} }

View File

@ -1,11 +1,11 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import dev.plex.command.PlexCommand;
import dev.plex.menu.PunishmentMenu; import dev.plex.menu.PunishmentMenu;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;

View File

@ -0,0 +1,30 @@
package dev.plex.command.impl;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import java.util.List;
// TODO: See ranks of other players
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.IN_GAME)
@CommandParameters(description = "Displays your rank")
public class RankCMD extends PlexCommand {
public RankCMD() {
super("rank");
}
@Override
public void execute(CommandSource sender, String[] args) {
send(tl("yourRank", sender.getPlexPlayer().getRank()));
}
@Override
public List<String> onTabComplete(CommandSource sender, String[] args) {
return null;
}
}

View File

@ -1,20 +1,20 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException; import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List;
@CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.ADMIN, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "gmsp", description = "Set your own or another player's gamemode to spectator mode") @CommandParameters(aliases = "gmsp", description = "Set your own or another player's gamemode to spectator mode")
public class SpectatorCMD extends PlexCommand public class SpectatorCMD extends PlexCommand

View File

@ -1,20 +1,20 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException; import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.List;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "gms", description = "Set your own or another player's gamemode to survival mode") @CommandParameters(aliases = "gms", description = "Set your own or another player's gamemode to survival mode")
public class SurvivalCMD extends PlexCommand public class SurvivalCMD extends PlexCommand

View File

@ -1,14 +1,15 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "tst,tast", description = "HELLO") @CommandParameters(aliases = "tst,tast", description = "HELLO")

View File

@ -1,19 +1,20 @@
package dev.plex.command.impl; package dev.plex.command.impl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException; import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource; import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource; import dev.plex.command.source.RequiredCommandSource;
import java.util.ArrayList;
import java.util.List;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import java.util.ArrayList;
import java.util.List;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.IN_GAME) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.IN_GAME)
@CommandParameters(description = "Teleport to a world.", usage = "/<command> <world>") @CommandParameters(description = "Teleport to a world.", usage = "/<command> <world>")
public class WorldCMD extends PlexCommand public class WorldCMD extends PlexCommand

View File

@ -1,8 +1,8 @@
package dev.plex.command.source; package dev.plex.command.source;
import lombok.Getter;
import dev.plex.cache.PlayerCache; import dev.plex.cache.PlayerCache;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import lombok.Getter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -1,9 +1,10 @@
package dev.plex.config; package dev.plex.config;
import dev.plex.Plex; import dev.plex.Plex;
import java.io.File;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
public class Config extends YamlConfiguration public class Config extends YamlConfiguration
{ {
private Plex plugin; private Plex plugin;

View File

@ -1,13 +1,14 @@
package dev.plex.event; package dev.plex.event;
import dev.plex.player.PunishedPlayer; import dev.plex.player.PunishedPlayer;
import java.util.UUID;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.player.PlayerEvent; import org.bukkit.event.player.PlayerEvent;
import java.util.UUID;
@Getter @Getter
public abstract class PunishedPlayerEvent extends PlayerEvent implements Cancellable public abstract class PunishedPlayerEvent extends PlayerEvent implements Cancellable
{ {

View File

@ -1,51 +1,36 @@
package dev.plex.handlers; package dev.plex.handlers;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.plex.command.impl.AdminCMD;
import dev.plex.command.impl.AdminworldCMD;
import dev.plex.command.impl.AdventureCMD;
import dev.plex.command.impl.BanCMD;
import dev.plex.command.impl.CreativeCMD;
import dev.plex.command.impl.FionnCMD;
import dev.plex.command.impl.FlatlandsCMD;
import dev.plex.command.impl.FreezeCMD;
import dev.plex.command.impl.MasterbuilderworldCMD;
import dev.plex.command.impl.NameHistoryCMD;
import dev.plex.command.impl.OpAllCMD;
import dev.plex.command.impl.OpCMD;
import dev.plex.command.impl.PlexCMD;
import dev.plex.command.impl.PunishmentsCMD;
import dev.plex.command.impl.SpectatorCMD;
import dev.plex.command.impl.SurvivalCMD;
import dev.plex.command.impl.TestCMD;
import dev.plex.command.impl.WorldCMD;
import java.util.List;
import dev.plex.command.PlexCommand; import dev.plex.command.PlexCommand;
import dev.plex.command.impl.*;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import java.util.List;
public class CommandHandler public class CommandHandler
{ {
public CommandHandler() public CommandHandler()
{ {
List<PlexCommand> commands = Lists.newArrayList(); List<PlexCommand> commands = Lists.newArrayList();
commands.add(new TestCMD()); commands.add(new AdminCMD());
commands.add(new PlexCMD()); commands.add(new AdminworldCMD());
commands.add(new AdventureCMD());
commands.add(new BanCMD());
commands.add(new CreativeCMD());
commands.add(new FionnCMD()); commands.add(new FionnCMD());
commands.add(new WorldCMD()); commands.add(new FlatlandsCMD());
commands.add(new FreezeCMD());
commands.add(new MasterbuilderworldCMD());
commands.add(new NameHistoryCMD());
commands.add(new OpAllCMD()); commands.add(new OpAllCMD());
commands.add(new OpCMD()); commands.add(new OpCMD());
commands.add(new FreezeCMD()); commands.add(new PlexCMD());
commands.add(new NameHistoryCMD());
commands.add(new AdminCMD());
commands.add(new AdventureCMD());
commands.add(new CreativeCMD());
commands.add(new SurvivalCMD());
commands.add(new SpectatorCMD());
commands.add(new BanCMD());
commands.add(new PunishmentsCMD()); commands.add(new PunishmentsCMD());
commands.add(new FlatlandsCMD()); commands.add(new RankCMD());
commands.add(new AdminworldCMD()); commands.add(new SpectatorCMD());
commands.add(new MasterbuilderworldCMD()); commands.add(new SurvivalCMD());
commands.add(new TestCMD());
commands.add(new WorldCMD());
PlexLog.log(String.format("Registered %s commands!", commands.size())); PlexLog.log(String.format("Registered %s commands!", commands.size()));
} }
} }

View File

@ -1,17 +1,12 @@
package dev.plex.handlers; package dev.plex.handlers;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.plex.listener.impl.AdminListener;
import dev.plex.listener.impl.ChatListener;
import dev.plex.listener.impl.FreezeListener;
import dev.plex.listener.impl.LoginListener;
import dev.plex.listener.impl.PlayerListener;
import dev.plex.listener.impl.ServerListener;
import dev.plex.listener.impl.WorldListener;
import java.util.List;
import dev.plex.listener.PlexListener; import dev.plex.listener.PlexListener;
import dev.plex.listener.impl.*;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import java.util.List;
public class ListenerHandler public class ListenerHandler
{ {
public ListenerHandler() public ListenerHandler()

View File

@ -6,11 +6,11 @@ import dev.plex.event.AdminSetRankEvent;
import dev.plex.listener.PlexListener; import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import static dev.plex.util.PlexUtils.tl;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import static dev.plex.util.PlexUtils.tl;
public class AdminListener extends PlexListener public class AdminListener extends PlexListener
{ {
@EventHandler @EventHandler

View File

@ -12,7 +12,7 @@ public class LoginListener extends PlexListener
@EventHandler @EventHandler
public void onPreLogin(AsyncPlayerPreLoginEvent event) public void onPreLogin(AsyncPlayerPreLoginEvent event)
{ {
PlexLog.log(String.valueOf(plugin.getBanManager().isBanned(event.getUniqueId()))); // PlexLog.log(String.valueOf(plugin.getBanManager().isBanned(event.getUniqueId())));
if (plugin.getBanManager().isBanned(event.getUniqueId())) if (plugin.getBanManager().isBanned(event.getUniqueId()))
{ {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "§cYou're currently banned from this server.\n§cPlease appeal at §6https://forum.telesphoreo.me"); event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "§cYou're currently banned from this server.\n§cPlease appeal at §6https://forum.telesphoreo.me");

View File

@ -1,7 +1,5 @@
package dev.plex.listener.impl; package dev.plex.listener.impl;
import java.util.Arrays;
import java.util.UUID;
import dev.plex.admin.Admin; import dev.plex.admin.Admin;
import dev.plex.cache.DataUtils; import dev.plex.cache.DataUtils;
import dev.plex.cache.MongoPlayerData; import dev.plex.cache.MongoPlayerData;
@ -20,6 +18,9 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import java.util.Arrays;
import java.util.UUID;
public class PlayerListener extends PlexListener public class PlayerListener extends PlexListener
{ {
private final MongoPlayerData mongoPlayerData = plugin.getMongoPlayerData() != null ? plugin.getMongoPlayerData() : null; private final MongoPlayerData mongoPlayerData = plugin.getMongoPlayerData() != null ? plugin.getMongoPlayerData() : null;
@ -35,7 +36,7 @@ public class PlayerListener extends PlexListener
if (!DataUtils.hasPlayedBefore(player.getUniqueId())) if (!DataUtils.hasPlayedBefore(player.getUniqueId()))
{ {
PlexLog.log("AYO THIS MAN DONT EXIST"); // funi msg PlexLog.log("A player with this name has not joined the server before, creating new entry."); // funi msg
plexPlayer = new PlexPlayer(player.getUniqueId()); //it doesn't! okay so now create the object plexPlayer = new PlexPlayer(player.getUniqueId()); //it doesn't! okay so now create the object
plexPlayer.setName(player.getName()); //set the name of the player plexPlayer.setName(player.getName()); //set the name of the player
plexPlayer.setIps(Arrays.asList(player.getAddress().getAddress().getHostAddress().trim())); //set the arraylist of ips plexPlayer.setIps(Arrays.asList(player.getAddress().getAddress().getHostAddress().trim())); //set the arraylist of ips

View File

@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent; import org.bukkit.event.entity.EntitySpawnEvent;
import static dev.plex.util.PlexUtils.tl; import static dev.plex.util.PlexUtils.tl;
public class WorldListener extends PlexListener public class WorldListener extends PlexListener

View File

@ -4,16 +4,17 @@ import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id; import dev.morphia.annotations.Id;
import dev.morphia.annotations.IndexOptions; import dev.morphia.annotations.IndexOptions;
import dev.morphia.annotations.Indexed; import dev.morphia.annotations.Indexed;
import java.util.ArrayList; import dev.plex.rank.enums.Rank;
import java.util.List;
import java.util.UUID;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
@Getter @Getter
@Setter @Setter
@Entity(value = "players", useDiscriminator = false) @Entity(value = "players", useDiscriminator = false)

View File

@ -1,7 +1,18 @@
package dev.plex.player; package dev.plex.player;
import com.google.common.collect.Lists;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.event.PunishedPlayerFreezeEvent;
import dev.plex.event.PunishedPlayerMuteEvent;
import dev.plex.punishment.Punishment; import dev.plex.punishment.Punishment;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.io.FileUtils;
import org.bukkit.Bukkit;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -10,17 +21,6 @@ import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import com.google.common.collect.Lists;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import dev.plex.event.PunishedPlayerFreezeEvent;
import dev.plex.event.PunishedPlayerMuteEvent;
import org.apache.commons.io.FileUtils;
import org.bukkit.Bukkit;
import org.json.JSONObject;
import org.json.JSONTokener;
@Getter @Getter
public class PunishedPlayer public class PunishedPlayer
{ {

View File

@ -2,9 +2,10 @@ package dev.plex.rank;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import java.util.List;
import lombok.Getter; import lombok.Getter;
import java.util.List;
@Getter @Getter
public class DefaultRankObj public class DefaultRankObj
{ {

View File

@ -3,16 +3,17 @@ package dev.plex.rank;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import dev.plex.rank.enums.Rank;
import org.json.JSONObject;
import org.json.JSONTokener;
public class RankManager public class RankManager
{ {
@ -99,4 +100,9 @@ public class RankManager
{ {
return !plexPlayer.getRank().isEmpty() && plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN); return !plexPlayer.getRank().isEmpty() && plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN);
} }
public boolean isSeniorAdmin(PlexPlayer plexPlayer)
{
return !plexPlayer.getRank().isEmpty() && plexPlayer.getRankFromString().isAtLeast(Rank.SENIOR_ADMIN);
}
} }

View File

@ -1,9 +1,10 @@
package dev.plex.rank.enums; package dev.plex.rank.enums;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.List;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import java.util.List;
public enum Rank public enum Rank
{ {
IMPOSTOR(-1, ChatColor.AQUA + "an " + ChatColor.YELLOW + "Impostor", ChatColor.YELLOW + "[Imp]"), IMPOSTOR(-1, ChatColor.AQUA + "an " + ChatColor.YELLOW + "Impostor", ChatColor.YELLOW + "[Imp]"),

View File

@ -2,14 +2,19 @@ package dev.plex.services;
public abstract class AbstractService implements IService public abstract class AbstractService implements IService
{ {
private boolean asynchronous; private boolean asynchronous;
private boolean repeating;
public AbstractService(boolean async) public AbstractService(boolean repeating, boolean async)
{ {
this.repeating = repeating;
this.asynchronous = async; this.asynchronous = async;
} }
public boolean isRepeating() {
return repeating;
}
public boolean isAsynchronous() { public boolean isAsynchronous() {
return asynchronous; return asynchronous;
} }

View File

@ -2,7 +2,6 @@ package dev.plex.services;
public interface IService public interface IService
{ {
void run(); void run();
int repeatInSeconds(); int repeatInSeconds();

View File

@ -3,42 +3,36 @@ package dev.plex.services;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.services.impl.BanService; import dev.plex.services.impl.BanService;
import dev.plex.services.impl.GameruleService;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.List; import java.util.List;
public class ServiceManager public class ServiceManager {
{
private final List<AbstractService> services = Lists.newArrayList(); private final List<AbstractService> services = Lists.newArrayList();
public ServiceManager() public ServiceManager() {
{
registerService(new BanService()); registerService(new BanService());
registerService(new GameruleService());
} }
public void startServices() public void startServices() {
{ for (AbstractService service : services) {
for (AbstractService service : services) if (!service.isRepeating()) {
{ Bukkit.getScheduler().runTask(Plex.get(), service::run);
if (service.isAsynchronous()) } else if (service.isRepeating() && service.isAsynchronous()) {
{
Bukkit.getScheduler().runTaskTimerAsynchronously(Plex.get(), service::run, 0, 20 * service.repeatInSeconds()); Bukkit.getScheduler().runTaskTimerAsynchronously(Plex.get(), service::run, 0, 20 * service.repeatInSeconds());
} else { } else if (service.isRepeating() && !service.isAsynchronous()) {
Bukkit.getScheduler().runTaskTimer(Plex.get(), service::run, 0, 20 * service.repeatInSeconds()); Bukkit.getScheduler().runTaskTimer(Plex.get(), service::run, 0, 20 * service.repeatInSeconds());
} }
} }
} }
private void registerService(AbstractService service) {
private void registerService(AbstractService service)
{
services.add(service); services.add(service);
} }
public int serviceCount() public int serviceCount() {
{
return services.size(); return services.size();
} }
} }

View File

@ -1,8 +1,8 @@
package dev.plex.services.impl; package dev.plex.services.impl;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.services.AbstractService;
import dev.plex.banning.Ban; import dev.plex.banning.Ban;
import dev.plex.services.AbstractService;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.Date; import java.util.Date;
@ -10,7 +10,7 @@ import java.util.Date;
public class BanService extends AbstractService public class BanService extends AbstractService
{ {
public BanService() { public BanService() {
super(true); super(true, true);
} }
@Override @Override

View File

@ -0,0 +1,92 @@
package dev.plex.services.impl;
import dev.plex.Plex;
import dev.plex.services.AbstractService;
import dev.plex.util.PlexLog;
import org.bukkit.Bukkit;
import org.bukkit.World;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
public class GameruleService extends AbstractService {
private final Map<GameRule, Boolean> rules = new EnumMap<>(GameRule.class);
public GameruleService() {
super(false, false);
}
public void setGameRule(GameRule gameRule, boolean value) {
setGameRule(gameRule, value, true);
}
public void setGameRule(GameRule gameRule, boolean value, boolean doCommit) {
rules.put(gameRule, value);
if (doCommit) {
commitGameRules();
}
}
@SuppressWarnings("deprecation")
public void commitGameRules() {
List<World> worlds = Bukkit.getWorlds();
for (Map.Entry<GameRule, Boolean> gameRuleEntry : rules.entrySet()) {
String gameRuleName = gameRuleEntry.getKey().getGameRuleName();
String gameRuleValue = gameRuleEntry.getValue().toString();
for (World world : worlds) {
world.setGameRuleValue(gameRuleName, gameRuleValue);
if (gameRuleEntry.getKey() == GameRule.DO_DAYLIGHT_CYCLE && !gameRuleEntry.getValue()) {
long time = world.getTime();
time -= time % 24000;
world.setTime(time + 24000 + 6000);
}
}
}
}
@Override
public void run() {
for (GameRule gameRule : GameRule.values()) {
rules.put(gameRule, gameRule.getDefaultValue());
PlexLog.log(gameRule.toString());
}
}
@Override
public int repeatInSeconds() {
return 0;
}
public enum GameRule {
DO_FIRE_TICK("doFireTick", true),
MOB_GRIEFING("mobGriefing", true),
KEEP_INVENTORY("keepInventory", true),
DO_MOB_SPAWNING("doMobSpawning", true),
DO_MOB_LOOT("doMobLoot", true),
DO_TILE_DROPS("doTileDrops", true),
COMMAND_BLOCK_OUTPUT("commandBlockOutput", true),
NATURAL_REGENERATION("naturalRegeneration", true),
DO_DAYLIGHT_CYCLE("doDaylightCycle", true),
ANNOUNCE_ADVANCEMENTS("announceAdvancements", true),
SHOW_DEATH_MESSAGES("showDeathMessages", true),
SEND_COMMAND_FEEDBACK("sendCommandFeedback", true);
private final String gameRuleName;
private final boolean defaultValue;
GameRule(String gameRuleName, boolean defaultValue) {
this.gameRuleName = gameRuleName;
this.defaultValue = defaultValue;
}
public String getGameRuleName() {
return gameRuleName;
}
public boolean getDefaultValue() {
return defaultValue;
}
}
}

View File

@ -2,6 +2,7 @@ package dev.plex.storage;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.PlexBase; import dev.plex.PlexBase;
import java.io.File; import java.io.File;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;

View File

@ -3,6 +3,15 @@ package dev.plex.util;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.config.Config; import dev.plex.config.Config;
import dev.plex.storage.StorageType; import dev.plex.storage.StorageType;
import org.bukkit.*;
import org.bukkit.command.Command;
import org.bukkit.command.PluginCommandYamlParser;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -12,18 +21,6 @@ import java.sql.SQLException;
import java.util.*; import java.util.*;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.PluginCommandYamlParser;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class PlexUtils public class PlexUtils
{ {

View File

@ -1,9 +1,10 @@
package dev.plex.world; package dev.plex.world;
import org.bukkit.Material;
import org.bukkit.generator.BlockPopulator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import org.bukkit.Material;
import org.bukkit.generator.BlockPopulator;
public class BlockMapChunkGenerator extends FlatChunkGenerator public class BlockMapChunkGenerator extends FlatChunkGenerator
{ {

View File

@ -1,10 +1,11 @@
package dev.plex.world; package dev.plex.world;
import dev.plex.Plex; import dev.plex.Plex;
import java.util.LinkedHashMap;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import java.util.LinkedHashMap;
public class ConfigurationChunkGenerator extends BlockMapChunkGenerator public class ConfigurationChunkGenerator extends BlockMapChunkGenerator
{ {
private static final Plex plugin = Plex.get(); private static final Plex plugin = Plex.get();

View File

@ -1,11 +1,12 @@
package dev.plex.world; package dev.plex.world;
import java.util.Arrays;
import java.util.List;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
import java.util.Arrays;
import java.util.List;
public abstract class CustomChunkGenerator extends ChunkGenerator public abstract class CustomChunkGenerator extends ChunkGenerator
{ {
protected int height; protected int height;

View File

@ -1,8 +1,6 @@
package dev.plex.world; package dev.plex.world;
import dev.plex.Plex; import dev.plex.Plex;
import java.io.File;
import java.util.Objects;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.WorldCreator; import org.bukkit.WorldCreator;
@ -11,6 +9,9 @@ import org.bukkit.block.BlockState;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
import java.io.File;
import java.util.Objects;
public class CustomWorld extends WorldCreator public class CustomWorld extends WorldCreator
{ {
private static final Plex plugin = Plex.get(); private static final Plex plugin = Plex.get();

View File

@ -1,9 +1,10 @@
package dev.plex.world; package dev.plex.world;
import java.util.Random;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import java.util.Random;
public abstract class FlatChunkGenerator extends CustomChunkGenerator public abstract class FlatChunkGenerator extends CustomChunkGenerator
{ {
public FlatChunkGenerator(int height, BlockPopulator... populators) public FlatChunkGenerator(int height, BlockPopulator... populators)

View File

@ -1,10 +1,11 @@
package dev.plex.world; package dev.plex.world;
import java.util.Random;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import org.bukkit.util.noise.PerlinNoiseGenerator; import org.bukkit.util.noise.PerlinNoiseGenerator;
import java.util.Random;
public abstract class NoiseChunkGenerator extends CustomChunkGenerator public abstract class NoiseChunkGenerator extends CustomChunkGenerator
{ {
private final NoiseOptions options; private final NoiseOptions options;

View File

@ -1,10 +1,11 @@
package dev.plex.world; package dev.plex.world;
import java.util.Random;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import org.bukkit.util.noise.PerlinOctaveGenerator; import org.bukkit.util.noise.PerlinOctaveGenerator;
import java.util.Random;
public abstract class OctaveChunkGenerator extends CustomChunkGenerator public abstract class OctaveChunkGenerator extends CustomChunkGenerator
{ {
private final OctaveOptions options; private final OctaveOptions options;

View File

@ -19,49 +19,50 @@ errorColor: "c"
# Broadcast color <b> - this will make the color of the message the broadcast color defined above. # Broadcast color <b> - this will make the color of the message the broadcast color defined above.
# Error color <e> - this will make the color of the message the error color defined above. # Error color <e> - this will make the color of the message the error color defined above.
test: this is a test message! test: "this is a test message!"
# 1: the command sender's username # 1: the command sender's username
variableTest: variable test with <v>! variableTest: "variable test with <v>!"
playerNotFound: Player not found! playerNotFound: "Player not found!"
worldNotFound: World not found! worldNotFound: "World not found!"
noAdminWorldBlockPlace: <e>You are not allowed to place blocks in the admin world! noAdminWorldBlockPlace: "<e>You are not allowed to place blocks in the admin world!"
noAdminWorldBlockBreak: <e>You are not allowed to break blocks in the admin world! noAdminWorldBlockBreak: "<e>You are not allowed to break blocks in the admin world!"
# 1: the world you have been teleported to # 1: the world you have been teleported to
playerWorldTeleport: You have been teleported to <v>. playerWorldTeleport: "You have been teleported to <v>."
# 1: the command sender who opped everyone # 1: the command sender who opped everyone
oppedAllPlayers: <b><v> - Opped all players on the server oppedAllPlayers: "<b><v> - Opped all players on the server"
# 1: the person who is opping # 1: the person who is opping
# 2: the person who has been opped # 2: the person who has been opped
oppedPlayer: <b><v> - Opped <v> oppedPlayer: "<b><v> - Opped <v>"
# 1: the person who is freezing # 1: the person who is freezing
# 2: the person who has been frozen # 2: the person who has been frozen
frozePlayer: <b><v> - Froze <v> frozePlayer: "<b><v> - Froze <v>"
# 1: the person who is unfreezing # 1: the person who is unfreezing
# 2: the person who has been unfrozen # 2: the person who has been unfrozen
unfrozePlayer: <b><v> - Unfroze <v> unfrozePlayer: "<b><v> - Unfroze <v>"
noPermission: <e>You cannot use this command! noPermission: "<e>You cannot use this command!"
# 1: the login message (uncolored) of the rank required to use the command # 1: the login message (uncolored) of the rank required to use the command
noPermissionRank: <e>You must be at least <v> rank to use this command! noPermissionRank: "<e>You must be at least <v> rank to use this command!"
noPermissionInGame: <e>You must be in console to use this command! noPermissionInGame: "<e>You must be in console to use this command!"
noPermissionConsole: <e>You must be in-game to use this command! noPermissionConsole: "<e>You must be in-game to use this command!"
# 1: the username of the name history # 1: the username of the name history
nameHistoryTitle: Name History of <v> nameHistoryTitle: "Name History of <v>"
# 1: a username of the found user # 1: a username of the found user
# 2: when the user changed to that username # 2: when the user changed to that username
nameHistoryBody: " - <v> (<v>)" nameHistoryBody: " - <v> (<v>)"
# 1: the username that failed # 1: the username that failed
nameHistoryFail: <e>Something went wrong while trying to retrieve name history of <v>! Try again later! nameHistoryFail: "<e>Something went wrong while trying to retrieve name history of <v>! Try again later!"
gameModeSetTo: Your gamemode has been set to <v>. gameModeSetTo: "Your gamemode has been set to <v>."
setOtherPlayerGameModeTo: You set <v>'s gamemode to <v>. setOtherPlayerGameModeTo: "You set <v>'s gamemode to <v>."
playerSetOtherGameMode: <v> set your gamemode to <v>. playerSetOtherGameMode: "<v> set your gamemode to <v>."
consoleMustDefinePlayer: You must define a player since you are running this command from console. consoleMustDefinePlayer: "You must define a player since you are running this command from console."
newAdminAdded: <b><v> - Adding <v> to the admin list newAdminAdded: "<b><v> - Adding <v> to the admin list"
adminRemoved: <c><v> - Removing <v> from the admin list adminRemoved: "<c><v> - Removing <v> from the admin list"
adminSetRank: <b><v> - Setting <v>'s rank to <v> adminSetRank: "<b><v> - Setting <v>'s rank to <v>"
teleportedToWorld: <b>You have been teleported to the <v>. teleportedToWorld: "<b>You have been teleported to the <v>."
higherRankThanYou: <b>This player is an admin and a higher rank than you. higherRankThanYou: "<b>This player is an admin and a higher rank than you."
playerNotAdmin: <b>That player is not an admin. playerNotAdmin: "<b>That player is not an admin."
playerIsAdmin: <b>That player is already an admin. playerIsAdmin: "<b>That player is already an admin."
rankNotFound: <b>The rank you entered was not found. rankNotFound: "<b>The rank you entered was not found."
rankMustBeHigherThanAdmin: <b>The rank you entered must be higher than Admin. rankMustBeHigherThanAdmin: "<b>The rank you entered must be higher than Admin."
consoleOnly: <b>This command can only be executed by the console. consoleOnly: "<b>This command can only be executed by the console."
yourRank: "<b>Your rank is: <v>"