mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 08:05:20 +00:00
Prevent SILLY ADMINS from abusing /wildcard & /gcmd to do STUPID RECURSIVE things
This commit is contained in:
parent
f8790704c9
commit
d1e8f4d8fa
2 changed files with 14 additions and 4 deletions
|
@ -2,6 +2,7 @@ package me.StevenLawson.TotalFreedomMod.commands;
|
||||||
|
|
||||||
import me.StevenLawson.TotalFreedomMod.command.CommandBlocker;
|
import me.StevenLawson.TotalFreedomMod.command.CommandBlocker;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -15,6 +16,13 @@ public class Command_gcmd extends FreedomCommand {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String arguments = String.join(" ", args);
|
||||||
|
|
||||||
|
if (arguments.toLowerCase().contains("wildcard") || arguments.toLowerCase().contains("gcmd")) {
|
||||||
|
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
final Player player = getPlayer(args[0]);
|
final Player player = getPlayer(args[0]);
|
||||||
|
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
|
|
|
@ -16,21 +16,23 @@ public class Command_wildcard extends FreedomCommand {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].toLowerCase().contains("wildcard") || args[0].toLowerCase().contains("gcmd")) {
|
String arguments = String.join(" ", args);
|
||||||
|
|
||||||
|
if (arguments.toLowerCase().contains("wildcard") || arguments.toLowerCase().contains("gcmd")) {
|
||||||
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
|
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (args[0].toLowerCase().contains("gtfo"))
|
if (arguments.toLowerCase().contains("gtfo"))
|
||||||
{
|
{
|
||||||
playerMsg("Nice try", ChatColor.RED);
|
playerMsg("Nice try", ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (args[0].toLowerCase().contains("doom"))
|
if (arguments.toLowerCase().contains("doom"))
|
||||||
{
|
{
|
||||||
playerMsg("Look, we all hate people, but this is not the way to deal with it, doom is evil enough!", ChatColor.RED);
|
playerMsg("Look, we all hate people, but this is not the way to deal with it, doom is evil enough!", ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (args[0].toLowerCase().contains("saconfig"))
|
if (arguments.toLowerCase().contains("saconfig"))
|
||||||
{
|
{
|
||||||
playerMsg("WOA, WTF are you trying to do???", ChatColor.RED);
|
playerMsg("WOA, WTF are you trying to do???", ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue