mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-17 04:41:40 +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
|
* @param name the name to set
|
||||||
*/
|
*/
|
||||||
public Blueprint setName(String name) {
|
public Blueprint setName(@NonNull String name) {
|
||||||
this.name = name;
|
// Force lowercase
|
||||||
|
this.name = name.toLowerCase(Locale.ENGLISH);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -508,7 +508,7 @@ public class BlueprintsManager {
|
|||||||
}
|
}
|
||||||
File bpf = getBlueprintsFolder(addon);
|
File bpf = getBlueprintsFolder(addon);
|
||||||
// Get the filename
|
// 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
|
// Delete the old file
|
||||||
try {
|
try {
|
||||||
Files.deleteIfExists(fileName.toPath());
|
Files.deleteIfExists(fileName.toPath());
|
||||||
@ -516,10 +516,9 @@ public class BlueprintsManager {
|
|||||||
plugin.logError("Could not delete old Blueprint " + e.getLocalizedMessage());
|
plugin.logError("Could not delete old Blueprint " + e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
// Set new name
|
// Set new name
|
||||||
bp.setName(name);
|
bp.setName(name.toLowerCase(Locale.ENGLISH));
|
||||||
// Save it
|
// Save it
|
||||||
saveBlueprint(addon, bp);
|
saveBlueprint(addon, bp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user