forked from Upstream/mmocore
Fixed action bar hiding and Mob Holograms.
This commit is contained in:
parent
d7c2d300ba
commit
5b320cb88f
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user