From 618d5c5ecb38e8300f753e4fd5cd8b59ad71d370 Mon Sep 17 00:00:00 2001 From: spacerocket62 Date: Sun, 1 Aug 2021 01:08:50 -0700 Subject: [PATCH] FS-308: Should fix invalid names by checking if the name matches the A-z regex and if the name's length is between 3-16 --- .../totalfreedom/totalfreedommod/command/Command_cage.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cage.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cage.java index c7992547..0a235a53 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cage.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_cage.java @@ -67,6 +67,11 @@ public class Command_cage extends FreedomCommand outerMaterial = Material.PLAYER_HEAD; if (args.length >= 3) { + if (!args[2].matches("([A-z]*)") || args[2].length() < 3 || args[2].length() > 16) + { + msg("Invalid name!", ChatColor.RED); + return true; + } skullName = args[2]; } else