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