mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-22 03:11:55 +00:00
Update GM version to 1.7
GM now supports offline players without having to mantogglevalidate Added craftbukkit-1.0.0-SNAPSHOT.jar to lib (version 1587) Added bukkit-1.0.0-R1-SNAPSHOT.jar to lib (version 1065) Updated GM XML's to build using dev bukkit/CB build jars.
This commit is contained in:
parent
789a6b9540
commit
4b43453a74
|
@ -2,6 +2,7 @@
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
<classpathentry kind="lib" path="../lib/bukkit-0.0.1-SNAPSHOT.jar"/>
|
<classpathentry kind="lib" path="../lib/bukkit-1.0.0-R1-SNAPSHOT.jar"/>
|
||||||
<classpathentry kind="lib" path="../lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
|
<classpathentry kind="lib" path="C:/Users/Steve/git/Essentials/lib/craftbukkit-1.0.0-SNAPSHOT.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -39,11 +39,11 @@ dist.jar=${dist.dir}/EssentialsGroupManager.jar
|
||||||
dist.javadoc.dir=${dist.dir}/javadoc
|
dist.javadoc.dir=${dist.dir}/javadoc
|
||||||
endorsed.classpath=
|
endorsed.classpath=
|
||||||
excludes=
|
excludes=
|
||||||
file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
|
file.reference.craftbukkit-1.0.0-SNAPSHOT.jar=..\\lib\\craftbukkit-1.0.0-SNAPSHOT.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=true
|
jar.compress=true
|
||||||
javac.classpath=\
|
javac.classpath=\
|
||||||
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}
|
${file.reference.craftbukkit-1.0.0-SNAPSHOT.jar}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|
|
@ -80,3 +80,5 @@ v 1.6:
|
||||||
- Fix superperms to pass all tests http://dev.bukkit.org/server-mods/superpermstest/
|
- Fix superperms to pass all tests http://dev.bukkit.org/server-mods/superpermstest/
|
||||||
- Optimizations include changing the return of comparePermissionString.
|
- Optimizations include changing the return of comparePermissionString.
|
||||||
- Added file details in error messages for loading groups/users.
|
- Added file details in error messages for loading groups/users.
|
||||||
|
v 1.7:
|
||||||
|
- GM now supports offline players without having to mantogglevalidate
|
|
@ -16,6 +16,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
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;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -30,6 +31,7 @@ import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||||
import org.anjocaido.groupmanager.utils.Tasks;
|
import org.anjocaido.groupmanager.utils.Tasks;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
|
@ -325,7 +327,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
PermissionCheckResult permissionResult = null;
|
PermissionCheckResult permissionResult = null;
|
||||||
ArrayList<User> removeList = null;
|
ArrayList<User> removeList = null;
|
||||||
String auxString = null;
|
String auxString = null;
|
||||||
List<Player> match = null;
|
List<String> match = null;
|
||||||
User auxUser = null;
|
User auxUser = null;
|
||||||
Group auxGroup = null;
|
Group auxGroup = null;
|
||||||
Group auxGroup2 = null;
|
Group auxGroup2 = null;
|
||||||
|
@ -373,15 +375,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -427,15 +426,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -467,15 +463,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -509,15 +502,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub <user> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub <user> <group>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -596,15 +586,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -664,15 +651,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -719,16 +703,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
} else
|
|
||||||
targetPlayer = this.getServer().getPlayer(match.get(0).getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -765,6 +745,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
// bukkit perms
|
// bukkit perms
|
||||||
if ((args.length == 2) && (args[1].equalsIgnoreCase("+"))) {
|
if ((args.length == 2) && (args[1].equalsIgnoreCase("+"))) {
|
||||||
|
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||||
if (targetPlayer != null) {
|
if (targetPlayer != null) {
|
||||||
sender.sendMessage(ChatColor.YELLOW + "Superperms reports: ");
|
sender.sendMessage(ChatColor.YELLOW + "Superperms reports: ");
|
||||||
for (String line : BukkitPermissions.listPerms(targetPlayer))
|
for (String line : BukkitPermissions.listPerms(targetPlayer))
|
||||||
|
@ -786,19 +767,16 @@ public class GroupManager extends JavaPlugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
} else
|
|
||||||
targetPlayer = this.getServer().getPlayer(match.get(0).getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||||
// VALIDANDO PERMISSAO
|
// VALIDANDO PERMISSAO
|
||||||
permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]);
|
permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]);
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||||
|
@ -1089,15 +1067,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable> <value>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable> <value>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1124,15 +1099,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1155,15 +1127,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1192,15 +1160,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1359,15 +1323,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1393,15 +1353,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1431,15 +1387,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1613,15 +1565,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1673,15 +1621,11 @@ public class GroupManager extends JavaPlugin {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (validateOnlinePlayer) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
match = this.getServer().matchPlayer(args[0]);
|
|
||||||
if (match.size() != 1) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
auxUser = dataHolder.getUser(match.get(0).getName());
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
} else {
|
} else {
|
||||||
auxUser = dataHolder.getUser(args[0]);
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
}
|
}
|
||||||
|
@ -1842,6 +1786,42 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a List of players matching the name given. If none online, check
|
||||||
|
* Offline.
|
||||||
|
*
|
||||||
|
* @param playerName, sender
|
||||||
|
* @return true if a single match is found
|
||||||
|
*/
|
||||||
|
private List<String> validatePlayer(String playerName, CommandSender sender) {
|
||||||
|
|
||||||
|
List<Player> players = new ArrayList<Player>();
|
||||||
|
List<String> match = new ArrayList<String>();
|
||||||
|
|
||||||
|
players = this.getServer().matchPlayer(playerName);
|
||||||
|
if (players.isEmpty()) {
|
||||||
|
// Check for an offline player.
|
||||||
|
if (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName)))
|
||||||
|
match.add(playerName);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for (Player player : players) {
|
||||||
|
match.add(player.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match.isEmpty() || match == null) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||||
|
return null;
|
||||||
|
} else if (match.size() > 1) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Too many matches found! (" + match.toString() + ")");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return match;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the config
|
* @return the config
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: GroupManager
|
name: GroupManager
|
||||||
version: "1.6 (Phoenix)"
|
version: "1.7 (Phoenix)"
|
||||||
main: org.anjocaido.groupmanager.GroupManager
|
main: org.anjocaido.groupmanager.GroupManager
|
||||||
website: http://www.anjocaido.info/
|
website: http://www.anjocaido.info/
|
||||||
description: Provides on-the-fly system for permissions system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
description: Provides on-the-fly system for permissions system created by Nijikokun. But all in memory, and with flat-file saving schedule.
|
||||||
|
|
Loading…
Reference in a new issue