api to T2CodeLib 16.7_dev-22
This commit is contained in:
parent
10e8994ab8
commit
56e704c7f0
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2C-OPSecurity</artifactId>
|
<artifactId>T2C-OPSecurity</artifactId>
|
||||||
<version>3.3_DEV-1</version>
|
<version>3.3_DEV-21</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>16.7</version>
|
<version>16.7</version>
|
||||||
<classifier>dev-11</classifier>
|
<classifier>dev-21</classifier>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -6,7 +6,7 @@ import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
|||||||
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
||||||
import net.t2code.opsecurity.objects.PlayerCache;
|
import net.t2code.opsecurity.objects.PlayerCache;
|
||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -16,7 +16,7 @@ import java.util.Map;
|
|||||||
public class T2COpSecAPI {
|
public class T2COpSecAPI {
|
||||||
public static boolean checkOPWhiteList(Player player) {
|
public static boolean checkOPWhiteList(Player player) {
|
||||||
if (!(boolean) OPWhitelist.VALUES.enable.getValue()) return true;
|
if (!(boolean) OPWhitelist.VALUES.enable.getValue()) return true;
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
return OpCheck.opWhitelist(player, debug);
|
return OpCheck.opWhitelist(player, debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@ import net.t2code.opsecurity.objects.PlayerCache;
|
|||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.opsecurity.system.BungeeSenderReceiver;
|
import net.t2code.opsecurity.system.BungeeSenderReceiver;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.commands.T2Ccmd;
|
import net.t2code.t2codelib.SPIGOT.api.commands.T2C_Cmd;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||||
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;
|
||||||
@ -23,7 +23,7 @@ public class OpCheck {
|
|||||||
if (!(boolean) OPWhitelist.VALUES.enable.getValue()) return false;
|
if (!(boolean) OPWhitelist.VALUES.enable.getValue()) return false;
|
||||||
if (!player.isOp()) return false;
|
if (!player.isOp()) return false;
|
||||||
if (opWhitelist(player, debug)) return false;
|
if (opWhitelist(player, debug)) return false;
|
||||||
if (join) T2Csend.console(Languages.VALUES.opWhitelistNotifyOnJoin.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
if (join) T2C_Send.console(Languages.VALUES.opWhitelistNotifyOnJoin.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
Bukkit.getScheduler().runTask(Main.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTask(Main.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -50,25 +50,25 @@ public class OpCheck {
|
|||||||
if ((boolean)OPWhitelist.VALUES.noOpPlayerKickEnable.getValue()) {
|
if ((boolean)OPWhitelist.VALUES.noOpPlayerKickEnable.getValue()) {
|
||||||
if (!(boolean)OPWhitelist.VALUES.customCommandsEnable.getValue()) {
|
if (!(boolean)OPWhitelist.VALUES.customCommandsEnable.getValue()) {
|
||||||
if ((boolean) Config.VALUES.kickCustomCommand.getValue()) {
|
if ((boolean) Config.VALUES.kickCustomCommand.getValue()) {
|
||||||
T2Ccmd.console( Config.VALUES.kickCommand.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[reason]",
|
T2C_Cmd.console( Config.VALUES.kickCommand.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[reason]",
|
||||||
(boolean)OPWhitelist.VALUES.noOpPlayerKickEnable.getValue() && (boolean)OPWhitelist.VALUES.noOpPlayerDeopEnable.getValue() && (boolean)OPWhitelist.VALUES.noOpPlayerDeopPlayerSendMessage.getValue()
|
(boolean)OPWhitelist.VALUES.noOpPlayerKickEnable.getValue() && (boolean)OPWhitelist.VALUES.noOpPlayerDeopEnable.getValue() && (boolean)OPWhitelist.VALUES.noOpPlayerDeopPlayerSendMessage.getValue()
|
||||||
? Languages.VALUES.opWhitelistKick.getValue().toString() + "<br> <br>" + Languages.VALUES.opWhitelistDeop.getValue().toString() : Languages.VALUES.opWhitelistKick.getValue().toString()));
|
? Languages.VALUES.opWhitelistKick.getValue().toString() + "<br> <br>" + Languages.VALUES.opWhitelistDeop.getValue().toString() : Languages.VALUES.opWhitelistKick.getValue().toString()));
|
||||||
} else player.kickPlayer((boolean)OPWhitelist.VALUES.noOpPlayerDeopEnable.getValue() && (boolean)OPWhitelist.VALUES.noOpPlayerDeopPlayerSendMessage.getValue()
|
} else player.kickPlayer((boolean)OPWhitelist.VALUES.noOpPlayerDeopEnable.getValue() && (boolean)OPWhitelist.VALUES.noOpPlayerDeopPlayerSendMessage.getValue()
|
||||||
? Languages.VALUES.opWhitelistKick.getValue() + "\n \n" + Languages.VALUES.opWhitelistDeop.getValue() : Languages.VALUES.opWhitelistKick.getValue().toString());
|
? Languages.VALUES.opWhitelistKick.getValue() + "\n \n" + Languages.VALUES.opWhitelistDeop.getValue() : Languages.VALUES.opWhitelistKick.getValue().toString());
|
||||||
}
|
}
|
||||||
T2Csend.console("["+debug+ "]" + Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())) + "<br>"
|
T2C_Send.console("["+debug+ "]" + Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())) + "<br>"
|
||||||
+ Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
+ Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
Events.notifyPlayer(Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()) + "<br>"
|
Events.notifyPlayer(Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()) + "<br>"
|
||||||
+ Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
+ Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
} else {
|
} else {
|
||||||
T2Csend.console("["+debug+ "]" + Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
T2C_Send.console("["+debug+ "]" + Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
Events.notifyPlayer(Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
Events.notifyPlayer(Languages.VALUES.opWhitelistNotifyDeop.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
|
|
||||||
if ((boolean)OPWhitelist.VALUES.noOpPlayerDeopPlayerSendMessage.getValue()) {
|
if ((boolean)OPWhitelist.VALUES.noOpPlayerDeopPlayerSendMessage.getValue()) {
|
||||||
Bukkit.getScheduler().runTaskLater(Main.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTaskLater(Main.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
T2Csend.player(player, Languages.VALUES.opWhitelistDeop.getValue().toString());
|
T2C_Send.player(player, Languages.VALUES.opWhitelistDeop.getValue().toString());
|
||||||
}
|
}
|
||||||
}, 5L);
|
}, 5L);
|
||||||
}
|
}
|
||||||
@ -78,32 +78,32 @@ public class OpCheck {
|
|||||||
if (!(boolean)OPWhitelist.VALUES.noOpPlayerDeopEnable.getValue()) {
|
if (!(boolean)OPWhitelist.VALUES.noOpPlayerDeopEnable.getValue()) {
|
||||||
if (!(boolean)OPWhitelist.VALUES.customCommandsEnable.getValue()) {
|
if (!(boolean)OPWhitelist.VALUES.customCommandsEnable.getValue()) {
|
||||||
if ((boolean)Config.VALUES.kickCustomCommand.getValue()) {
|
if ((boolean)Config.VALUES.kickCustomCommand.getValue()) {
|
||||||
T2Ccmd.console(Config.VALUES.kickCommand.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[reason]", Languages.VALUES.opWhitelistKick.getValue().toString()));
|
T2C_Cmd.console(Config.VALUES.kickCommand.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[reason]", Languages.VALUES.opWhitelistKick.getValue().toString()));
|
||||||
} else player.kickPlayer(Languages.VALUES.opWhitelistKick.getValue().toString());
|
} else player.kickPlayer(Languages.VALUES.opWhitelistKick.getValue().toString());
|
||||||
}
|
}
|
||||||
T2Csend.console("["+debug+ "]" + Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
T2C_Send.console("["+debug+ "]" + Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
Events.notifyPlayer(Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
Events.notifyPlayer(Languages.VALUES.opWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((boolean)OPWhitelist.VALUES.customCommandsEnable.getValue()) {
|
if ((boolean)OPWhitelist.VALUES.customCommandsEnable.getValue()) {
|
||||||
for (String cmd : (List<String>)OPWhitelist.VALUES.customCommandsCommands.getValue()) {
|
for (String cmd : (List<String>)OPWhitelist.VALUES.customCommandsCommands.getValue()) {
|
||||||
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()));
|
T2C_Cmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean opWhitelist(Player player, String debug) {
|
public static Boolean opWhitelist(Player player, String debug) {
|
||||||
for (Map.Entry<String, PlayerObject> playerObject : PlayerCache.getOpHashMap().entrySet()) {
|
for (Map.Entry<String, PlayerObject> playerObject : PlayerCache.getOpHashMap().entrySet()) {
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] --------- " + player.getName()+" ---------");
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] --------- " + player.getName()+" ---------");
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist playerObject Name: " + playerObject.getValue().playerName);
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist playerObject Name: " + playerObject.getValue().playerName);
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist Player Name: " + player.getName());
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist Player Name: " + player.getName());
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist playerObject UUID: " + playerObject.getValue().uuid);
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist playerObject UUID: " + playerObject.getValue().uuid);
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist Player UUID: " + player.getUniqueId().toString().replace("-", ""));
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist Player UUID: " + player.getUniqueId().toString().replace("-", ""));
|
||||||
if (playerObject.getValue().playerName.equals(player.getName()) && playerObject.getValue().uuid.equals(player.getUniqueId().toString().replace("-", ""))) {
|
if (playerObject.getValue().playerName.equals(player.getName()) && playerObject.getValue().uuid.equals(player.getUniqueId().toString().replace("-", ""))) {
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist Player on list!");
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] opWhitelist Player on list!");
|
||||||
T2Cdebug.debug(Main.getPlugin(),"");
|
T2C_Debug.debug(Main.getPlugin(),"");
|
||||||
return true;
|
return true;
|
||||||
} else T2Cdebug.debug(Main.getPlugin(),"");
|
} else T2C_Debug.debug(Main.getPlugin(),"");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,9 @@ import net.t2code.opsecurity.objects.PlayerCache;
|
|||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.opsecurity.system.BungeeSenderReceiver;
|
import net.t2code.opsecurity.system.BungeeSenderReceiver;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.commands.T2Ccmd;
|
import net.t2code.t2codelib.SPIGOT.api.commands.T2C_Cmd;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -19,9 +19,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class PermissionCheck {
|
public class PermissionCheck {
|
||||||
public static Boolean onCheck(Player player, Boolean join, String debug) {
|
public static Boolean onCheck(Player player, Boolean join, String debug) {
|
||||||
|
if (!(boolean) PermissionWhitelist.VALUES.enable.getValue()) return false;
|
||||||
for (String perm : (List<String>) PermissionWhitelist.VALUES.permissions.getValue()) {
|
for (String perm : (List<String>) PermissionWhitelist.VALUES.permissions.getValue()) {
|
||||||
if (!player.hasPermission(perm)) return false;
|
if (!player.hasPermission(perm)) return false;
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] check Permission: " + perm);
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] check Permission: " + perm);
|
||||||
if (permWhitelist(player, debug)) return false;
|
if (permWhitelist(player, debug)) return false;
|
||||||
Bukkit.getScheduler().runTask(Main.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTask(Main.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -36,24 +37,24 @@ public class PermissionCheck {
|
|||||||
|
|
||||||
private static void execute(Player player, Boolean join, String perm, String debug) {
|
private static void execute(Player player, Boolean join, String perm, String debug) {
|
||||||
if (join)
|
if (join)
|
||||||
T2Csend.console("[" + debug + "]" + Languages.VALUES.permissionWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
T2C_Send.console("[" + debug + "]" + Languages.VALUES.permissionWhitelistNotifyKick.getValue().toString().replace("[player]", player.getName()).replace("%player_name%", player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
if ((boolean) Config.VALUES.notifyJoinWarning.getValue() && join) {
|
if ((boolean) Config.VALUES.notifyJoinWarning.getValue() && join) {
|
||||||
if ((boolean) Config.VALUES.notifyBungee.getValue()) {
|
if ((boolean) Config.VALUES.notifyBungee.getValue()) {
|
||||||
BungeeSenderReceiver.sendToBungee(Languages.VALUES.permissionWhitelistNotifyOnJoin.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
BungeeSenderReceiver.sendToBungee(Languages.VALUES.permissionWhitelistNotifyOnJoin.getValue().toString().replace("[player]", player.getName()).replace("%player_name%", player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
} else
|
} else
|
||||||
Events.notifyPlayer(Languages.VALUES.permissionWhitelistNotifyOnJoin.getValue().toString().replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
Events.notifyPlayer(Languages.VALUES.permissionWhitelistNotifyOnJoin.getValue().toString().replace("[player]", player.getName()).replace("%player_name%", player.getName()).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((boolean) PermissionWhitelist.VALUES.playerWithPermissionKick.getValue()) {
|
if ((boolean) PermissionWhitelist.VALUES.playerWithPermissionKick.getValue()) {
|
||||||
if ((boolean) Config.VALUES.kickCustomCommand.getValue()) {
|
if ((boolean) Config.VALUES.kickCustomCommand.getValue()) {
|
||||||
T2Ccmd.console(Config.VALUES.kickCommand.getValue().toString().replace("[perm]", perm).replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[reason]", Languages.VALUES.permissionWhitelistKick.getValue().toString()));
|
T2C_Cmd.console(Config.VALUES.kickCommand.getValue().toString().replace("[perm]", perm).replace("[player]", player.getName()).replace("%player_name%", player.getName()).replace("[reason]", Languages.VALUES.permissionWhitelistKick.getValue().toString()));
|
||||||
} else player.kickPlayer(Languages.VALUES.permissionWhitelistKick.getValue().toString());
|
} else player.kickPlayer(Languages.VALUES.permissionWhitelistKick.getValue().toString());
|
||||||
T2Csend.console("[" + debug + "]" + Languages.VALUES.permissionWhitelistNotifyKick.getValue().toString().replace("[player]",
|
T2C_Send.console("[" + debug + "]" + Languages.VALUES.permissionWhitelistNotifyKick.getValue().toString().replace("[player]",
|
||||||
player.getName()).replace("[perm]", perm).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
player.getName()).replace("[perm]", perm).replace("[uuid]", String.valueOf(player.getUniqueId())));
|
||||||
}
|
}
|
||||||
if ((boolean) PermissionWhitelist.VALUES.customCommandsEnable.getValue()) {
|
if ((boolean) PermissionWhitelist.VALUES.customCommandsEnable.getValue()) {
|
||||||
for (String cmd : (List<String>) PermissionWhitelist.VALUES.customCommandsCommands.getValue()) {
|
for (String cmd : (List<String>) PermissionWhitelist.VALUES.customCommandsCommands.getValue()) {
|
||||||
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[perm]", perm));
|
T2C_Cmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%", player.getName()).replace("[perm]", perm));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,16 +62,16 @@ public class PermissionCheck {
|
|||||||
public static Boolean permWhitelist(Player player, String debug) {
|
public static Boolean permWhitelist(Player player, String debug) {
|
||||||
|
|
||||||
for (Map.Entry<String, PlayerObject> playerObject : PlayerCache.getPermissionHashMap().entrySet()) {
|
for (Map.Entry<String, PlayerObject> playerObject : PlayerCache.getPermissionHashMap().entrySet()) {
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] --------- " + player.getName() + " ---------");
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] --------- " + player.getName() + " ---------");
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist playerObject Name: " + playerObject.getValue().playerName);
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist playerObject Name: " + playerObject.getValue().playerName);
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist Player Name: " + player.getName());
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist Player Name: " + player.getName());
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist playerObject UUID: " + playerObject.getValue().uuid);
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist playerObject UUID: " + playerObject.getValue().uuid);
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist Player UUID: " + player.getUniqueId().toString().replace("-", ""));
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist Player UUID: " + player.getUniqueId().toString().replace("-", ""));
|
||||||
if (playerObject.getValue().playerName.equals(player.getName()) && playerObject.getValue().uuid.equals(player.getUniqueId().toString().replace("-", ""))) {
|
if (playerObject.getValue().playerName.equals(player.getName()) && playerObject.getValue().uuid.equals(player.getUniqueId().toString().replace("-", ""))) {
|
||||||
T2Cdebug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist Player on list!");
|
T2C_Debug.debug(Main.getPlugin(), "[" + debug + "] permWhitelist Player on list!");
|
||||||
T2Cdebug.debug(Main.getPlugin(), "");
|
T2C_Debug.debug(Main.getPlugin(), "");
|
||||||
return true;
|
return true;
|
||||||
} else T2Cdebug.debug(Main.getPlugin(), "");
|
} else T2C_Debug.debug(Main.getPlugin(), "");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import net.t2code.opsecurity.config.config.Config;
|
|||||||
import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
||||||
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ public class Timer {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
OpCheck.onCheck(player, false, debug);
|
OpCheck.onCheck(player, false, debug);
|
||||||
PermissionCheck.onCheck(player, false, debug);
|
PermissionCheck.onCheck(player, false, debug);
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
package net.t2code.opsecurity.command;
|
package net.t2code.opsecurity.command;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.opsecurity.config.config.Config;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.system.Permissions;
|
import net.t2code.opsecurity.system.Permissions;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.commands.T2Ctab;
|
import net.t2code.t2codelib.SPIGOT.api.commands.T2C_Tab;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -58,7 +58,7 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
T2Ctab.tab(list,sender,0,args,arg1);
|
T2C_Tab.tab(list,sender,0,args,arg1);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package net.t2code.opsecurity.command;
|
package net.t2code.opsecurity.command;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.opsecurity.check.OpCheck;
|
import net.t2code.opsecurity.check.OpCheck;
|
||||||
import net.t2code.opsecurity.config.config.Config;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.config.language.Languages;
|
import net.t2code.opsecurity.config.language.Languages;
|
||||||
@ -8,9 +8,9 @@ import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
|||||||
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.opsecurity.system.Permissions;
|
import net.t2code.opsecurity.system.Permissions;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
|
||||||
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;
|
||||||
@ -19,7 +19,7 @@ public class Commands {
|
|||||||
|
|
||||||
public static void help(CommandSender sender) {
|
public static void help(CommandSender sender) {
|
||||||
if (!sender.hasPermission(Permissions.help)) {
|
if (!sender.hasPermission(Permissions.help)) {
|
||||||
T2Csend.sender(sender, Languages.VALUES.noPermissionForOpSec.getValue().toString());
|
T2C_Send.sender(sender, Languages.VALUES.noPermissionForOpSec.getValue().toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//todo to language file
|
//todo to language file
|
||||||
@ -55,23 +55,23 @@ public class Commands {
|
|||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
if ((boolean) Config.VALUES.onlyOPcanUseThePlugin.getValue()) {
|
if ((boolean) Config.VALUES.onlyOPcanUseThePlugin.getValue()) {
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
if (!OpCheck.opWhitelist(player, debug)) {
|
if (!OpCheck.opWhitelist(player, debug)) {
|
||||||
sender.sendMessage(Util.getPrefix() + " §4You are not on the Whitelist!"); // todo
|
sender.sendMessage(Util.getPrefix() + " §4You are not on the Whitelist!"); // todo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
T2Csend.player(player, Languages.VALUES.reloadStart.getValue().toString());
|
T2C_Send.player(player, Languages.VALUES.reloadStart.getValue().toString());
|
||||||
}
|
}
|
||||||
if (sender instanceof Player) T2Csend.player((Player) sender, Languages.VALUES.reloadEnd.getValue().toString());
|
if (sender instanceof Player) T2C_Send.player((Player) sender, Languages.VALUES.reloadEnd.getValue().toString());
|
||||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
||||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §6Plugin reload...");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §6Plugin reload...");
|
||||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
||||||
// Load.onLoad(Main.getPlugin(),Main.getAutor(),Main.getVersion());
|
// Load.onLoad(Main.getPlugin(),Main.getAutor(),Main.getVersion());
|
||||||
Config.set(false);
|
Config.set(true);
|
||||||
Languages.set(false);
|
Languages.set(true);
|
||||||
OPWhitelist.set(false);
|
OPWhitelist.set(true);
|
||||||
PermissionWhitelist.set(false);
|
PermissionWhitelist.set(true);
|
||||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
||||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §2Plugin successfully reloaded.");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §2Plugin successfully reloaded.");
|
||||||
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + "§8-------------------------------");
|
||||||
@ -82,6 +82,6 @@ public class Commands {
|
|||||||
sender.sendMessage(Util.getPrefix() + "§cYou do not have permission for OPSecurity! §7<" + Permissions.info + ">");
|
sender.sendMessage(Util.getPrefix() + "§cYou do not have permission for OPSecurity! §7<" + Permissions.info + ">");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
T2Ctemplate.sendInfo(sender, Main.getPlugin(), Util.getSpigotID(), Util.getDiscord(), Util.getInfoText());
|
T2C_Template.sendInfo(sender, Main.getPlugin(), Util.getSpigotID(), Util.getDiscord(), Util.getInfoText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,11 @@
|
|||||||
package net.t2code.opsecurity.config.config;
|
package net.t2code.opsecurity.config.config;
|
||||||
|
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CconfigWriter;
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
|
||||||
import net.t2code.t2codelib.T2CLanguageEnum;
|
import net.t2code.t2codelib.util.T2C_ConfigItem;
|
||||||
import net.t2code.t2codelib.T2CconfigItem;
|
import net.t2code.t2codelib.util.T2C_LanguageEnum;
|
||||||
import net.t2code.opsecurity.Util;
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -17,108 +16,108 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
public enum VALUES implements T2CconfigItem {
|
public enum VALUES implements T2C_ConfigItem {
|
||||||
|
|
||||||
language("plugin.language", "english", true,
|
language("plugin.language", "english", true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier kannst du die Sprache des Plugins einstellen."));
|
put(T2C_LanguageEnum.german, List.of("Hier kannst du die Sprache des Plugins einstellen."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you can set the language of the plugin."));
|
put(T2C_LanguageEnum.english, List.of("Here you can set the language of the plugin."));
|
||||||
}}),
|
}}),
|
||||||
onlyOPcanUseThePlugin("plugin.onlyOPcanUseThePlugin", true, true,
|
onlyOPcanUseThePlugin("plugin.onlyOPcanUseThePlugin", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier kannst du festlegen, dass nur Spieler mit OP die Befehle des Plugins nutzen können."));
|
put(T2C_LanguageEnum.german, List.of("Hier kannst du festlegen, dass nur Spieler mit OP die Befehle des Plugins nutzen können."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you can specify that only players with OP can use the commands of the plugin."));
|
put(T2C_LanguageEnum.english, List.of("Here you can specify that only players with OP can use the commands of the plugin."));
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
updateCheckOnJoin("plugin.updateCheck.onJoin", true, true,
|
updateCheckOnJoin("plugin.updateCheck.onJoin", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Mit dieser Option kannst du festlegen, ob Spieler mit der Berechtigung 't2c.opsecurity.updatemsg' beim Beitritt eine Update-Nachricht erhalten, wenn ein Update für das Plugin verfügbar ist."));
|
put(T2C_LanguageEnum.german, List.of("Mit dieser Option kannst du festlegen, ob Spieler mit der Berechtigung 't2c.opsecurity.updatemsg' beim Beitritt eine Update-Nachricht erhalten, wenn ein Update für das Plugin verfügbar ist."));
|
||||||
put(T2CLanguageEnum.english, List.of("In this option you can set if players with the permission 't2c.opsecurity.updatemsg' will get an update message on join when an update for the plugin is available."));
|
put(T2C_LanguageEnum.english, List.of("In this option you can set if players with the permission 't2c.opsecurity.updatemsg' will get an update message on join when an update for the plugin is available."));
|
||||||
}}),
|
}}),
|
||||||
updateCheckSeePreReleaseUpdates("plugin.updateCheck.seePreReleaseUpdates", true, true,
|
updateCheckSeePreReleaseUpdates("plugin.updateCheck.seePreReleaseUpdates", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("In dieser Option kannst du einstellen, ob du Beta- und Snapshot-Versionen in der Update-Prüfung erhalten und anzeigen möchtest."));
|
put(T2C_LanguageEnum.german, List.of("In dieser Option kannst du einstellen, ob du Beta- und Snapshot-Versionen in der Update-Prüfung erhalten und anzeigen möchtest."));
|
||||||
put(T2CLanguageEnum.english, List.of("In this option you can set whether you want to receive and display beta and snapshot versions in the update check."));
|
put(T2C_LanguageEnum.english, List.of("In this option you can set whether you want to receive and display beta and snapshot versions in the update check."));
|
||||||
}}),
|
}}),
|
||||||
updateCheckTimeInterval("plugin.updateCheck.timeInterval", 60, true,
|
updateCheckTimeInterval("plugin.updateCheck.timeInterval", 60, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Mit dieser Option kannst du das Zeitintervall in Minuten festlegen, in dem Aktualisierungen überprüft werden sollen."));
|
put(T2C_LanguageEnum.german, List.of("Mit dieser Option kannst du das Zeitintervall in Minuten festlegen, in dem Aktualisierungen überprüft werden sollen."));
|
||||||
put(T2CLanguageEnum.english, List.of("In this option you can set the time interval in minutes in which updates should be checked."));
|
put(T2C_LanguageEnum.english, List.of("In this option you can set the time interval in minutes in which updates should be checked."));
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
checkOnJoin("check.onJoin.enable", true, true,
|
checkOnJoin("check.onJoin.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Aktiviere die Prüfung, ob der Spieler berechtigt ist, wenn er dem Server beitritt."));
|
put(T2C_LanguageEnum.german, List.of("Aktiviere die Prüfung, ob der Spieler berechtigt ist, wenn er dem Server beitritt."));
|
||||||
put(T2CLanguageEnum.english, List.of("Activate the checks whether the player is authorised when joining the player."));
|
put(T2C_LanguageEnum.english, List.of("Activate the checks whether the player is authorised when joining the player."));
|
||||||
}}),
|
}}),
|
||||||
checkOnInteract("check.onInteract.enable", true, true,
|
checkOnInteract("check.onInteract.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Aktiviere die Prüfung, ob der Spieler für Spielerinteraktionen autorisiert ist."));
|
put(T2C_LanguageEnum.german, List.of("Aktiviere die Prüfung, ob der Spieler für Spielerinteraktionen autorisiert ist."));
|
||||||
put(T2CLanguageEnum.english, List.of("Activate the checks whether the player is authorised for player interactions."));
|
put(T2C_LanguageEnum.english, List.of("Activate the checks whether the player is authorised for player interactions."));
|
||||||
}}),
|
}}),
|
||||||
checkOnCommand("check.onCommand.enable", true, true,
|
checkOnCommand("check.onCommand.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Aktiviere die Prüfung, ob der Spieler berechtigt ist, wenn er einen Befehl ausführt."));
|
put(T2C_LanguageEnum.german, List.of("Aktiviere die Prüfung, ob der Spieler berechtigt ist, wenn er einen Befehl ausführt."));
|
||||||
put(T2CLanguageEnum.english, List.of("Activate the checks whether the player is authorised when the player executes a command."));
|
put(T2C_LanguageEnum.english, List.of("Activate the checks whether the player is authorised when the player executes a command."));
|
||||||
}}),
|
}}),
|
||||||
checkOnCommandWhitelist("check.onCommand.whitelist", List.of("command 1", "command 2"), true,
|
checkOnCommandWhitelist("check.onCommand.whitelist", List.of("command 1", "command 2"), true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier kannst du Befehle angeben, für die die Prüfung nicht durchgeführt wird."));
|
put(T2C_LanguageEnum.german, List.of("Hier kannst du Befehle angeben, für die die Prüfung nicht durchgeführt wird."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you can specify commands for which the check is not carried out."));
|
put(T2C_LanguageEnum.english, List.of("Here you can specify commands for which the check is not carried out."));
|
||||||
}}),
|
}}),
|
||||||
checkOnChat("check.onChat.enable", true, true,
|
checkOnChat("check.onChat.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Aktiviere die Überprüfung, ob der Spieler autorisiert ist, wenn er eine Chat-Nachricht schreibt."));
|
put(T2C_LanguageEnum.german, List.of("Aktiviere die Überprüfung, ob der Spieler autorisiert ist, wenn er eine Chat-Nachricht schreibt."));
|
||||||
put(T2CLanguageEnum.english, List.of("Activate the checks whether the player is authorised when the player writes a chat message."));
|
put(T2C_LanguageEnum.english, List.of("Activate the checks whether the player is authorised when the player writes a chat message."));
|
||||||
}}),
|
}}),
|
||||||
checkTimerEnable("check.timer.enable", true, true,
|
checkTimerEnable("check.timer.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Aktiviere die Überprüfung aller Spieler in einem Zeitintervall."));
|
put(T2C_LanguageEnum.german, List.of("Aktiviere die Überprüfung aller Spieler in einem Zeitintervall."));
|
||||||
put(T2CLanguageEnum.english, List.of("Activate the check of all players in a time interval."));
|
put(T2C_LanguageEnum.english, List.of("Activate the check of all players in a time interval."));
|
||||||
}}),
|
}}),
|
||||||
checkTimerRefreshInSec("check.timer.refreshInSec", 60, true,
|
checkTimerRefreshInSec("check.timer.refreshInSec", 60, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier stellst du die Sekunden ein, mit denen die Prüfung in einem Zeitintervall durchgeführt wird."));
|
put(T2C_LanguageEnum.german, List.of("Hier stellst du die Sekunden ein, mit denen die Prüfung in einem Zeitintervall durchgeführt wird."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you set the seconds with which the check is carried out in a time interval."));
|
put(T2C_LanguageEnum.english, List.of("Here you set the seconds with which the check is carried out in a time interval."));
|
||||||
}}),
|
}}),
|
||||||
kickCustomCommand("kick.customCommand.enable", false, true,
|
kickCustomCommand("kick.customCommand.enable", false, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Soll ein separater Kick-Befehl für den Kick verwendet werden? Zum Beispiel, wenn du ein eigenes Verbotssystem verwenden."));
|
put(T2C_LanguageEnum.german, List.of("Soll ein separater Kick-Befehl für den Kick verwendet werden? Zum Beispiel, wenn du ein eigenes Verbotssystem verwenden."));
|
||||||
put(T2CLanguageEnum.english, List.of("Should a separate kick command be used for the kick? For example, if you use your own ban system."));
|
put(T2C_LanguageEnum.english, List.of("Should a separate kick command be used for the kick? For example, if you use your own ban system."));
|
||||||
}}),
|
}}),
|
||||||
kickCommand("kick.customCommand.command", "minecraft:kick [player] [reason]", true,
|
kickCommand("kick.customCommand.command", "minecraft:kick [player] [reason]", true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier kannst du den benutzerdefinierten Kick-Befehl einstellen."));
|
put(T2C_LanguageEnum.german, List.of("Hier kannst du den benutzerdefinierten Kick-Befehl einstellen."));
|
||||||
put(T2CLanguageEnum.english, List.of("This is where you set the user-defined kick command."));
|
put(T2C_LanguageEnum.english, List.of("This is where you set the user-defined kick command."));
|
||||||
}}),
|
}}),
|
||||||
notifyJoinWarning("notify.warn.enable", true, true,
|
notifyJoinWarning("notify.warn.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Sollen Spieler mit der Berechtigung 't2c.opsecurity.notify' gewarnt werden, wenn ein Spieler entdeckt wird, der nicht berechtigt ist, mit OP / einer Permission auf dem Server zu sein."));
|
put(T2C_LanguageEnum.german, List.of("Sollen Spieler mit der Berechtigung 't2c.opsecurity.notify' gewarnt werden, wenn ein Spieler entdeckt wird, der nicht berechtigt ist, mit OP / einer Permission auf dem Server zu sein."));
|
||||||
put(T2CLanguageEnum.english, List.of("Should players with the permission 't2c.opsecurity.notify' be warned if a player is detected who is not authorised to be on the server with OP / a permission."));
|
put(T2C_LanguageEnum.english, List.of("Should players with the permission 't2c.opsecurity.notify' be warned if a player is detected who is not authorised to be on the server with OP / a permission."));
|
||||||
}}),
|
}}),
|
||||||
notifyBungee("notify.allBungeePlayer.enable", false, true,
|
notifyBungee("notify.allProxyPlayer.enable", false, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Sollen die Warnungen an das gesamte Netzwerk (true) oder nur an den einzelnen Server (false) gesendet werden.", "Damit diese Funktion funktioniert, muss die T2CodeLib auf deinem Proxy vorhanden sein und in deren Config die API für T2C-OPSecurity aktiviert werden!"));
|
put(T2C_LanguageEnum.german, List.of("Sollen die Warnungen an das gesamte Netzwerk (true) oder nur an den einzelnen Server (false) gesendet werden.", "Damit diese Funktion funktioniert, muss die T2CodeLib auf deinem Proxy vorhanden sein und in deren Config die API für T2C-OPSecurity aktiviert werden!"));
|
||||||
put(T2CLanguageEnum.english, List.of("Should the warnings be sent on the entire network (true) or only on the individual server (false).", "For this function to work, the T2CodeLib must be present on your proxy and the API for T2C-OPSecurity must be activated in its config!"));
|
put(T2C_LanguageEnum.english, List.of("Should the warnings be sent on the entire network (true) or only on the individual server (false).", "For this function to work, the T2CodeLib must be present on your proxy and the API for T2C-OPSecurity must be activated in its config!"));
|
||||||
}}),
|
}}),
|
||||||
notifySoundEnable("notify.soundEnable", true, true,
|
notifySoundEnable("notify.soundEnable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Soll ein Sound abgespielt werden, bei einer Benachrichtigung?"));
|
put(T2C_LanguageEnum.german, List.of("Soll ein Sound abgespielt werden, bei einer Benachrichtigung?"));
|
||||||
put(T2CLanguageEnum.english, List.of("Should a sound be played during the warnings?"));
|
put(T2C_LanguageEnum.english, List.of("Should a sound be played during the warnings?"));
|
||||||
}}),
|
}}),
|
||||||
notifySoundValue("notify.sound", sound(), true,
|
notifySoundValue("notify.sound", sound(), true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Welcher Sound soll bei Benachrichtigung abgespielt werden?"));
|
put(T2C_LanguageEnum.german, List.of("Welcher Sound soll bei Benachrichtigung abgespielt werden?"));
|
||||||
put(T2CLanguageEnum.english, List.of("Which sound should be played during the warnings?"));
|
put(T2C_LanguageEnum.english, List.of("Which sound should be played during the warnings?"));
|
||||||
}}),
|
}}),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String path;
|
private final String path;
|
||||||
private Object value;
|
private Object value;
|
||||||
private final boolean forceSet;
|
private final boolean forceSet;
|
||||||
private final HashMap<T2CLanguageEnum, List<String>> comments;
|
private final HashMap<T2C_LanguageEnum, List<String>> comments;
|
||||||
|
|
||||||
VALUES(String path, Object value, boolean forceSet, HashMap<T2CLanguageEnum, List<String>> comments) {
|
VALUES(String path, Object value, boolean forceSet, HashMap<T2C_LanguageEnum, List<String>> comments) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.forceSet = forceSet;
|
this.forceSet = forceSet;
|
||||||
@ -141,7 +140,7 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<T2CLanguageEnum, List<String>> getComments() {
|
public HashMap<T2C_LanguageEnum, List<String>> getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,18 +156,15 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void set(boolean pluginStart) {
|
public static void set(boolean isReload) {
|
||||||
long long_ = System.currentTimeMillis();
|
T2C_ConfigWriter.createConfig(Util.getPrefix(), new File(Main.getPath(), "config.yml"), VALUES.values(), isReload, Util.getConfigLogo());
|
||||||
T2CconfigWriter.createConfig(new File(Main.getPath(), "config.yml"), VALUES.values(), Util.getConfigLogo());
|
|
||||||
|
|
||||||
T2Ctemplate.setCenterAligned(Util.getPrefix(), "§2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", pluginStart);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static Sound sound() {
|
private static Sound sound() {
|
||||||
if (T2CmcVersion.isMc1_8()) {
|
if (T2C_McVersion.isMc1_8()) {
|
||||||
return Sound.valueOf("NOTE_PIANO");
|
return Sound.valueOf("NOTE_PIANO");
|
||||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||||
return Sound.valueOf("BLOCK_NOTE_HARP");
|
return Sound.valueOf("BLOCK_NOTE_HARP");
|
||||||
} else return Sound.valueOf("BLOCK_NOTE_BLOCK_HARP");
|
} else return Sound.valueOf("BLOCK_NOTE_BLOCK_HARP");
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
package net.t2code.opsecurity.config.config;
|
package net.t2code.opsecurity.config.config;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
import net.t2code.opsecurity.config.opWhitelist.OPWhitelist;
|
||||||
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CconfigWriter;
|
import net.t2code.t2codelib.util.T2C_ConfigItem;
|
||||||
import net.t2code.t2codelib.T2CLanguageEnum;
|
import net.t2code.t2codelib.util.T2C_LanguageEnum;
|
||||||
import net.t2code.t2codelib.T2CconfigItem;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -18,7 +17,6 @@ import java.nio.file.Files;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -80,7 +78,7 @@ public class Converter {
|
|||||||
PLAYERENUM.uuid.path = "opWhitelist.whitelist.KEY.uuid".replace("KEY", playerObject.playerName);
|
PLAYERENUM.uuid.path = "opWhitelist.whitelist.KEY.uuid".replace("KEY", playerObject.playerName);
|
||||||
PLAYERENUM.uuid.value = playerObject.uuid;
|
PLAYERENUM.uuid.value = playerObject.uuid;
|
||||||
|
|
||||||
T2CconfigWriter.createConfig(new File(Main.getPath(), "opWhitelist.yml"), PLAYERENUM.values(), Util.getConfigLogo());
|
T2C_ConfigWriter.createConfig(Util.getPrefix(),new File(Main.getPath(), "opWhitelist.yml"), PLAYERENUM.values(),false, Util.getConfigLogo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,22 +121,22 @@ public class Converter {
|
|||||||
|
|
||||||
if (!yamlConfiguration.contains("check.onJoin.enable")) {
|
if (!yamlConfiguration.contains("check.onJoin.enable")) {
|
||||||
Boolean onJoin = yamlConfiguration.getBoolean("check.onJoin");
|
Boolean onJoin = yamlConfiguration.getBoolean("check.onJoin");
|
||||||
T2Csend.debugmsg(Main.getPlugin(), "onJoin = " + onJoin);
|
T2C_Debug.debugmsg(Main.getPlugin(), "onJoin = " + onJoin);
|
||||||
yamlConfiguration.set("check.onJoin.enable", onJoin);
|
yamlConfiguration.set("check.onJoin.enable", onJoin);
|
||||||
}
|
}
|
||||||
if (!yamlConfiguration.contains("check.onInteract.enable")) {
|
if (!yamlConfiguration.contains("check.onInteract.enable")) {
|
||||||
Boolean onInteract = yamlConfiguration.getBoolean("check.onInteract");
|
Boolean onInteract = yamlConfiguration.getBoolean("check.onInteract");
|
||||||
T2Cdebug.debugmsg(Main.getPlugin(), "onInteract = " + onInteract);
|
T2C_Debug.debugmsg(Main.getPlugin(), "onInteract = " + onInteract);
|
||||||
yamlConfiguration.set("check.onInteract.enable", onInteract);
|
yamlConfiguration.set("check.onInteract.enable", onInteract);
|
||||||
}
|
}
|
||||||
if (!yamlConfiguration.contains("check.onCommand.enable")) {
|
if (!yamlConfiguration.contains("check.onCommand.enable")) {
|
||||||
Boolean onCommand = yamlConfiguration.getBoolean("check.onCommand");
|
Boolean onCommand = yamlConfiguration.getBoolean("check.onCommand");
|
||||||
T2Cdebug.debugmsg(Main.getPlugin(), "onCommand = " + onCommand);
|
T2C_Debug.debugmsg(Main.getPlugin(), "onCommand = " + onCommand);
|
||||||
yamlConfiguration.set("check.onCommand.enable", onCommand);
|
yamlConfiguration.set("check.onCommand.enable", onCommand);
|
||||||
}
|
}
|
||||||
if (!yamlConfiguration.contains("check.onChat.enable")) {
|
if (!yamlConfiguration.contains("check.onChat.enable")) {
|
||||||
Boolean onChat = yamlConfiguration.getBoolean("check.onChat");
|
Boolean onChat = yamlConfiguration.getBoolean("check.onChat");
|
||||||
T2Cdebug.debugmsg(Main.getPlugin(), "onChat = " + onChat);
|
T2C_Debug.debugmsg(Main.getPlugin(), "onChat = " + onChat);
|
||||||
yamlConfiguration.set("check.onChat.enable", onChat);
|
yamlConfiguration.set("check.onChat.enable", onChat);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,26 +147,26 @@ public class Converter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setConfig(String path, T2CconfigItem item) {
|
private static void setConfig(String path, T2C_ConfigItem item) {
|
||||||
if (yamlConfigurationOld.contains(path)) {
|
if (yamlConfigurationOld.contains(path)) {
|
||||||
item.setValue(yamlConfigurationOld.get(path));
|
item.setValue(yamlConfigurationOld.get(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setOPWhitelist(String path, T2CconfigItem item) {
|
private static void setOPWhitelist(String path, T2C_ConfigItem item) {
|
||||||
if (yamlConfigurationOld.contains(path)) {
|
if (yamlConfigurationOld.contains(path)) {
|
||||||
item.setValue(opYml.get(path));
|
item.setValue(opYml.get(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setPermissionWhitelist(String path, T2CconfigItem item) {
|
private static void setPermissionWhitelist(String path, T2C_ConfigItem item) {
|
||||||
if (yamlConfigurationOld.contains(path)) {
|
if (yamlConfigurationOld.contains(path)) {
|
||||||
item.setValue(permYml.get(path));
|
item.setValue(permYml.get(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private enum PLAYERENUM implements T2CconfigItem {
|
private enum PLAYERENUM implements T2C_ConfigItem {
|
||||||
|
|
||||||
name("", "", true, new HashMap<>()),
|
name("", "", true, new HashMap<>()),
|
||||||
uuid("", "", true, new HashMap<>()),
|
uuid("", "", true, new HashMap<>()),
|
||||||
@ -178,9 +176,9 @@ public class Converter {
|
|||||||
private String path;
|
private String path;
|
||||||
private Object value;
|
private Object value;
|
||||||
private final boolean forceSet;
|
private final boolean forceSet;
|
||||||
private final HashMap<T2CLanguageEnum, List<String>> comments;
|
private final HashMap<T2C_LanguageEnum, List<String>> comments;
|
||||||
|
|
||||||
PLAYERENUM(String path, Object value, boolean forceSet, HashMap<T2CLanguageEnum, List<String>> comments) {
|
PLAYERENUM(String path, Object value, boolean forceSet, HashMap<T2C_LanguageEnum, List<String>> comments) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.forceSet = forceSet;
|
this.forceSet = forceSet;
|
||||||
@ -204,7 +202,7 @@ public class Converter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<T2CLanguageEnum, List<String>> getComments() {
|
public HashMap<T2C_LanguageEnum, List<String>> getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,193 +1,193 @@
|
|||||||
package net.t2code.opsecurity.config.language;
|
package net.t2code.opsecurity.config.language;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.opsecurity.config.config.Config;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CconfigWriterLanguage;
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_LanguageWriter;
|
||||||
import net.t2code.t2codelib.T2CLanguageEnum;
|
import net.t2code.t2codelib.util.T2C_ConfigItemLanguages;
|
||||||
import net.t2code.t2codelib.T2CconfigItemLanguages;
|
import net.t2code.t2codelib.util.T2C_LanguageEnum;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Languages {
|
public class Languages {
|
||||||
|
|
||||||
public enum VALUES implements T2CconfigItemLanguages {
|
public enum VALUES implements T2C_ConfigItemLanguages {
|
||||||
otherLang("plugin", null,
|
otherLang("plugin", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, null);
|
put(T2C_LanguageEnum.german, null);
|
||||||
put(T2CLanguageEnum.english, null);
|
put(T2C_LanguageEnum.english, null);
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Wenn du eine Eigene Sprache hinzufügen magst, dann kopiere einfach eine Sprachdatei und benenne sie in deine Sprache, dies kannst du dann in der config.yml einstellen.",""));
|
put(T2C_LanguageEnum.german, List.of("Wenn du eine Eigene Sprache hinzufügen magst, dann kopiere einfach eine Sprachdatei und benenne sie in deine Sprache, dies kannst du dann in der config.yml einstellen.", ""));
|
||||||
put(T2CLanguageEnum.english, List.of("If you want to add your own language, simply copy a language file and rename it to your language, you can then set this in config.yml.",""));
|
put(T2C_LanguageEnum.english, List.of("If you want to add your own language, simply copy a language file and rename it to your language, you can then set this in config.yml.", ""));
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
soundNotFound("plugin.soundNotFound", null,
|
soundNotFound("plugin.soundNotFound", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Der Sound <gold>[sound]</gold> wurde nicht gefunden! Bitte überprüfe die Einstellungen.</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Der Sound <gold>[sound]</gold> wurde nicht gefunden! Bitte überprüfe die Einstellungen.</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>The sound <gold>[sound]</gold> could not be found! Please check your settings.</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>The sound <gold>[sound]</gold> could not be found! Please check your settings.</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
noPermission("plugin.NoPermission", null,
|
noPermission("plugin.NoPermission", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "<dark_red>Keine Berechtigung!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("<dark_red>Keine Berechtigung!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "<dark_red>No Permission!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("<dark_red>No Permission!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
noPermissionForOpSec("plugin.NoPermission", null,
|
noPermissionForOpSec("plugin.NoPermission", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <red>Du hast keine Berechtigung für OPSecurity!</red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <red>Du hast keine Berechtigung für OPSecurity!</red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <red>You do not have permission for OPSecurity!</red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <red>You do not have permission for OPSecurity!</red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
playerMustBeOnlineToOp("plugin.PlayerMustBeOnlineToOp", null,
|
playerMustBeOnlineToOp("plugin.PlayerMustBeOnlineToOp", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Der Spieler muss online sein, um OP zu erhalten!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Der Spieler muss online sein, um OP zu erhalten!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Player must be online to get op!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Player must be online to get op!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
reloadStart("plugin.reload.start", null,
|
reloadStart("plugin.reload.start", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <gold>Plugin wird neu geladen...</gold>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <gold>Plugin wird neu geladen...</gold>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <gold>Plugin is reloaded...</gold>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <gold>Plugin is reloaded...</gold>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
reloadEnd("plugin.reload.end", null,
|
reloadEnd("plugin.reload.end", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <green>Plugin wurde erfolgreich neu geladen.</green>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <green>Plugin wurde erfolgreich neu geladen.</green>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <green>Plugin was successfully reloaded.</green>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <green>Plugin was successfully reloaded.</green>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
opWhitelistOpCommand("opWhitelist.opCommand", null,
|
opWhitelistOpCommand("opWhitelist.opCommand", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Der angegebene Spieler befindet sich nicht auf der OP_Whitelist!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Der angegebene Spieler befindet sich nicht auf der OP_Whitelist!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>The specified player is not on the OP_Whitelist!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>The specified player is not on the OP_Whitelist!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
opWhitelistNotifyOnJoin("opWhitelist.notify.onJoin", null,
|
opWhitelistNotifyOnJoin("opWhitelist.notify.onJoin", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> ist dem Server beigetreten, befindet sich aber nicht auf der OP_Whitelist!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> ist dem Server beigetreten, befindet sich aber nicht auf der OP_Whitelist!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> is joined to the server but is not on the OP_Whitelist!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> is joined to the server but is not on the OP_Whitelist!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
opWhitelistNotifyDeop("opWhitelist.notify.deop", null,
|
opWhitelistNotifyDeop("opWhitelist.notify.deop", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> wurde OP entfernt da er nicht auf der Spielerliste steht!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> wurde OP entfernt da er nicht auf der Spielerliste steht!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> was removed OP because he is not on the playerlist!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> was removed OP because he is not on the playerlist!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
opWhitelistNotifyKick("opWhitelist.notify.kick", null,
|
opWhitelistNotifyKick("opWhitelist.notify.kick", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> wurde gekickt, da er nicht auf der OP_Whitelist steht!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> wurde gekickt, da er nicht auf der OP_Whitelist steht!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> was kicked because he is not on the OP_Whitelist!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> was kicked because he is not on the OP_Whitelist!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
opWhitelistDeop("opWhitelist.deop", null,
|
opWhitelistDeop("opWhitelist.deop", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "&4Dir wurde OP entfernt da du dazu keine Permission besitzt.");
|
put(T2C_LanguageEnum.german, List.of("&4Dir wurde OP entfernt da du dazu keine Permission besitzt."));
|
||||||
put(T2CLanguageEnum.english, "&4You have been removed from OP because you do not have permission.");
|
put(T2C_LanguageEnum.english, List.of("&4You have been removed from OP because you do not have permission."));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
opWhitelistKick("opWhitelist.kick", null,
|
opWhitelistKick("opWhitelist.kick", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "&4Du hast OP, bist dazu aber nicht berechtigt. Deswegen wurdest du gekickt!");
|
put(T2C_LanguageEnum.german, List.of("&4Du hast OP, bist dazu aber nicht berechtigt. Deswegen wurdest du gekickt!"));
|
||||||
put(T2CLanguageEnum.english, "&4You have op but are not authorized to do so, that's why you were kicked!");
|
put(T2C_LanguageEnum.english, List.of("&4You have op but are not authorized to do so, that's why you were kicked!"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
permissionWhitelistNotifyOnJoin("permissionWhitelist.notify.onJoin", null,
|
permissionWhitelistNotifyOnJoin("permissionWhitelist.notify.onJoin", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> hat die Permission <gold>[perm]</gold> und ist dazu nicht berechtigt! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> ist nicht in der Spielerliste!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> hat die Permission <gold>[perm]</gold> und ist dazu nicht berechtigt! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> ist nicht in der Spielerliste!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> has permission <gold>[perm]</gold> and is not authorized to do so! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> is not on the Player list!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> has permission <gold>[perm]</gold> and is not authorized to do so! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> is not on the Player list!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
permissionWhitelistNotifyKick("permissionWhitelist.notify.kick", null,
|
permissionWhitelistNotifyKick("permissionWhitelist.notify.kick", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> hat die Permission <gold>[perm]</gold> und ist dazu nicht berechtigt! Daher wurde er gekickt! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> ist nicht in der Spielerliste!</dark_red>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Spieler <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> hat die Permission <gold>[perm]</gold> und ist dazu nicht berechtigt! Daher wurde er gekickt! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> ist nicht in der Spielerliste!</dark_red>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> has permission <gold>[perm]</gold> and is not authorized to do so! Therefore he was kicked! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> is not on the Player list!</dark_red>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Player <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> has permission <gold>[perm]</gold> and is not authorized to do so! Therefore he was kicked! <gold><hover:show_text:'<gold>Name:</gold> <yellow>[player]</yellow><br><gold>UUID:</gold> <yellow>[uuid]</yellow>'>[player]</hover></gold> is not on the Player list!</dark_red>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
permissionWhitelistKick("permissionWhitelist.kick", null,
|
permissionWhitelistKick("permissionWhitelist.kick", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "&4Du wurdest gekickt, da du Permissions besitzt, für die du keine Berechtigung besitzt!");
|
put(T2C_LanguageEnum.german, List.of("&4Du wurdest gekickt, da du Permissions besitzt, für die du keine Berechtigung besitzt!"));
|
||||||
put(T2CLanguageEnum.english, "&4You were kicked because you have permissions to which you do not have permission!");
|
put(T2C_LanguageEnum.english, List.of("&4You were kicked because you have permissions to which you do not have permission!"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
exactKickReason("console.exactKickReason", null,
|
exactKickReason("console.exactKickReason", null,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, "[prefix] <dark_red>Genauer Grund:</dark_red> <gold>[reason]</gold>");
|
put(T2C_LanguageEnum.german, List.of("[prefix] <dark_red>Genauer Grund:</dark_red> <gold>[reason]</gold>"));
|
||||||
put(T2CLanguageEnum.english, "[prefix] <dark_red>Exact reason:</dark_red> <gold>[reason]</gold>");
|
put(T2C_LanguageEnum.english, List.of("[prefix] <dark_red>Exact reason:</dark_red> <gold>[reason]</gold>"));
|
||||||
}},
|
}},
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
}});
|
}});
|
||||||
private final String path;
|
private final String path;
|
||||||
private Object value;
|
private Object value;
|
||||||
private final HashMap<T2CLanguageEnum, String> lang;
|
private final HashMap<T2C_LanguageEnum, List<String>> lang;
|
||||||
private final HashMap<T2CLanguageEnum, List<String>> comments;
|
private final HashMap<T2C_LanguageEnum, List<String>> comments;
|
||||||
|
|
||||||
VALUES(String path, Object value, HashMap<T2CLanguageEnum, String> lang, HashMap<T2CLanguageEnum, List<String>> comments) {
|
VALUES(String path, Object value, HashMap<T2C_LanguageEnum, List<String>> lang, HashMap<T2C_LanguageEnum, List<String>> comments) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
@ -202,18 +202,18 @@ public class Languages {
|
|||||||
@Override
|
@Override
|
||||||
public Object getValue() {
|
public Object getValue() {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return lang.get(T2CLanguageEnum.english);
|
return lang.get(T2C_LanguageEnum.english);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<T2CLanguageEnum, String> getLanguage() {
|
public HashMap<T2C_LanguageEnum, List<String>> getLanguage() {
|
||||||
return lang;
|
return lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<T2CLanguageEnum, List<String>> getComments() {
|
public HashMap<T2C_LanguageEnum, List<String>> getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,8 +223,8 @@ public class Languages {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void set(boolean pluginStart) {
|
public static void set(boolean isReload) {
|
||||||
T2CconfigWriterLanguage.createConfig(Util.getPrefix(),Main.getPath(), VALUES.values(), Config.VALUES.language.getValue().toString(),pluginStart, Util.getConfigLogo());
|
T2C_LanguageWriter.createConfig(Util.getPrefix(), Main.getPath(), VALUES.values(), Config.VALUES.language.getValue().toString(), isReload, Util.getConfigLogo());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,75 +2,74 @@
|
|||||||
|
|
||||||
package net.t2code.opsecurity.config.opWhitelist;
|
package net.t2code.opsecurity.config.opWhitelist;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.objects.PlayerCache;
|
import net.t2code.opsecurity.objects.PlayerCache;
|
||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CconfigWriter;
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
|
||||||
import net.t2code.t2codelib.T2CLanguageEnum;
|
import net.t2code.t2codelib.util.T2C_ConfigItem;
|
||||||
import net.t2code.t2codelib.T2CconfigItem;
|
import net.t2code.t2codelib.util.T2C_LanguageEnum;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class OPWhitelist {
|
public class OPWhitelist {
|
||||||
|
|
||||||
public enum VALUES implements T2CconfigItem {
|
public enum VALUES implements T2C_ConfigItem {
|
||||||
|
|
||||||
enable("opWhitelist.enable", false, true,
|
enable("opWhitelist.enable", false, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hiermit aktivierst du die OP-Whitelist."));
|
put(T2C_LanguageEnum.german, List.of("Hiermit aktivierst du die OP-Whitelist."));
|
||||||
put(T2CLanguageEnum.english, List.of("This activates the OP whitelist."));
|
put(T2C_LanguageEnum.english, List.of("This activates the OP whitelist."));
|
||||||
}}),
|
}}),
|
||||||
playerMustBeOnlineToOp("opWhitelist.playerMustBeOnlineToOp", true, true,
|
playerMustBeOnlineToOp("opWhitelist.playerMustBeOnlineToOp", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Wenn diese Option aktiviert ist, muss der Spieler dem OP gegeben werden soll sich auf dem Server befinden.", "Dies gilt auch wenn man einen Spieler per Console OP geben möchte."));
|
put(T2C_LanguageEnum.german, List.of("Wenn diese Option aktiviert ist, muss der Spieler dem OP gegeben werden soll sich auf dem Server befinden.", "Dies gilt auch wenn man einen Spieler per Console OP geben möchte."));
|
||||||
put(T2CLanguageEnum.english, List.of("If this option is activated, the player to whom the OP is to be given must be on the server.", "This also applies if you want to OP a player via console."));
|
put(T2C_LanguageEnum.english, List.of("If this option is activated, the player to whom the OP is to be given must be on the server.", "This also applies if you want to OP a player via console."));
|
||||||
}}),
|
}}),
|
||||||
noOpPlayerDeopEnable("opWhitelist.noOpPlayerDeop.enable", true, true,
|
noOpPlayerDeopEnable("opWhitelist.noOpPlayerDeop.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Sollen den Spielern die OP besitzen, die aber nicht auf der Whitelist stehen, OP entfernt bekommen?"));
|
put(T2C_LanguageEnum.german, List.of("Sollen den Spielern die OP besitzen, die aber nicht auf der Whitelist stehen, OP entfernt bekommen?"));
|
||||||
put(T2CLanguageEnum.english, List.of("Should players who have OP but are not on the whitelist have OP removed?"));
|
put(T2C_LanguageEnum.english, List.of("Should players who have OP but are not on the whitelist have OP removed?"));
|
||||||
}}),
|
}}),
|
||||||
noOpPlayerDeopPlayerSendMessage("opWhitelist.noOpPlayerDeop.playerSendMessage", true, true,
|
noOpPlayerDeopPlayerSendMessage("opWhitelist.noOpPlayerDeop.playerSendMessage", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Sollen Spieler eine Benachrichtigung erhalten, wenn sie OP entfernt bekommen?"));
|
put(T2C_LanguageEnum.german, List.of("Sollen Spieler eine Benachrichtigung erhalten, wenn sie OP entfernt bekommen?"));
|
||||||
put(T2CLanguageEnum.english, List.of("Should players receive a notification when they get OP removed?"));
|
put(T2C_LanguageEnum.english, List.of("Should players receive a notification when they get OP removed?"));
|
||||||
}}),
|
}}),
|
||||||
noOpPlayerKickEnable("opWhitelist.noOpPlayerKick.enable", true, true,
|
noOpPlayerKickEnable("opWhitelist.noOpPlayerKick.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier legst du fest ob ein Spieler gekickt werden soll, wenn er OP besitzt und nicht auf der Whitelist steht."));
|
put(T2C_LanguageEnum.german, List.of("Hier legst du fest ob ein Spieler gekickt werden soll, wenn er OP besitzt und nicht auf der Whitelist steht."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you determine whether a player should be kicked if he has OP and is not on the whitelist."));
|
put(T2C_LanguageEnum.english, List.of("Here you determine whether a player should be kicked if he has OP and is not on the whitelist."));
|
||||||
}}),
|
}}),
|
||||||
noOpPlayerSetGameModeEnable("opWhitelist.noOpPlayerSetGameMode.enable", true, true,
|
noOpPlayerSetGameModeEnable("opWhitelist.noOpPlayerSetGameMode.enable", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Sollen Spieler, die OP besitzen und nicht auf der Whitelist stehen in einen bestimmten Gamemode gesetzt werden?"));
|
put(T2C_LanguageEnum.german, List.of("Sollen Spieler, die OP besitzen und nicht auf der Whitelist stehen in einen bestimmten Gamemode gesetzt werden?"));
|
||||||
put(T2CLanguageEnum.english, List.of("Should players who own OP and are not on the whitelist be set to a specific gamemode?"));
|
put(T2C_LanguageEnum.english, List.of("Should players who own OP and are not on the whitelist be set to a specific gamemode?"));
|
||||||
}}),
|
}}),
|
||||||
noOpPlayerSetGameModeValue("opWhitelist.noOpPlayerSetGameMode.gameMode", GameMode.SURVIVAL, true,
|
noOpPlayerSetGameModeValue("opWhitelist.noOpPlayerSetGameMode.gameMode", GameMode.SURVIVAL, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier legst du den Gamemode fest, in den Spieler gesetzt werden sollen, die OP besitzen und nicht auf der Whitelist stehen."));
|
put(T2C_LanguageEnum.german, List.of("Hier legst du den Gamemode fest, in den Spieler gesetzt werden sollen, die OP besitzen und nicht auf der Whitelist stehen."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you define the game mode in which players who have OP and are not on the whitelist are to be set."));
|
put(T2C_LanguageEnum.english, List.of("Here you define the game mode in which players who have OP and are not on the whitelist are to be set."));
|
||||||
}}),
|
}}),
|
||||||
customCommandsEnable("opWhitelist.customCommands.enable", false, true,
|
customCommandsEnable("opWhitelist.customCommands.enable", false, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Soll ein bestimmter befehl ausgeführt werden, wenn ein Spieler OP hat und nicht auf der Whitelist steht."));
|
put(T2C_LanguageEnum.german, List.of("Soll ein bestimmter befehl ausgeführt werden, wenn ein Spieler OP hat und nicht auf der Whitelist steht."));
|
||||||
put(T2CLanguageEnum.english, List.of("Should a certain command be executed if a player has OP and is not on the whitelist."));
|
put(T2C_LanguageEnum.english, List.of("Should a certain command be executed if a player has OP and is not on the whitelist."));
|
||||||
}}),
|
}}),
|
||||||
customCommandsCommands("opWhitelist.customCommands.commands", Arrays.asList("kick [player] &4You have op but are not authorized to do so, that's why you were kicked!"), true,
|
customCommandsCommands("opWhitelist.customCommands.commands", List.of("kick [player] &4You have op but are not authorized to do so, that's why you were kicked!"), true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of("Hier kann man Mehrere Commands einfügen, die ausgeführt werden, wenn ein Spieler OP hat und nicht auf der Whitelist steht."));
|
put(T2C_LanguageEnum.german, List.of("Hier kann man Mehrere Commands einfügen, die ausgeführt werden, wenn ein Spieler OP hat und nicht auf der Whitelist steht."));
|
||||||
put(T2CLanguageEnum.english, List.of("Here you can add several commands that are executed when a player has OP and is not on the whitelist."));
|
put(T2C_LanguageEnum.english, List.of("Here you can add several commands that are executed when a player has OP and is not on the whitelist."));
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
playerSection("opWhitelist.whitelist", null, true,
|
playerSection("opWhitelist.whitelist", null, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.german, List.of(
|
put(T2C_LanguageEnum.german, List.of(
|
||||||
"Hier legst du wie im Beispiel die Spieler an, die OP besitzen dürfen.",
|
"Hier legst du wie im Beispiel die Spieler an, die OP besitzen dürfen.",
|
||||||
"Wichtig:",
|
"Wichtig:",
|
||||||
" Es muss der Spielername und die UUID angegeben werden!",
|
" Es muss der Spielername und die UUID angegeben werden!",
|
||||||
@ -78,7 +77,7 @@ public class OPWhitelist {
|
|||||||
"Die UUID eines Spielers kannst du hier finden: https://mcuuid.net",
|
"Die UUID eines Spielers kannst du hier finden: https://mcuuid.net",
|
||||||
"Wenn dein Server nicht im OnlineModus ist, werden alle Spieler andere UUIDs erhalten, dann findest du die UUID eines Spielers in deiner Console, wenn der Spieler den Server betritt."
|
"Wenn dein Server nicht im OnlineModus ist, werden alle Spieler andere UUIDs erhalten, dann findest du die UUID eines Spielers in deiner Console, wenn der Spieler den Server betritt."
|
||||||
));
|
));
|
||||||
put(T2CLanguageEnum.english, List.of(
|
put(T2C_LanguageEnum.english, List.of(
|
||||||
"Here, as in the example, you create the players who are allowed to own OP.",
|
"Here, as in the example, you create the players who are allowed to own OP.",
|
||||||
"Important:",
|
"Important:",
|
||||||
" The player name and the UUID must be entered!",
|
" The player name and the UUID must be entered!",
|
||||||
@ -96,9 +95,9 @@ public class OPWhitelist {
|
|||||||
private final String path;
|
private final String path;
|
||||||
private Object value;
|
private Object value;
|
||||||
private final boolean forceSet;
|
private final boolean forceSet;
|
||||||
private final HashMap<T2CLanguageEnum, List<String>> comments;
|
private final HashMap<T2C_LanguageEnum, List<String>> comments;
|
||||||
|
|
||||||
VALUES(String path, Object value, boolean forceSet, HashMap<T2CLanguageEnum, List<String>> comments) {
|
VALUES(String path, Object value, boolean forceSet, HashMap<T2C_LanguageEnum, List<String>> comments) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.forceSet = forceSet;
|
this.forceSet = forceSet;
|
||||||
@ -121,13 +120,13 @@ public class OPWhitelist {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<T2CLanguageEnum, List<String>> getComments() {
|
public HashMap<T2C_LanguageEnum, List<String>> getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLanguagePath() {
|
public String getLanguagePath() {
|
||||||
return null;
|
return Config.VALUES.language.getValue().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -136,22 +135,20 @@ public class OPWhitelist {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void set(boolean pluginStart) {
|
public static void set(boolean isReload) {
|
||||||
long long_ = System.currentTimeMillis();
|
File file = new File(Main.getPath(), "opWhitelist.yml");
|
||||||
T2CconfigWriter.createConfig(new File(Main.getPath(), "opWhitelist.yml"), VALUES.values(), Util.getConfigLogo());
|
T2C_ConfigWriter.createConfig(Util.getPrefix(), file, VALUES.values(), isReload, Util.getConfigLogo());
|
||||||
player();
|
getPlayer(file);
|
||||||
|
|
||||||
T2Ctemplate.setCenterAligned(Util.getPrefix(), "§2opWhitelist.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms",pluginStart);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void getPlayer(File file) {
|
||||||
private static void player() {
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
|
||||||
ConfigurationSection section = (ConfigurationSection) VALUES.playerSection.getValue();
|
for (String key : yamlConfiguration.getConfigurationSection(VALUES.playerSection.getPath()).getKeys(false)) {
|
||||||
for (String key : section.getConfigurationSection("").getKeys(false)) {
|
String name = yamlConfiguration.getString(VALUES.playerSection.getPath() + "." + key + ".name");
|
||||||
String name = section.getString(key + ".name");
|
String uuid = yamlConfiguration.getString(VALUES.playerSection.getPath() + "." + key + ".uuid").replace("-", "");
|
||||||
PlayerObject playerObject = new PlayerObject(
|
PlayerObject playerObject = new PlayerObject(
|
||||||
name,
|
name,
|
||||||
section.getString(key + ".uuid").replace("-", ""));
|
uuid);
|
||||||
PlayerCache.getOpHashMap().put(name, playerObject);
|
PlayerCache.getOpHashMap().put(name, playerObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,56 +2,55 @@
|
|||||||
|
|
||||||
package net.t2code.opsecurity.config.permissionWhitelist;
|
package net.t2code.opsecurity.config.permissionWhitelist;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.objects.PlayerCache;
|
import net.t2code.opsecurity.objects.PlayerCache;
|
||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2CconfigWriter;
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
|
||||||
import net.t2code.t2codelib.T2CLanguageEnum;
|
import net.t2code.t2codelib.util.T2C_ConfigItem;
|
||||||
import net.t2code.t2codelib.T2CconfigItem;
|
import net.t2code.t2codelib.util.T2C_LanguageEnum;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PermissionWhitelist {
|
public class PermissionWhitelist {
|
||||||
|
|
||||||
public enum VALUES implements T2CconfigItem {
|
public enum VALUES implements T2C_ConfigItem {
|
||||||
|
|
||||||
enable("permissionWhitelist.enable", false, true,
|
enable("permissionWhitelist.enable", false, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
}}),
|
}}),
|
||||||
playerWithPermissionKick("permissionWhitelist.playerWithPermissionKick", true, true,
|
playerWithPermissionKick("permissionWhitelist.playerWithPermissionKick", true, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
}}),
|
}}),
|
||||||
permissions("permissionWhitelist.permissions", Arrays.asList("*", "t2c.opsecurity.admin"), true,
|
permissions("permissionWhitelist.permissions", Arrays.asList("*", "t2c.opsecurity.admin"), true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
}}),
|
}}),
|
||||||
customCommandsEnable("permissionWhitelist.customCommands.enable", false, true,
|
customCommandsEnable("permissionWhitelist.customCommands.enable", false, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
}}),
|
}}),
|
||||||
customCommandsCommands("permissionWhitelist.customCommands.commands", Arrays.asList("lp user [player] permission unset *", "lp user [player] permission unset t2c.opsecurity.admin"), true,
|
customCommandsCommands("permissionWhitelist.customCommands.commands", Arrays.asList("lp user [player] permission unset *", "lp user [player] permission unset t2c.opsecurity.admin"), true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
}}),
|
}}),
|
||||||
|
|
||||||
playerSection("permissionWhitelist.whitelist", null, true,
|
playerSection("permissionWhitelist.whitelist", null, true,
|
||||||
new HashMap<>() {{
|
new HashMap<>() {{
|
||||||
put(T2CLanguageEnum.english, List.of());
|
put(T2C_LanguageEnum.english, List.of());
|
||||||
put(T2CLanguageEnum.german, List.of());
|
put(T2C_LanguageEnum.german, List.of());
|
||||||
}}),
|
}}),
|
||||||
player1name("permissionWhitelist.whitelist.player1.name", "player1", false,
|
player1name("permissionWhitelist.whitelist.player1.name", "player1", false,
|
||||||
new HashMap<>()),
|
new HashMap<>()),
|
||||||
@ -67,9 +66,9 @@ public class PermissionWhitelist {
|
|||||||
private final String path;
|
private final String path;
|
||||||
private Object value;
|
private Object value;
|
||||||
private final boolean forceSet;
|
private final boolean forceSet;
|
||||||
private final HashMap<T2CLanguageEnum, List<String>> comments;
|
private final HashMap<T2C_LanguageEnum, List<String>> comments;
|
||||||
|
|
||||||
VALUES(String path, Object value, boolean forceSet, HashMap<T2CLanguageEnum, List<String>> comments) {
|
VALUES(String path, Object value, boolean forceSet, HashMap<T2C_LanguageEnum, List<String>> comments) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.forceSet = forceSet;
|
this.forceSet = forceSet;
|
||||||
@ -92,13 +91,13 @@ public class PermissionWhitelist {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<T2CLanguageEnum, List<String>> getComments() {
|
public HashMap<T2C_LanguageEnum, List<String>> getComments() {
|
||||||
return comments;
|
return comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLanguagePath() {
|
public String getLanguagePath() {
|
||||||
return null;
|
return Config.VALUES.language.getValue().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -107,22 +106,21 @@ public class PermissionWhitelist {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void set(boolean pluginStart) {
|
public static void set(boolean isReload) {
|
||||||
long long_ = System.currentTimeMillis();
|
File file = new File(Main.getPath(), "permissionWhitelist.yml");
|
||||||
T2CconfigWriter.createConfig(new File(Main.getPath(), "permissionWhitelist.yml"), VALUES.values(), Util.getConfigLogo());
|
T2C_ConfigWriter.createConfig(Util.getPrefix(), file, VALUES.values(), isReload, Util.getConfigLogo());
|
||||||
player();
|
getPlayer(file);
|
||||||
|
|
||||||
T2Ctemplate.setCenterAligned(Util.getPrefix(), "§2permissionWhitelist.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", pluginStart);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void player() {
|
private static void getPlayer(File file) {
|
||||||
ConfigurationSection section = (ConfigurationSection) VALUES.playerSection.getValue();
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
|
||||||
for (String key : section.getConfigurationSection("").getKeys(false)) {
|
for (String key : yamlConfiguration.getConfigurationSection(VALUES.playerSection.getPath()).getKeys(false)) {
|
||||||
String name = section.getString(key + ".name");
|
String name = yamlConfiguration.getString(VALUES.playerSection.getPath() + "." + key + ".name");
|
||||||
|
String uuid = yamlConfiguration.getString(VALUES.playerSection.getPath() + "." + key + ".uuid").replace("-", "");
|
||||||
PlayerObject playerObject = new PlayerObject(
|
PlayerObject playerObject = new PlayerObject(
|
||||||
name,
|
name,
|
||||||
section.getString(key + ".uuid").replace("-", ""));
|
uuid);
|
||||||
PlayerCache.getOpHashMap().put(name, playerObject);
|
PlayerCache.getOpHashMap().put(name, playerObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.t2code.opsecurity.events;
|
package net.t2code.opsecurity.events;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.opsecurity.check.OpCheck;
|
import net.t2code.opsecurity.check.OpCheck;
|
||||||
import net.t2code.opsecurity.check.PermissionCheck;
|
import net.t2code.opsecurity.check.PermissionCheck;
|
||||||
import net.t2code.opsecurity.config.config.Config;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.opsecurity.system.Permissions;
|
import net.t2code.opsecurity.system.Permissions;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
import net.t2code.t2codelib.SPIGOT.api.update.T2C_UpdateAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -23,7 +23,7 @@ public class Events implements Listener {
|
|||||||
if (!(boolean) Config.VALUES.notifyJoinWarning.getValue()) return;
|
if (!(boolean) Config.VALUES.notifyJoinWarning.getValue()) return;
|
||||||
for (Player notifyPlayer : Bukkit.getOnlinePlayers()) {
|
for (Player notifyPlayer : Bukkit.getOnlinePlayers()) {
|
||||||
if (!notifyPlayer.hasPermission(Permissions.notify)) continue;
|
if (!notifyPlayer.hasPermission(Permissions.notify)) continue;
|
||||||
T2Csend.player(notifyPlayer, msg);
|
T2C_Send.player(notifyPlayer, msg);
|
||||||
if ((boolean) Config.VALUES.notifySoundEnable.getValue()){
|
if ((boolean) Config.VALUES.notifySoundEnable.getValue()){
|
||||||
notifyPlayer.playSound(notifyPlayer.getLocation(), Sound.valueOf(Config.VALUES.notifySoundValue.getValue().toString()), 3, 1);
|
notifyPlayer.playSound(notifyPlayer.getLocation(), Sound.valueOf(Config.VALUES.notifySoundValue.getValue().toString()), 3, 1);
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ public class Events implements Listener {
|
|||||||
public void CommandSendEvent(PlayerCommandPreprocessEvent event) {
|
public void CommandSendEvent(PlayerCommandPreprocessEvent event) {
|
||||||
if (!(boolean) Config.VALUES.checkOnCommand.getValue()) return;
|
if (!(boolean) Config.VALUES.checkOnCommand.getValue()) return;
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
|
|
||||||
for (String s : (List<String>) Config.VALUES.checkOnCommandWhitelist.getValue()) {
|
for (String s : (List<String>) Config.VALUES.checkOnCommandWhitelist.getValue()) {
|
||||||
if (event.getMessage().startsWith("/" + s)) {
|
if (event.getMessage().startsWith("/" + s)) {
|
||||||
@ -46,7 +46,7 @@ public class Events implements Listener {
|
|||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
String debug2 = T2Cdebug.debugCode();
|
String debug2 = T2C_Debug.debugCode();
|
||||||
if (PermissionCheck.onCheck(player, false, debug2)) {
|
if (PermissionCheck.onCheck(player, false, debug2)) {
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -58,12 +58,12 @@ public class Events implements Listener {
|
|||||||
public void PlayerChatEvent(PlayerChatEvent event) {
|
public void PlayerChatEvent(PlayerChatEvent event) {
|
||||||
if (!(boolean) Config.VALUES.checkOnChat.getValue()) return;
|
if (!(boolean) Config.VALUES.checkOnChat.getValue()) return;
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
if (OpCheck.onCheck(player, false, debug)) {
|
if (OpCheck.onCheck(player, false, debug)) {
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
String debug2 = T2Cdebug.debugCode();
|
String debug2 = T2C_Debug.debugCode();
|
||||||
if (PermissionCheck.onCheck(player, false, debug2)) {
|
if (PermissionCheck.onCheck(player, false, debug2)) {
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -77,11 +77,11 @@ public class Events implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
if (OpCheck.onCheck(player, false, debug)) {
|
if (OpCheck.onCheck(player, false, debug)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
String debug2 = T2Cdebug.debugCode();
|
String debug2 = T2C_Debug.debugCode();
|
||||||
if (PermissionCheck.onCheck(player, false, debug2)) {
|
if (PermissionCheck.onCheck(player, false, debug2)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -96,9 +96,9 @@ public class Events implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String debug = T2Cdebug.debugCode();
|
String debug = T2C_Debug.debugCode();
|
||||||
OpCheck.onCheck(player, true, debug);
|
OpCheck.onCheck(player, true, debug);
|
||||||
String debug2 = T2Cdebug.debugCode();
|
String debug2 = T2C_Debug.debugCode();
|
||||||
PermissionCheck.onCheck(player, true, debug2);
|
PermissionCheck.onCheck(player, true, debug2);
|
||||||
}
|
}
|
||||||
}, 1L);
|
}, 1L);
|
||||||
@ -107,6 +107,6 @@ public class Events implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoinEvent(PlayerLoginEvent event) {
|
public void onJoinEvent(PlayerLoginEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
T2CupdateAPI.join(Main.getPlugin(), Util.getPrefix(), Permissions.updatemsg, player, Util.getSpigotID(), Util.getDiscord());
|
T2C_UpdateAPI.join(Main.getPlugin(), Util.getPrefix(), Permissions.updatemsg, player, Util.getSpigotID(), Util.getDiscord());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,9 @@ import net.t2code.opsecurity.enums.OpCommandRequest;
|
|||||||
import net.t2code.opsecurity.objects.PlayerCache;
|
import net.t2code.opsecurity.objects.PlayerCache;
|
||||||
import net.t2code.opsecurity.objects.PlayerObject;
|
import net.t2code.opsecurity.objects.PlayerObject;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.player.T2CnameHistory;
|
import net.t2code.t2codelib.SPIGOT.api.player.T2C_NameHistory;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -26,11 +26,11 @@ public class OpCommand implements Listener {
|
|||||||
if ((event.getCommand().toLowerCase().startsWith("op ") || event.getCommand().toLowerCase().startsWith("minecraft:op "))) {
|
if ((event.getCommand().toLowerCase().startsWith("op ") || event.getCommand().toLowerCase().startsWith("minecraft:op "))) {
|
||||||
switch (isNotOPWTL(event.getCommand())) {
|
switch (isNotOPWTL(event.getCommand())) {
|
||||||
case mustOnline:
|
case mustOnline:
|
||||||
T2Csend.sender(event.getSender(), Languages.VALUES.playerMustBeOnlineToOp.getValue().toString());
|
T2C_Send.sender(event.getSender(), Languages.VALUES.playerMustBeOnlineToOp.getValue().toString());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
case notWhitelisted:
|
case notWhitelisted:
|
||||||
T2Csend.sender(event.getSender(), Languages.VALUES.opWhitelistOpCommand.getValue());
|
T2C_Send.sender(event.getSender(), Languages.VALUES.opWhitelistOpCommand.getValue());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -43,11 +43,11 @@ public class OpCommand implements Listener {
|
|||||||
if ((event.getMessage().toLowerCase().startsWith("/op ") || event.getMessage().toLowerCase().startsWith("/minecraft:op "))) {
|
if ((event.getMessage().toLowerCase().startsWith("/op ") || event.getMessage().toLowerCase().startsWith("/minecraft:op "))) {
|
||||||
switch (isNotOPWTL(event.getMessage())) {
|
switch (isNotOPWTL(event.getMessage())) {
|
||||||
case mustOnline:
|
case mustOnline:
|
||||||
T2Csend.player(event.getPlayer(), Languages.VALUES.playerMustBeOnlineToOp.getValue().toString());
|
T2C_Send.player(event.getPlayer(), Languages.VALUES.playerMustBeOnlineToOp.getValue().toString());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
case notWhitelisted:
|
case notWhitelisted:
|
||||||
T2Csend.player(event.getPlayer(), Languages.VALUES.opWhitelistOpCommand.getValue().toString());
|
T2C_Send.player(event.getPlayer(), Languages.VALUES.opWhitelistOpCommand.getValue().toString());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class OpCommand implements Listener {
|
|||||||
targetUUID = target.getUniqueId().toString();
|
targetUUID = target.getUniqueId().toString();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
targetUUID = T2CnameHistory.NameLookup.getPlayerUUID(arg);
|
targetUUID = T2C_NameHistory.NameLookup.getPlayerUUID(arg);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@ -80,13 +80,13 @@ public class OpCommand implements Listener {
|
|||||||
|
|
||||||
private static Boolean opWhitelist(String playerName, String playerUuid) {
|
private static Boolean opWhitelist(String playerName, String playerUuid) {
|
||||||
for (Map.Entry<String, PlayerObject> playerObject : PlayerCache.getOpHashMap().entrySet()) {
|
for (Map.Entry<String, PlayerObject> playerObject : PlayerCache.getOpHashMap().entrySet()) {
|
||||||
T2Cdebug.debug(Main.getPlugin(), "--------- " + playerName);
|
T2C_Debug.debug(Main.getPlugin(), "--------- " + playerName);
|
||||||
T2Cdebug.debug(Main.getPlugin(),"opWhitelist (op command) playerObject Name: "+playerObject.getValue().playerName );
|
T2C_Debug.debug(Main.getPlugin(),"opWhitelist (op command) playerObject Name: "+playerObject.getValue().playerName );
|
||||||
T2Cdebug.debug(Main.getPlugin(),"opWhitelist (op command) Player Name: "+ playerName );
|
T2C_Debug.debug(Main.getPlugin(),"opWhitelist (op command) Player Name: "+ playerName );
|
||||||
T2Cdebug.debug(Main.getPlugin(),"opWhitelist (op command) playerObject UUID: "+playerObject.getValue().uuid );
|
T2C_Debug.debug(Main.getPlugin(),"opWhitelist (op command) playerObject UUID: "+playerObject.getValue().uuid );
|
||||||
T2Cdebug.debug(Main.getPlugin(),"opWhitelist (op command) Player UUID: "+ playerUuid );
|
T2C_Debug.debug(Main.getPlugin(),"opWhitelist (op command) Player UUID: "+ playerUuid );
|
||||||
if (playerObject.getValue().playerName.equals(playerName) && playerObject.getValue().uuid.equals(playerUuid.replace("-", ""))) {
|
if (playerObject.getValue().playerName.equals(playerName) && playerObject.getValue().uuid.equals(playerUuid.replace("-", ""))) {
|
||||||
T2Cdebug.debug(Main.getPlugin(),"opWhitelist (op command) on list!");
|
T2C_Debug.debug(Main.getPlugin(),"opWhitelist (op command) on list!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
package net.t2code.opsecurity.events;
|
package net.t2code.opsecurity.events;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.opsecurity.system.Main;
|
import net.t2code.opsecurity.system.Main;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
@ -20,7 +20,7 @@ public class PlugManCommand implements Listener {
|
|||||||
|| (event.getCommand().toLowerCase().contains("plugman restart") && event.getCommand().toLowerCase().contains(Main.getPlugin().getDescription().getName().toLowerCase()))
|
|| (event.getCommand().toLowerCase().contains("plugman restart") && event.getCommand().toLowerCase().contains(Main.getPlugin().getDescription().getName().toLowerCase()))
|
||||||
) {
|
) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
T2Csend.console(Util.getPrefix() + " §4OPSecurity cannot be deactivated!");
|
T2C_Send.console(Util.getPrefix() + " §4OPSecurity cannot be deactivated!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class PlugManCommand implements Listener {
|
|||||||
|| (event.getMessage().toLowerCase().startsWith("/plugman restart") && event.getMessage().toLowerCase().contains(Main.getPlugin().getDescription().getName().toLowerCase()))
|
|| (event.getMessage().toLowerCase().startsWith("/plugman restart") && event.getMessage().toLowerCase().contains(Main.getPlugin().getDescription().getName().toLowerCase()))
|
||||||
) {
|
) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
T2Csend.player(event.getPlayer(), Util.getPrefix() + " §4OPSecurity cannot be deactivated!");
|
T2C_Send.player(event.getPlayer(), Util.getPrefix() + " §4OPSecurity cannot be deactivated!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package net.t2code.opsecurity.system;
|
package net.t2code.opsecurity.system;
|
||||||
|
|
||||||
import net.t2code.opsecurity.events.Events;
|
import net.t2code.opsecurity.events.Events;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
@ -19,7 +20,7 @@ public class BungeeSenderReceiver implements PluginMessageListener {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
player.sendPluginMessage(Main.getPlugin(), "t2c:opsec", stream.toByteArray());
|
player.sendPluginMessage(Main.getPlugin(), T2C_Util.getPluginChannel_OPSecurity(), stream.toByteArray());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,11 +28,11 @@ public class BungeeSenderReceiver implements PluginMessageListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||||
T2Cdebug.debug(Main.getPlugin(), "stream: " + stream.toString());
|
T2C_Debug.debug(Main.getPlugin(), "stream: " + stream.toString());
|
||||||
try {
|
try {
|
||||||
String subChannel = stream.readUTF();
|
String subChannel = stream.readUTF();
|
||||||
String information = stream.readUTF();
|
String information = stream.readUTF();
|
||||||
if (subChannel.equals("T2Cconsole")) {
|
if (subChannel.equals(T2C_Util.getPluginSubChannel_Console())) {
|
||||||
Events.notifyPlayer(information);
|
Events.notifyPlayer(information);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.t2code.opsecurity.system;
|
package net.t2code.opsecurity.system;
|
||||||
|
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
|
import net.t2code.opsecurity.check.Timer;
|
||||||
import net.t2code.opsecurity.command.CmdExecuter;
|
import net.t2code.opsecurity.command.CmdExecuter;
|
||||||
import net.t2code.opsecurity.config.config.Config;
|
import net.t2code.opsecurity.config.config.Config;
|
||||||
import net.t2code.opsecurity.config.config.Converter;
|
import net.t2code.opsecurity.config.config.Converter;
|
||||||
@ -10,13 +11,12 @@ import net.t2code.opsecurity.config.permissionWhitelist.PermissionWhitelist;
|
|||||||
import net.t2code.opsecurity.events.Events;
|
import net.t2code.opsecurity.events.Events;
|
||||||
import net.t2code.opsecurity.events.OpCommand;
|
import net.t2code.opsecurity.events.OpCommand;
|
||||||
import net.t2code.opsecurity.events.PlugManCommand;
|
import net.t2code.opsecurity.events.PlugManCommand;
|
||||||
import net.t2code.opsecurity.check.Timer;
|
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.t2codelib.SPIGOT.api.register.T2C_Register;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.register.T2Cregister;
|
import net.t2code.t2codelib.SPIGOT.api.update.T2C_UpdateAPI;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
import net.t2code.t2codelib.SPIGOT.system.config.config.T2C_LibConfig;
|
||||||
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
import net.t2code.t2codelib.SPIGOT.system.config.config.T2CLibConfig;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -25,7 +25,7 @@ import java.util.logging.Level;
|
|||||||
public class Load {
|
public class Load {
|
||||||
|
|
||||||
public static void onLoad(Main plugin, List<String> autor, String version) {
|
public static void onLoad(Main plugin, List<String> autor, String version) {
|
||||||
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
long long_ = T2C_Template.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
try {
|
try {
|
||||||
Converter.convert();
|
Converter.convert();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@ -33,26 +33,25 @@ public class Load {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.set(true);
|
Config.set(false);
|
||||||
|
Languages.set(false);
|
||||||
Languages.set(true);
|
OPWhitelist.set(false);
|
||||||
OPWhitelist.set(true);
|
PermissionWhitelist.set(false);
|
||||||
PermissionWhitelist.set(true);
|
|
||||||
|
|
||||||
plugin.getCommand("t2c-opsecurity").setExecutor(new CmdExecuter());
|
plugin.getCommand("t2c-opsecurity").setExecutor(new CmdExecuter());
|
||||||
|
|
||||||
T2Cregister.listener(new OpCommand(), plugin);
|
T2C_Register.listener(new OpCommand(), plugin);
|
||||||
T2Cregister.listener(new PlugManCommand(), plugin);
|
T2C_Register.listener(new PlugManCommand(), plugin);
|
||||||
T2Cregister.listener(new Events(), plugin);
|
T2C_Register.listener(new Events(), plugin);
|
||||||
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
|
if ((boolean) T2C_LibConfig.VALUES.proxy.getValue()) {
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:opsec");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, T2C_Util.getPluginChannel_OPSecurity());
|
||||||
T2Csend.debug(plugin, "registerIncomingPluginChannel §et2c:opsec");
|
T2C_Debug.debug(plugin, "registerIncomingPluginChannel §e:" + T2C_Util.getPluginChannel_OPSecurity());
|
||||||
}
|
}
|
||||||
Timer.refreshTimer();
|
Timer.refreshTimer();
|
||||||
Permissions.register();
|
Permissions.register();
|
||||||
T2CupdateAPI.onUpdateCheck(plugin, Util.getPrefix(), Util.getGit(), Util.getSpigotID(), Util.getDiscord(), (boolean) Config.VALUES.updateCheckOnJoin.getValue(),
|
T2C_UpdateAPI.onUpdateCheck(plugin, Util.getPrefix(), Util.getGit(), Util.getSpigotID(), Util.getDiscord(), (boolean) Config.VALUES.updateCheckOnJoin.getValue(),
|
||||||
(boolean) Config.VALUES.updateCheckSeePreReleaseUpdates.getValue(), (int) Config.VALUES.updateCheckTimeInterval.getValue());
|
(boolean) Config.VALUES.updateCheckSeePreReleaseUpdates.getValue(), (int) Config.VALUES.updateCheckTimeInterval.getValue());
|
||||||
Metrics.Bstats(plugin, Util.getBstatsID());
|
Metrics.Bstats(plugin, Util.getBstatsID());
|
||||||
T2Ctemplate.onLoadFooter(Util.getPrefix(), long_);
|
T2C_Template.onLoadFooter(Util.getPrefix(), long_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.t2code.opsecurity.system;
|
package net.t2code.opsecurity.system;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.t2code.opsecurity.Util;
|
import net.t2code.opsecurity.util.Util;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ public final class Main extends JavaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// Plugin shutdown logic
|
// Plugin shutdown logic
|
||||||
if (t2codeLib) T2Ctemplate.onDisable(Util.getPrefix(),plugin);
|
if (t2codeLib) T2C_Template.onDisable(Util.getPrefix(),plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Boolean pluginNotFound(String pl, Integer spigotID, String ver) {
|
private static Boolean pluginNotFound(String pl, Integer spigotID, String ver) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package net.t2code.opsecurity.system;
|
package net.t2code.opsecurity.system;
|
||||||
|
|
||||||
import net.t2code.t2codelib.SPIGOT.api.register.T2Cregister;
|
import net.t2code.t2codelib.SPIGOT.api.register.T2C_Register;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
|
|
||||||
public class Permissions {
|
public class Permissions {
|
||||||
@ -16,17 +16,17 @@ public class Permissions {
|
|||||||
public static final PermissionDefault notOp = PermissionDefault.NOT_OP;
|
public static final PermissionDefault notOp = PermissionDefault.NOT_OP;
|
||||||
|
|
||||||
protected static void register() {
|
protected static void register() {
|
||||||
T2Cregister.permission(notify, op, Main.getPlugin());
|
T2C_Register.permission(notify, op, Main.getPlugin());
|
||||||
T2Cregister.permissionDescription(notify,"Players with this permission get the update message when joining if an update is available",Main.getPlugin());
|
T2C_Register.permissionDescription(notify,"Players with this permission get the update message when joining if an update is available",Main.getPlugin());
|
||||||
T2Cregister.permission(updatemsg, op, Main.getPlugin());
|
T2C_Register.permission(updatemsg, op, Main.getPlugin());
|
||||||
T2Cregister.permission(reload, op, Main.getPlugin());
|
T2C_Register.permission(reload, op, Main.getPlugin());
|
||||||
T2Cregister.permission(info, op, Main.getPlugin());
|
T2C_Register.permission(info, op, Main.getPlugin());
|
||||||
T2Cregister.permission(help, op, Main.getPlugin());
|
T2C_Register.permission(help, op, Main.getPlugin());
|
||||||
|
|
||||||
T2Cregister.permission(admin, op, notify, true, Main.getPlugin());
|
T2C_Register.permission(admin, op, notify, true, Main.getPlugin());
|
||||||
T2Cregister.permission(admin, op, updatemsg, true, Main.getPlugin());
|
T2C_Register.permission(admin, op, updatemsg, true, Main.getPlugin());
|
||||||
T2Cregister.permission(admin, op, reload, true, Main.getPlugin());
|
T2C_Register.permission(admin, op, reload, true, Main.getPlugin());
|
||||||
T2Cregister.permission(admin, op, info, true, Main.getPlugin());
|
T2C_Register.permission(admin, op, info, true, Main.getPlugin());
|
||||||
T2Cregister.permission(admin, op, help, true, Main.getPlugin());
|
T2C_Register.permission(admin, op, help, true, Main.getPlugin());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.t2code.opsecurity;
|
package net.t2code.opsecurity.util;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import net.t2code.t2codelib.util.T2C_Util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -26,13 +27,13 @@ public class Util {
|
|||||||
private static Integer bstatsID = 10858;
|
private static Integer bstatsID = 10858;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static String spigot = "https://www.spigotmc.org/resources/" + getSpigotID();
|
private static String spigot = "https://spigotmc.org/resources/" + getSpigotID();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static String discord = "http://dc.t2code.net";
|
private static String discord = "http://dc.t2code.net";
|
||||||
|
|
||||||
public static String[] getConfigLogo() {
|
public static String[] getConfigLogo() {
|
||||||
ArrayList<String> arrayList = new ArrayList<>(net.t2code.t2codelib.Util.getConfigT2CodeLogo());
|
ArrayList<String> arrayList = new ArrayList<>(T2C_Util.getConfigT2CodeLogo());
|
||||||
arrayList.addAll(Arrays.asList("", "# Spigot: " + spigot));
|
arrayList.addAll(Arrays.asList("", "# Spigot: " + spigot));
|
||||||
return arrayList.toArray(new String[0]);
|
return arrayList.toArray(new String[0]);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user