forked from Upstream/mmocore
add option to disable exp gain hologram
please add these lines to your config.yml # Allows to toggle exp hologram from gaining experiences game-indicators: exp: enabled: false
This commit is contained in:
parent
d9f0444df0
commit
2a90717e56
@ -11,6 +11,7 @@ import java.util.UUID;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import net.Indyuce.mmoitems.MMOItems;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
@ -525,8 +526,10 @@ public class PlayerData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// display hologram
|
// display hologram
|
||||||
|
if (MMOItems.plugin.getConfig().getBoolean("game-indicators.exp.enabled")) {
|
||||||
if (loc != null && MMOCore.plugin.hologramSupport != null)
|
if (loc != null && MMOCore.plugin.hologramSupport != null)
|
||||||
MMOCore.plugin.hologramSupport.displayIndicator(loc.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message(), getPlayer());
|
MMOCore.plugin.hologramSupport.displayIndicator(loc.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message(), getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
value = MMOCore.plugin.boosterManager.calculateExp(null, value);
|
value = MMOCore.plugin.boosterManager.calculateExp(null, value);
|
||||||
value *= 1 + getStats().getStat(StatType.ADDITIONAL_EXPERIENCE) / 100;
|
value *= 1 + getStats().getStat(StatType.ADDITIONAL_EXPERIENCE) / 100;
|
||||||
|
@ -3,6 +3,7 @@ package net.Indyuce.mmocore.api.player;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.Indyuce.mmoitems.MMOItems;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -86,8 +87,10 @@ public class Professions {
|
|||||||
exp.put(profession.getId(), exp.containsKey(profession.getId()) ? exp.get(profession.getId()) + value : value);
|
exp.put(profession.getId(), exp.containsKey(profession.getId()) ? exp.get(profession.getId()) + value : value);
|
||||||
|
|
||||||
// display hologram
|
// display hologram
|
||||||
|
if (MMOItems.plugin.getConfig().getBoolean("game-indicators.exp.enabled")) {
|
||||||
if (loc != null && MMOCore.plugin.hologramSupport != null)
|
if (loc != null && MMOCore.plugin.hologramSupport != null)
|
||||||
MMOCore.plugin.hologramSupport.displayIndicator(loc.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message(), playerData.getPlayer());
|
MMOCore.plugin.hologramSupport.displayIndicator(loc.add(.5, 1.5, .5), MMOCore.plugin.configManager.getSimpleMessage("exp-hologram", "exp", "" + value).message(), playerData.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
int needed, exp, level;
|
int needed, exp, level;
|
||||||
boolean check = false;
|
boolean check = false;
|
||||||
|
@ -70,6 +70,11 @@ health-scale:
|
|||||||
enabled: true
|
enabled: true
|
||||||
scale: 20
|
scale: 20
|
||||||
|
|
||||||
|
# Allows to toggle exp hologram from gaining experiences
|
||||||
|
game-indicators:
|
||||||
|
exp:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
# Players can swap their hotbar with the 9 inventory slots
|
# Players can swap their hotbar with the 9 inventory slots
|
||||||
# right above it by pressing [swap items] while crouching.
|
# right above it by pressing [swap items] while crouching.
|
||||||
hotbar-swap: true
|
hotbar-swap: true
|
||||||
|
Loading…
Reference in New Issue
Block a user