forked from Upstream/mmocore
Merge branch 'master' into Skills-update
This commit is contained in:
commit
8ce90c3363
@ -994,7 +994,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
||||
|
||||
@Override
|
||||
public double getHealth() {
|
||||
return health;
|
||||
return getPlayer() == null ? health : getPlayer().getHealth();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -316,6 +316,8 @@ public class SavedClassInformation {
|
||||
player.setMana(mana);
|
||||
player.setStellium(stellium);
|
||||
player.setStamina(stamina);
|
||||
double health=this.health;
|
||||
health = health == 0 ? 20 : health;
|
||||
player.getPlayer().setHealth(Math.min(health,player.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()));
|
||||
// Updates level on exp bar
|
||||
player.refreshVanillaExp();
|
||||
|
@ -47,8 +47,6 @@ public class QuestProgress {
|
||||
objective++;
|
||||
objectiveProgress.close();
|
||||
|
||||
// apply triggers
|
||||
objectiveProgress.getObjective().getTriggers().forEach(trigger -> trigger.schedule(getPlayer()));
|
||||
|
||||
// end quest
|
||||
if (objective >= quest.getObjectives().size())
|
||||
@ -57,6 +55,10 @@ public class QuestProgress {
|
||||
objectiveProgress = nextObjective().newProgress(this);
|
||||
|
||||
player.getQuestData().updateBossBar();
|
||||
|
||||
|
||||
// apply triggers at the end so the quest is ended when a trigger quest start is launched.
|
||||
objectiveProgress.getObjective().getTriggers().forEach(trigger -> trigger.schedule(getPlayer()));
|
||||
}
|
||||
|
||||
public String getFormattedLore() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.Indyuce.mmocore.comp.placeholder;
|
||||
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import io.lumine.mythic.lib.UtilityMethods;
|
||||
import io.lumine.mythic.lib.api.util.AltChar;
|
||||
import io.lumine.mythic.lib.manager.StatManager;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
@ -183,8 +184,8 @@ public class RPGPlaceholders extends PlaceholderExpansion {
|
||||
}
|
||||
|
||||
else if (identifier.startsWith("stat_")) {
|
||||
final String stat = identifier.substring(5).toUpperCase();
|
||||
return StatManager.format(identifier.substring(5), playerData.getStats().getStat(stat));
|
||||
final String stat = UtilityMethods.enumName(identifier.substring(5));
|
||||
return StatManager.format(stat, playerData.getMMOPlayerData());
|
||||
}
|
||||
|
||||
else if (identifier.equals("stellium"))
|
||||
|
@ -44,11 +44,11 @@ public class InventoryManager {
|
||||
|
||||
list.forEach(inv -> {
|
||||
String folder="gui"+(inv instanceof ClassConfirmation?"/class-confirm":"");
|
||||
MMOCore.plugin.configManager.loadDefaultFile(folder, inv.getId() + ".yml");
|
||||
try {
|
||||
MMOCore.plugin.configManager.loadDefaultFile(folder, inv.getId() + ".yml");
|
||||
inv.reload(new ConfigFile("/"+folder, inv.getId()).getConfig());
|
||||
} catch (Exception exception) {
|
||||
MMOCore.log(Level.WARNING, "Could not load inventory '" + inv.getId() + "': " + exception.getMessage());
|
||||
MMOCore.log(Level.WARNING, "Could not load inventory '" +(inv instanceof ClassConfirmation?"class-confirm/":""+ inv.getId() + "': " + exception.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user