diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 268012a..deb17c0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,7 @@
-
+
@@ -26,6 +26,19 @@
+ {
+ "lastFilter": {
+ "state": "OPEN"
+ }
+}
+
+
+
@@ -98,20 +111,6 @@
1680245437032
-
- 1682133205362
-
-
-
- 1682133205363
-
-
- 1682141185843
-
-
-
- 1682141185843
-
1682141715244
@@ -441,7 +440,21 @@
1682828334938
-
+
+ 1682838582771
+
+
+
+ 1682838582772
+
+
+ 1682842148011
+
+
+
+ 1682842148011
+
+
@@ -456,8 +469,6 @@
-
-
@@ -481,7 +492,9 @@
-
+
+
+
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java
index 249d700..6e40360 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java
@@ -84,8 +84,6 @@ public class Bot {
Bot.this.ready();
}
});
-
- executor.scheduleAtFixedRate(this::tick, 0, 10, TimeUnit.MILLISECONDS);
}
public void ready () {
@@ -115,18 +113,6 @@ public class Bot {
reconnect();
}
- public void sendPacket (Packet packet) {
- packetQueue.add(packet);
- }
-
- private void tick () {
- if (!loggedIn || packetQueue.size() == 0) return;
-
- session.send(packetQueue.get(0));
-
- packetQueue.remove(0);
- }
-
private void reconnect () {
for (Listener listener : listeners) {
listener.connecting();
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java
index eb24073..7b75bd9 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java
@@ -16,7 +16,6 @@ public class BossbarManagerPlugin extends Bot.Listener {
private final Bot bot;
private ScheduledFuture> tickTask;
- private ScheduledFuture> updateTask;
private final Map bossBars = new HashMap<>();
@@ -41,26 +40,11 @@ public class BossbarManagerPlugin extends Bot.Listener {
public void ready () {
tickTask = bot.executor().scheduleAtFixedRate(this::tick, 0, 50, TimeUnit.MILLISECONDS);
- updateTask = bot.executor().scheduleAtFixedRate(this::update, 0, 500, TimeUnit.MILLISECONDS);
}
@Override
public void disconnected(DisconnectedEvent event) {
tickTask.cancel(true);
- updateTask.cancel(true);
- }
-
- private void update() {
- if (!enabled || actionbar) return;
- for (Map.Entry _bossBar : bossBars.entrySet()) {
- final String name = _bossBar.getKey();
- final BossBar bossBar = _bossBar.getValue();
- createBossBar(name, bossBar.players());
- bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " color " + bossBar.color().color);
- bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " visible " + bossBar.visible());
- bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " style " + bossBar.style().style);
- bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " max " + bossBar.max());
- }
}
public void tick () {
@@ -72,6 +56,10 @@ public class BossbarManagerPlugin extends Bot.Listener {
final String stringifiedComponent = GsonComponentSerializer.gson().serialize(bossBar.name());
if (!actionbar) {
+ bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " color " + bossBar.color().color);
+ bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " visible " + bossBar.visible());
+ bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " style " + bossBar.style().style);
+ bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " max " + bossBar.max());
bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " name " + stringifiedComponent);
bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " value " + bossBar.value());
} else {