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
|
@Override
|
||||||
public double getHealth() {
|
public double getHealth() {
|
||||||
return health;
|
return getPlayer() == null ? health : getPlayer().getHealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -316,6 +316,8 @@ public class SavedClassInformation {
|
|||||||
player.setMana(mana);
|
player.setMana(mana);
|
||||||
player.setStellium(stellium);
|
player.setStellium(stellium);
|
||||||
player.setStamina(stamina);
|
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()));
|
player.getPlayer().setHealth(Math.min(health,player.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()));
|
||||||
// Updates level on exp bar
|
// Updates level on exp bar
|
||||||
player.refreshVanillaExp();
|
player.refreshVanillaExp();
|
||||||
|
@ -47,8 +47,6 @@ public class QuestProgress {
|
|||||||
objective++;
|
objective++;
|
||||||
objectiveProgress.close();
|
objectiveProgress.close();
|
||||||
|
|
||||||
// apply triggers
|
|
||||||
objectiveProgress.getObjective().getTriggers().forEach(trigger -> trigger.schedule(getPlayer()));
|
|
||||||
|
|
||||||
// end quest
|
// end quest
|
||||||
if (objective >= quest.getObjectives().size())
|
if (objective >= quest.getObjectives().size())
|
||||||
@ -57,6 +55,10 @@ public class QuestProgress {
|
|||||||
objectiveProgress = nextObjective().newProgress(this);
|
objectiveProgress = nextObjective().newProgress(this);
|
||||||
|
|
||||||
player.getQuestData().updateBossBar();
|
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() {
|
public String getFormattedLore() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.Indyuce.mmocore.comp.placeholder;
|
package net.Indyuce.mmocore.comp.placeholder;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.MythicLib;
|
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.api.util.AltChar;
|
||||||
import io.lumine.mythic.lib.manager.StatManager;
|
import io.lumine.mythic.lib.manager.StatManager;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
@ -183,8 +184,8 @@ public class RPGPlaceholders extends PlaceholderExpansion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (identifier.startsWith("stat_")) {
|
else if (identifier.startsWith("stat_")) {
|
||||||
final String stat = identifier.substring(5).toUpperCase();
|
final String stat = UtilityMethods.enumName(identifier.substring(5));
|
||||||
return StatManager.format(identifier.substring(5), playerData.getStats().getStat(stat));
|
return StatManager.format(stat, playerData.getMMOPlayerData());
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (identifier.equals("stellium"))
|
else if (identifier.equals("stellium"))
|
||||||
|
@ -44,11 +44,11 @@ public class InventoryManager {
|
|||||||
|
|
||||||
list.forEach(inv -> {
|
list.forEach(inv -> {
|
||||||
String folder="gui"+(inv instanceof ClassConfirmation?"/class-confirm":"");
|
String folder="gui"+(inv instanceof ClassConfirmation?"/class-confirm":"");
|
||||||
MMOCore.plugin.configManager.loadDefaultFile(folder, inv.getId() + ".yml");
|
|
||||||
try {
|
try {
|
||||||
|
MMOCore.plugin.configManager.loadDefaultFile(folder, inv.getId() + ".yml");
|
||||||
inv.reload(new ConfigFile("/"+folder, inv.getId()).getConfig());
|
inv.reload(new ConfigFile("/"+folder, inv.getId()).getConfig());
|
||||||
} catch (Exception exception) {
|
} 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