Compare commits
No commits in common. "d9e6ba508932e3ac35a3895c9cf8e8a82a5c2a0a" and "8f19f7e49b688b5265891a5288c3e54d152c6d01" have entirely different histories.
d9e6ba5089
...
8f19f7e49b
@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels:
|
|
||||||
- "bug report"
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Description of issue:**
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Plugin Version (using`/opsecurity info`):**
|
|
||||||
|
|
||||||
**Server Type (Spigot/Paperspigot/etc):**
|
|
||||||
|
|
||||||
**Server Version (using `/ver`):**
|
|
||||||
|
|
||||||
**Relevant plugins (Delete if this isn't needed):**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**ERROR (DELETE IF YOU HAVE NO ERROR):**
|
|
||||||
```
|
|
||||||
######################
|
|
||||||
## REPLACE WITH ERROR ##
|
|
||||||
######################
|
|
||||||
```
|
|
||||||
|
|
||||||
**CONFIG SECTION (DELETE IF NOT RELEVANT):**
|
|
||||||
```
|
|
||||||
#######################################
|
|
||||||
## REPLACE WITH RELEVANT CONFIG SECTION ##
|
|
||||||
#######################################
|
|
||||||
```
|
|
@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea/improvement
|
|
||||||
title: ''
|
|
||||||
labels:
|
|
||||||
- " feature request"
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Description of feature request:**
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Plugin Version (using`/opsecurity info`):**
|
|
||||||
|
|
||||||
**Server Type (Spigot/Paperspigot/etc):**
|
|
||||||
|
|
||||||
**Server Version (using `/ver`):**
|
|
||||||
|
|
||||||
**Relevant plugins (Delete if this isn't needed):**
|
|
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: Ask a question or get advice
|
|
||||||
title: ''
|
|
||||||
labels:
|
|
||||||
- question
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Share your question here:**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Plugin Version (using`/opsecurity info`):**
|
|
||||||
|
|
||||||
**Server Type (Spigot/Paperspigot/etc):**
|
|
||||||
|
|
||||||
**Server Version (using `/ver`):**
|
|
||||||
|
|
||||||
**Relevant plugins (Delete if this isn't needed):**
|
|
||||||
|
|
||||||
---
|
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>de.jatitv</groupId>
|
<groupId>de.jatitv</groupId>
|
||||||
<artifactId>OPSecurity</artifactId>
|
<artifactId>OPSecurity</artifactId>
|
||||||
<version>2.3.6_Snapshot_3</version>
|
<version>2.3.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>OPSecurity</name>
|
<name>OPSecurity</name>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// This claas was created by JaTiTV
|
// This claas was created by JaTiTV
|
||||||
|
|
||||||
|
|
||||||
package de.jatitv.opsecurity.cmdManagement;
|
package de.jatitv.opsecurity.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.opsecurity.config.config.SelectConfig;
|
import de.jatitv.opsecurity.config.config.SelectConfig;
|
||||||
@ -15,6 +16,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class CmdExecuter implements CommandExecutor, TabCompleter {
|
public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,8 +38,8 @@ public class Commands {
|
|||||||
public static void reload(CommandSender sender) {
|
public static void reload(CommandSender sender) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
if (Main.opHashMap.containsKey(player.getName().toLowerCase())) {
|
if (Main.opHashMap.containsKey(player.getName())) {
|
||||||
if (Main.opHashMap.get(player.getName().toLowerCase()).UUID.equals(player.getUniqueId().toString().replace("-", ""))) {
|
if (Main.opHashMap.get(player.getName()).UUID.equals(player.getUniqueId().toString().replace("-", ""))) {
|
||||||
send.player(player, SelectMessages.ReloadStart);
|
send.player(player, SelectMessages.ReloadStart);
|
||||||
Bukkit.getConsoleSender().sendMessage(Main.Prefix + "§8-------------------------------");
|
Bukkit.getConsoleSender().sendMessage(Main.Prefix + "§8-------------------------------");
|
||||||
Bukkit.getConsoleSender().sendMessage(Main.Prefix + "§6Plugin reload...");
|
Bukkit.getConsoleSender().sendMessage(Main.Prefix + "§6Plugin reload...");
|
||||||
|
@ -105,7 +105,7 @@ public class SelectConfig {
|
|||||||
PlayerObject player = new PlayerObject(
|
PlayerObject player = new PlayerObject(
|
||||||
yamlConfiguration.getString("OP_Whitelist.Whitelist." + key + ".UUID").replace("-",""));
|
yamlConfiguration.getString("OP_Whitelist.Whitelist." + key + ".UUID").replace("-",""));
|
||||||
opWhitelist.add(player);
|
opWhitelist.add(player);
|
||||||
Main.opHashMap.put(key.toLowerCase(), player);
|
Main.opHashMap.put(key, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
no_OP_Player_deop = yamlConfiguration.getBoolean("OP_Whitelist.noOpPlayerDeop.Enable");
|
no_OP_Player_deop = yamlConfiguration.getBoolean("OP_Whitelist.noOpPlayerDeop.Enable");
|
||||||
@ -121,7 +121,7 @@ public class SelectConfig {
|
|||||||
PlayerObject player = new PlayerObject(
|
PlayerObject player = new PlayerObject(
|
||||||
yamlConfiguration.getString("Permission_Whitelist.Whitelist." + key + ".UUID").replace("-",""));
|
yamlConfiguration.getString("Permission_Whitelist.Whitelist." + key + ".UUID").replace("-",""));
|
||||||
permWhitelist.add(player);
|
permWhitelist.add(player);
|
||||||
Main.permissionHashMap.put(key.toLowerCase(), player);
|
Main.permissionHashMap.put(key, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerWhithPermission_kick = yamlConfiguration.getBoolean("Permission_Whitelist.PlayerWhithPermission_kick");
|
PlayerWhithPermission_kick = yamlConfiguration.getBoolean("Permission_Whitelist.PlayerWhithPermission_kick");
|
||||||
|
@ -105,7 +105,7 @@ public class Check {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SelectConfig.PlayerWhithPermission_kick && SelectConfig.Perm_Command_enable) {
|
if (SelectConfig.PlayerWhithPermission_kick && SelectConfig.Perm_Command_enable){
|
||||||
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(SelectMessages.Perm_kick)));
|
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(SelectMessages.Perm_kick)));
|
||||||
send.console(Replace.replace(SelectMessages.Perm_consoleKick.replace("[player]",
|
send.console(Replace.replace(SelectMessages.Perm_consoleKick.replace("[player]",
|
||||||
player.getName()).replace("[perm]", s)));
|
player.getName()).replace("[perm]", s)));
|
||||||
@ -116,7 +116,7 @@ public class Check {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (SelectConfig.PlayerWhithPermission_kick) {
|
if (SelectConfig.PlayerWhithPermission_kick) {
|
||||||
Cmd.console(SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(SelectMessages.Perm_kick)));
|
Cmd.console( SelectConfig.KickCommand.replace("[player]", player.getName()).replace("[reason]", Replace.replace(SelectMessages.Perm_kick)));
|
||||||
send.console(Replace.replace(SelectMessages.Perm_consoleKick.replace("[player]",
|
send.console(Replace.replace(SelectMessages.Perm_consoleKick.replace("[player]",
|
||||||
player.getName()).replace("[perm]", s)));
|
player.getName()).replace("[perm]", s)));
|
||||||
return true;
|
return true;
|
||||||
@ -136,16 +136,16 @@ public class Check {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Boolean opWhitelist(Player player) {
|
private static Boolean opWhitelist(Player player) {
|
||||||
if (Main.opHashMap.containsKey(player.getName().toLowerCase())) {
|
if (Main.opHashMap.containsKey(player.getName())) {
|
||||||
if (Main.opHashMap.get(player.getName().toLowerCase()).UUID.equals(player.getUniqueId().toString().replace("-", ""))) {
|
if (Main.opHashMap.get(player.getName()).UUID.equals(player.getUniqueId().toString().replace("-", ""))) {
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Boolean permWhitelist(Player player) {
|
private static Boolean permWhitelist(Player player) {
|
||||||
if (Main.permissionHashMap.containsKey(player.getName().toLowerCase())) {
|
if (Main.permissionHashMap.containsKey(player.getName())) {
|
||||||
if (Main.permissionHashMap.get(player.getName().toLowerCase()).UUID.equals(player.getUniqueId().toString().replace("-", ""))) {
|
if (Main.permissionHashMap.get(player.getName()).UUID.equals(player.getUniqueId().toString().replace("-",""))) {
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
} else return false;
|
} else return false;
|
||||||
|
@ -24,25 +24,27 @@ public class OPCommand implements Listener {
|
|||||||
if (command.charAt(0) == '/') command = command.replaceFirst("/", "");
|
if (command.charAt(0) == '/') command = command.replaceFirst("/", "");
|
||||||
String arg = command.replace("op ", "");
|
String arg = command.replace("op ", "");
|
||||||
|
|
||||||
|
|
||||||
|
String targetUUID = null;
|
||||||
|
|
||||||
if (SelectConfig.PlayerMustBeOnlineToOp) {
|
if (SelectConfig.PlayerMustBeOnlineToOp) {
|
||||||
if (Main.opHashMap.containsKey(arg.toLowerCase())) {
|
if (Main.opHashMap.containsKey(arg)) {
|
||||||
Player target = Bukkit.getPlayer(arg);
|
Player target = Bukkit.getPlayer(arg);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (Main.opHashMap.get(target.getName().toLowerCase()).UUID.equals(target.getUniqueId().toString().replace("-", ""))) {
|
if (Main.opHashMap.get(target.getName()).UUID.equals(target.getUniqueId().toString().replace("-", ""))) {
|
||||||
return 0;
|
return 0;
|
||||||
} else return 2;
|
} else return 2;
|
||||||
} else return 2;
|
} else return 2;
|
||||||
} else {
|
} else {
|
||||||
if (Main.opHashMap.containsKey(arg.toLowerCase())) {
|
if (Main.opHashMap.containsKey(arg)) {
|
||||||
String targetUUID = null;
|
|
||||||
try {
|
try {
|
||||||
targetUUID = NameHistory.getPlayerUUID(arg);
|
targetUUID = NameHistory.getPlayerUUID(arg);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (Main.opHashMap.get(arg.toLowerCase()).UUID.equals(targetUUID)) {
|
if (Main.opHashMap.get(arg).UUID.equals(targetUUID)) {
|
||||||
return 0;
|
return 0;
|
||||||
} else return 2;
|
} else return 2;
|
||||||
} else return 2;
|
} else return 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user