Fixed upper case quest names breaking bossbars.
This commit is contained in:
parent
2409103b3e
commit
410a825681
|
|
@ -21,10 +21,10 @@ public class AutoHideBossBar {
|
||||||
private final BossBar bossBar;
|
private final BossBar bossBar;
|
||||||
|
|
||||||
public AutoHideBossBar(Player player, Variant variant, String part, String title, BarColor barColor) throws Exception {
|
public AutoHideBossBar(Player player, Variant variant, String part, String title, BarColor barColor) throws Exception {
|
||||||
NamespacedKey namespacedKeyOne = NamespacedKey.fromString(player.getUniqueId() + variant.getInternalName() + part, AQuest.getInstance());
|
NamespacedKey namespacedKeyOne = NamespacedKey.fromString(player.getUniqueId() + variant.getInternalName().toLowerCase() + part, AQuest.getInstance());
|
||||||
if (namespacedKeyOne == null) {
|
if (namespacedKeyOne == null) {
|
||||||
Logger.warning("Unable to create nameSpacedKey with suffix % for quest for %", part, player.getName());
|
Logger.warning("Unable to create nameSpacedKey with suffix % for quest for %", part, player.getName());
|
||||||
throw new Exception("Failed to create namespace key"); //quest names containing upper case letters can cause this
|
throw new Exception("Failed to create namespace key");
|
||||||
}
|
}
|
||||||
this.bossBar = Bukkit.createBossBar(
|
this.bossBar = Bukkit.createBossBar(
|
||||||
namespacedKeyOne,
|
namespacedKeyOne,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user