Makes Blueprint Bundle uniqueIds case insensitive

This actually makes them always lowercase in the code.
The previous approach of using a case insensitive TreeMap was not
possible because it could not handle null values, which could occur if
the bundle had no blueprint set for a specific world environment. This
approach was the easiest and most straightforward.

The assumption here is that the admin was changing the unique name of
the blueprint bundle in the JSON file.

https://github.com/BentoBoxWorld/BentoBox/issues/865
This commit is contained in:
tastybento 2019-07-27 20:01:02 -07:00
parent 65aee40533
commit a5393b117a

View File

@ -3,6 +3,7 @@ package world.bentobox.bentobox.blueprints.dataobjects;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.bukkit.Material;
@ -68,7 +69,7 @@ public class BlueprintBundle implements DataObject {
*/
@Override
public String getUniqueId() {
return uniqueId;
return uniqueId.toLowerCase(Locale.ENGLISH);
}
/**
* @param uniqueId the uniqueId to set