Fixed action bar hiding and Mob Holograms.

This commit is contained in:
Aria 2019-11-25 15:51:23 +01:00
parent d7c2d300ba
commit 5b320cb88f
4 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@ import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
public class PlayerActionBar extends BukkitRunnable { public class PlayerActionBar extends BukkitRunnable {
private final int ticks; private final int ticks;
private final DecimalFormat digit; private final DecimalFormat digit;
private final String format; private final String format;

View File

@ -48,6 +48,6 @@ public abstract class ExperienceSource<T> {
if (hasProfession()) if (hasProfession())
player.getCollectionSkills().giveExperience(profession, amount, location == null ? player.getPlayer().getLocation() : location); player.getCollectionSkills().giveExperience(profession, amount, location == null ? player.getPlayer().getLocation() : location);
else else
player.giveExperience(amount, player.getPlayer().getLocation()); player.giveExperience(amount, location == null ? player.getPlayer().getLocation() : location);
} }
} }

View File

@ -588,15 +588,15 @@ public class PlayerData {
* if the general info action bar can be displayed * if the general info action bar can be displayed
*/ */
public boolean canSeeActionBar() { public boolean canSeeActionBar() {
return actionBarTimeOut + 100 < System.currentTimeMillis(); return actionBarTimeOut < System.currentTimeMillis();
} }
public void setActionBarTimeOut(long actionBarTimeOut) { public void setActionBarTimeOut(long timeOut) {
this.actionBarTimeOut = actionBarTimeOut; actionBarTimeOut = System.currentTimeMillis() + (timeOut * 50);
} }
public void displayActionBar(String message) { public void displayActionBar(String message) {
actionBarTimeOut = System.currentTimeMillis(); setActionBarTimeOut(60);
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
} }

View File

@ -37,7 +37,7 @@ public class HideActionBarCommandMap extends CommandEnd {
return CommandResult.FAILURE; return CommandResult.FAILURE;
} }
PlayerData.get(player).setActionBarTimeOut(System.currentTimeMillis() - 100 + amount * 50); PlayerData.get(player).setActionBarTimeOut(amount);
return CommandResult.SUCCESS; return CommandResult.SUCCESS;
} }
} }