add combat log timer

make sure to add these to your config.yml
#Timer for combat log to expire (in seconds)
combat-log:
    timer: 10
This commit is contained in:
Blackdigits 2020-02-16 02:03:13 +07:00
parent 3e802ee522
commit 55c03d88fa
3 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,7 @@ public class CombatRunnable extends BukkitRunnable {
@Override
public void run() {
if (lastHit + 10000 < System.currentTimeMillis()) {
if (lastHit + (config.combatLogTimer * 100) < System.currentTimeMillis()) {
Bukkit.getPluginManager().callEvent(new PlayerCombatEvent(player, false));
config.getSimpleMessage("leave-combat").send(player.getPlayer());
close();

View File

@ -30,6 +30,7 @@ public class ConfigManager {
public double expPartyBuff, regenPartyBuff;
public String partyChatPrefix;
public ChatColor manaFull, manaHalf, manaEmpty, staminaFull, staminaHalf, staminaEmpty;
public int combatLogTimer;
public final DecimalFormatSymbols formatSymbols = new DecimalFormatSymbols();
public final DecimalFormat decimal = new DecimalFormat("0.#", formatSymbols), decimals = new DecimalFormat("0.##", formatSymbols);
@ -100,6 +101,7 @@ public class ConfigManager {
regenPartyBuff = MMOCore.plugin.getConfig().getDouble("party.buff.health-regen");
partyChatPrefix = MMOCore.plugin.getConfig().getString("party.chat-prefix");
formatSymbols.setDecimalSeparator(getFirstChar(MMOCore.plugin.getConfig().getString("number-format.decimal-separator"), ','));
combatLogTimer = MMOCore.plugin.getConfig().getInt("combat-log.timer");
manaFull = getColorOrDefault("mana-whole", ChatColor.BLUE);
manaHalf = getColorOrDefault("mana-half", ChatColor.AQUA);

View File

@ -91,6 +91,10 @@ use-chat-input: true
# Prevents mobs spawned from spawners from giving XP points.
prevent-spawner-xp: true
#Timer for combat log to expire (in seconds)
combat-log:
timer: 10
# Change this to the name of the color you want for
# the different resource bar placeholders
resource-bar-colors: