some more bossbar manager improve

This commit is contained in:
Chayapak 2023-10-01 09:57:59 +07:00
parent d0d7eea9b3
commit f1765a6658

View file

@ -4,6 +4,7 @@ import com.github.steveice10.mc.protocol.data.game.BossBarColor;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundBossEventPacket; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundBossEventPacket;
import com.github.steveice10.packetlib.Session; import com.github.steveice10.packetlib.Session;
import com.github.steveice10.packetlib.event.session.ConnectedEvent; import com.github.steveice10.packetlib.event.session.ConnectedEvent;
import com.github.steveice10.packetlib.event.session.DisconnectedEvent;
import com.github.steveice10.packetlib.packet.Packet; import com.github.steveice10.packetlib.packet.Packet;
import land.chipmunk.chayapak.chomens_bot.Bot; import land.chipmunk.chayapak.chomens_bot.Bot;
import land.chipmunk.chayapak.chomens_bot.data.BossBar; import land.chipmunk.chayapak.chomens_bot.data.BossBar;
@ -163,6 +164,11 @@ public class BossbarManagerPlugin extends Bot.Listener {
} }
} }
@Override
public void disconnected(DisconnectedEvent event) {
serverBossBars.clear();
}
private void playerJoined () { private void playerJoined () {
if (!enabled || actionBar || !bot.options.useCore) return; if (!enabled || actionBar || !bot.options.useCore) return;