0

Denied regex wildcard (.*) as an alias key

This commit is contained in:
Pepich 2017-02-06 22:52:38 +01:00
parent 12c0be8202
commit a2f730a77c

View File

@ -26,7 +26,7 @@ import com.redstoner.misc.Utils;
import com.redstoner.modules.Module;
@AutoRegisterListener
@Version(major = 1, minor = 0, revision = 0, compatible = 1)
@Version(major = 1, minor = 0, revision = 1, compatible = 1)
public class Chatalias implements Module, Listener
{
// to export chatalias data to json:
@ -180,6 +180,11 @@ public class Chatalias implements Module, Listener
@Command(hook = "addalias")
public boolean addAlias(CommandSender sender, boolean regex, String keyword, String replacement)
{
if (keyword.equals(".*"))
{
Utils.sendErrorMessage(sender, null, "You may not define the wildcard regex as an alias.");
return true;
}
Player player = (Player) sender;
UUID uuid = player.getUniqueId();
JSONObject data = (JSONObject) aliases.get(uuid.toString());