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

@ -48,6 +48,6 @@ public abstract class ExperienceSource<T> {
if (hasProfession())
player.getCollectionSkills().giveExperience(profession, amount, location == null ? player.getPlayer().getLocation() : location);
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
*/
public boolean canSeeActionBar() {
return actionBarTimeOut + 100 < System.currentTimeMillis();
return actionBarTimeOut < System.currentTimeMillis();
}
public void setActionBarTimeOut(long actionBarTimeOut) {
this.actionBarTimeOut = actionBarTimeOut;
public void setActionBarTimeOut(long timeOut) {
actionBarTimeOut = System.currentTimeMillis() + (timeOut * 50);
}
public void displayActionBar(String message) {
actionBarTimeOut = System.currentTimeMillis();
setActionBarTimeOut(60);
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
}

View File

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