This commit is contained in:
ChomeNS
2023-04-30 18:32:06 +07:00
parent 5859c856e2
commit e455ee5000
6 changed files with 20 additions and 18 deletions

View File

@@ -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,

View File

@@ -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<CompoundTag> 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);

View File

@@ -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); }

View File

@@ -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;
}

View File

@@ -23,7 +23,7 @@ public class TabCompletePlugin extends Bot.Listener {
public CompletableFuture<ClientboundCommandSuggestionsPacket> tabComplete (String command) {
final int transactionId = nextTransactionId++;
bot.sendPacket(new ServerboundCommandSuggestionPacket(transactionId, command));
bot.session().send(new ServerboundCommandSuggestionPacket(transactionId, command));
final CompletableFuture<ClientboundCommandSuggestionsPacket> future = new CompletableFuture<>();
transactions.put(transactionId, future);