Dont send action bar every tick

This commit is contained in:
libraryaddict
2020-02-03 18:37:32 +13:00
parent 9bf3e81ded
commit 5410e8dd04

View File

@@ -175,11 +175,11 @@ public abstract class Disguise {
@Override @Override
public void run() { public void run() {
if (DisguiseConfig.isNotifyPlayerDisguised() && getEntity() instanceof Player && if (DisguiseConfig.isNotifyPlayerDisguised() && getEntity() instanceof Player &&
actionBarTicks++ % 20 == 0) { ++actionBarTicks % 20 == 0) {
actionBarTicks = 0; actionBarTicks = 0;
((Player) getEntity()).spigot().sendMessage(ChatMessageType.ACTION_BAR, new ComponentBuilder("") ((Player) getEntity()).spigot().sendMessage(ChatMessageType.ACTION_BAR,
.appendLegacy(LibsMsg.ACTION_BAR_MESSAGE.get(getType().toReadable())).create()); new ComponentBuilder(LibsMsg.ACTION_BAR_MESSAGE.get(getType().toReadable())).create());
} }
// If entity is no longer valid. Remove it. // If entity is no longer valid. Remove it.