Fixed action bar time out

This commit is contained in:
Jules 2023-02-02 16:15:35 +01:00
parent 568ead3eca
commit 0fa680ae2f
3 changed files with 3 additions and 4 deletions

View File

@ -36,7 +36,7 @@ public class HideActionBarCommandTreeNode extends CommandTreeNode {
return CommandResult.FAILURE;
}
long lastUsed = System.currentTimeMillis() - PlayerActivity.ACTION_BAR_MESSAGE.getTimeOut() + amount * 50;
final long lastUsed = System.currentTimeMillis() - PlayerActivity.ACTION_BAR_MESSAGE.getTimeOut() + amount * 50;
PlayerData.get(player).setLastActivity(PlayerActivity.ACTION_BAR_MESSAGE, lastUsed);
return CommandResult.SUCCESS;
}

View File

@ -19,7 +19,7 @@ public class ActionBarManager extends BukkitRunnable {
public void reload(ConfigurationSection config) {
enabled = config.getBoolean("enabled", false);
timeOut = config.getInt("", 60);
timeOut = config.getInt("time-out", 60);
updateTicks = config.getInt("ticks-to-update", 5);
barFormat = config.getString("format", "<No Action Bar Format Found>");
@ -43,7 +43,6 @@ public class ActionBarManager extends BukkitRunnable {
Placeholders holders = getActionBarPlaceholders(data);
data.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(
holders.apply(data.getPlayer(), data.getProfess().hasActionBar() ? data.getProfess().getActionBar() : barFormat)));
}
}

View File

@ -111,7 +111,7 @@ action-bar:
# (This doesn't change any other action bars provided by MMOCore.)
enabled: true
# The amount of milliseconds the bar will be
# The amount of ticks the bar will be
# faded out when displaying other action bars.
time-out: 60