refactor: rename command output packet to message packet

This commit is contained in:
ChomeNS
2025-04-09 15:03:09 +07:00
parent ed71cdc55a
commit 31f54ee8f8
3 changed files with 10 additions and 10 deletions

View File

@@ -1 +1 @@
2513
2514

View File

@@ -5,15 +5,15 @@ import me.chayapak1.chomens_bot.chomeNSMod.Packet;
import me.chayapak1.chomens_bot.chomeNSMod.Types;
import net.kyori.adventure.text.Component;
public class ClientboundCommandOutputPacket implements Packet {
public final Component output;
public class ClientboundMessagePacket implements Packet {
public final Component message;
public ClientboundCommandOutputPacket (Component output) {
this.output = output;
public ClientboundMessagePacket (Component message) {
this.message = message;
}
public ClientboundCommandOutputPacket (ByteBuf buf) {
this.output = Types.readComponent(buf);
public ClientboundMessagePacket (ByteBuf buf) {
this.message = Types.readComponent(buf);
}
@Override
@@ -23,6 +23,6 @@ public class ClientboundCommandOutputPacket implements Packet {
@Override
public void serialize (ByteBuf buf) {
Types.writeComponent(buf, this.output);
Types.writeComponent(buf, this.message);
}
}

View File

@@ -1,7 +1,7 @@
package me.chayapak1.chomens_bot.command.contexts;
import me.chayapak1.chomens_bot.Bot;
import me.chayapak1.chomens_bot.chomeNSMod.clientboundPackets.ClientboundCommandOutputPacket;
import me.chayapak1.chomens_bot.chomeNSMod.clientboundPackets.ClientboundMessagePacket;
import me.chayapak1.chomens_bot.command.CommandContext;
import me.chayapak1.chomens_bot.data.player.PlayerEntry;
import net.kyori.adventure.text.Component;
@@ -20,7 +20,7 @@ public class ChomeNSModCommandContext extends CommandContext {
public void sendOutput (Component component) {
bot.chomeNSMod.send(
sender,
new ClientboundCommandOutputPacket(component)
new ClientboundMessagePacket(component)
);
}