From e455ee5000ca9987b61b8a01b759618a52643559 Mon Sep 17 00:00:00 2001
From: ChomeNS <95471003+ChomeNS@users.noreply.github.com>
Date: Sun, 30 Apr 2023 18:32:06 +0700
Subject: [PATCH] i forgor
---
.idea/workspace.xml | 24 ++++++++++---------
.../chomens_bot/plugins/ChatPlugin.java | 4 ++--
.../chomens_bot/plugins/CorePlugin.java | 4 ++--
.../chomens_bot/plugins/PositionPlugin.java | 2 +-
.../chomens_bot/plugins/SelfCarePlugin.java | 2 +-
.../plugins/TabCompletePlugin.java | 2 +-
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index deb17c0..ed2b1c4 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,8 +4,10 @@
-
+
+
+
@@ -111,13 +113,6 @@
1680245437032
-
- 1682141715244
-
-
-
- 1682141715244
-
1682142828982
@@ -454,7 +449,14 @@
1682842148011
-
+
+ 1682854236394
+
+
+
+ 1682854236395
+
+
@@ -469,7 +471,6 @@
-
@@ -494,7 +495,8 @@
-
+
+
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java
index f6e1347..e5b7b5b 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java
@@ -183,7 +183,7 @@ public class ChatPlugin extends Bot.Listener {
if (splitMessage.trim().equals("")) continue;
if (splitMessage.startsWith("/")) {
- bot.sendPacket(new ServerboundChatCommandPacket(
+ bot.session().send(new ServerboundChatCommandPacket(
splitMessage.substring(1),
Instant.now().toEpochMilli(),
0L,
@@ -192,7 +192,7 @@ public class ChatPlugin extends Bot.Listener {
new BitSet()
));
} else {
- bot.sendPacket(new ServerboundChatPacket(
+ bot.session().send(new ServerboundChatPacket(
splitMessage,
Instant.now().toEpochMilli(),
0L,
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java
index cf834ad..35b8ef3 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java
@@ -86,7 +86,7 @@ public class CorePlugin extends PositionPlugin.PositionListener {
if (!ready) return;
if (bot.options().useCore()) {
- bot.sendPacket(new ServerboundSetCommandBlockPacket(
+ bot.session().send(new ServerboundSetCommandBlockPacket(
absoluteCorePosition(),
command,
kaboom ? CommandBlockMode.AUTO : CommandBlockMode.REDSTONE,
@@ -112,7 +112,7 @@ public class CorePlugin extends PositionPlugin.PositionListener {
final CompletableFuture future = new CompletableFuture<>();
transactions.put(transactionId, future);
- final Runnable afterTick = () -> bot.sendPacket(new ServerboundBlockEntityTagQuery(transactionId, position));
+ final Runnable afterTick = () -> bot.session().send(new ServerboundBlockEntityTagQuery(transactionId, position));
bot.executor().schedule(afterTick, 50, TimeUnit.MILLISECONDS);
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PositionPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PositionPlugin.java
index 88c1a30..4031858 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PositionPlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PositionPlugin.java
@@ -49,7 +49,7 @@ public class PositionPlugin extends Bot.Listener {
}
public void packetReceived (ClientboundPlayerPositionPacket packet) {
- bot.sendPacket(new ServerboundAcceptTeleportationPacket(packet.getTeleportId()));
+ bot.session().send(new ServerboundAcceptTeleportationPacket(packet.getTeleportId()));
position = Vector3i.from(packet.getX(), packet.getY(), packet.getZ());
for (PositionListener listener : listeners) { listener.positionChange(position); }
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java
index 9f52a90..a258b6c 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java
@@ -157,7 +157,7 @@ public class SelfCarePlugin extends Bot.Listener {
final GameEventValue value = packet.getValue();
if (notification == GameEvent.ENTER_CREDITS) {
- bot.sendPacket(new ServerboundClientCommandPacket(ClientCommand.RESPAWN));
+ bot.session().send(new ServerboundClientCommandPacket(ClientCommand.RESPAWN));
return;
}
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TabCompletePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TabCompletePlugin.java
index 85543fe..d83c439 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TabCompletePlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TabCompletePlugin.java
@@ -23,7 +23,7 @@ public class TabCompletePlugin extends Bot.Listener {
public CompletableFuture tabComplete (String command) {
final int transactionId = nextTransactionId++;
- bot.sendPacket(new ServerboundCommandSuggestionPacket(transactionId, command));
+ bot.session().send(new ServerboundCommandSuggestionPacket(transactionId, command));
final CompletableFuture future = new CompletableFuture<>();
transactions.put(transactionId, future);