mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 11:15:24 +01:00
Force the Blueprint name to be lowercased using English locale
This commit is contained in:
parent
94ff2ebf75
commit
27647da6f4
@ -56,8 +56,9 @@ public class Blueprint {
|
||||
/**
|
||||
* @param name the name to set
|
||||
*/
|
||||
public Blueprint setName(String name) {
|
||||
this.name = name;
|
||||
public Blueprint setName(@NonNull String name) {
|
||||
// Force lowercase
|
||||
this.name = name.toLowerCase(Locale.ENGLISH);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
|
@ -508,7 +508,7 @@ public class BlueprintsManager {
|
||||
}
|
||||
File bpf = getBlueprintsFolder(addon);
|
||||
// Get the filename
|
||||
File fileName = new File(bpf, bp.getName().toLowerCase(Locale.ENGLISH) + BLUEPRINT_SUFFIX);
|
||||
File fileName = new File(bpf, bp.getName() + BLUEPRINT_SUFFIX);
|
||||
// Delete the old file
|
||||
try {
|
||||
Files.deleteIfExists(fileName.toPath());
|
||||
@ -516,10 +516,9 @@ public class BlueprintsManager {
|
||||
plugin.logError("Could not delete old Blueprint " + e.getLocalizedMessage());
|
||||
}
|
||||
// Set new name
|
||||
bp.setName(name);
|
||||
bp.setName(name.toLowerCase(Locale.ENGLISH));
|
||||
// Save it
|
||||
saveBlueprint(addon, bp);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user