forked from Upstream/mmocore
Allow for empty objective lores
This commit is contained in:
parent
ebf0d40fbf
commit
63c837be2c
@ -3,9 +3,9 @@ package net.Indyuce.mmocore.api.quest;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.boss.BarStyle;
|
||||
@ -173,7 +173,7 @@ public class PlayerQuests {
|
||||
}
|
||||
|
||||
public void updateBossBar() {
|
||||
if (!hasCurrent()) {
|
||||
if (!hasCurrent() || !current.getProgress().getObjective().hasLore()) {
|
||||
bossbar.setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
@ -1,18 +1,17 @@
|
||||
package net.Indyuce.mmocore.api.quest.objective;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import io.lumine.mythic.lib.api.MMOLineConfig;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.quest.ObjectiveProgress;
|
||||
import net.Indyuce.mmocore.api.quest.QuestProgress;
|
||||
import net.Indyuce.mmocore.api.quest.trigger.Trigger;
|
||||
import io.lumine.mythic.lib.api.MMOLineConfig;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public abstract class Objective {
|
||||
private final String id, lore;
|
||||
@ -24,7 +23,6 @@ public abstract class Objective {
|
||||
this.id = config.getName();
|
||||
this.lore = config.getString("lore");
|
||||
|
||||
Validate.notNull(lore, "Could not find objective lore");
|
||||
Validate.notNull(config.getStringList("triggers"), "Could not load trigger list");
|
||||
|
||||
String format = config.getString("bar-color", "PURPLE");
|
||||
@ -47,6 +45,10 @@ public abstract class Objective {
|
||||
return barColor;
|
||||
}
|
||||
|
||||
public boolean hasLore() {
|
||||
return lore != null && !lore.isEmpty();
|
||||
}
|
||||
|
||||
public String getDefaultLore() {
|
||||
return lore;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user