mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-24 14:33:51 +00:00
Better handle invalid warp names
This commit is contained in:
parent
732dc3bf34
commit
147a2fc227
5 changed files with 26 additions and 9 deletions
|
@ -161,7 +161,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
|||
public void setHome(String name, Location loc)
|
||||
{
|
||||
//Invalid names will corrupt the yaml
|
||||
name = Util.sanitizeFileName(name);
|
||||
name = Util.safeString(name);
|
||||
homes.put(name, loc);
|
||||
config.setProperty("homes." + name, loc);
|
||||
config.save();
|
||||
|
@ -172,7 +172,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
|||
String search = getHomeName(name);
|
||||
if (!homes.containsKey(search))
|
||||
{
|
||||
search = Util.sanitizeFileName(search);
|
||||
search = Util.safeString(search);
|
||||
}
|
||||
if (homes.containsKey(search))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue