fix: message formatting

This commit is contained in:
Alexander Medvedev 2026-01-30 23:19:46 +01:00
parent 4816935568
commit 23337fb600
3 changed files with 21 additions and 19 deletions

32
rust/Cargo.lock generated
View File

@ -1963,7 +1963,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin" name = "pumpkin"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"arc-swap", "arc-swap",
"base64", "base64",
@ -2006,7 +2006,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-api-macros" name = "pumpkin-api-macros"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
@ -2017,7 +2017,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-config" name = "pumpkin-config"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"log", "log",
"pumpkin-util", "pumpkin-util",
@ -2029,7 +2029,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-data" name = "pumpkin-data"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"crc-fast", "crc-fast",
"heck", "heck",
@ -2049,7 +2049,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-inventory" name = "pumpkin-inventory"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"crossbeam-utils", "crossbeam-utils",
"log", "log",
@ -2064,7 +2064,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-macros" name = "pumpkin-macros"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
@ -2076,7 +2076,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-nbt" name = "pumpkin-nbt"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"bytes", "bytes",
"cesu8", "cesu8",
@ -2088,7 +2088,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-protocol" name = "pumpkin-protocol"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"aes", "aes",
"async-compression", "async-compression",
@ -2110,7 +2110,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-util" name = "pumpkin-util"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"base64", "base64",
"bytes", "bytes",
@ -2135,7 +2135,7 @@ dependencies = [
[[package]] [[package]]
name = "pumpkin-world" name = "pumpkin-world"
version = "0.1.0-dev+1.21.11" version = "0.1.0-dev+1.21.11"
source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#d64f538138b4c2595215849daaf881fc666410e3" source = "git+https://github.com/Pumpkin-MC/Pumpkin.git?branch=master#72bd4dfbef6326063b1bc0752e2789402f5c9197"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"bytes", "bytes",
@ -3582,18 +3582,18 @@ dependencies = [
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.36" version = "0.8.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dafd85c832c1b68bbb4ec0c72c7f6f4fc5179627d2bc7c26b30e4c0cc11e76cc" checksum = "7456cf00f0685ad319c5b1693f291a650eaf345e941d082fc4e03df8a03996ac"
dependencies = [ dependencies = [
"zerocopy-derive", "zerocopy-derive",
] ]
[[package]] [[package]]
name = "zerocopy-derive" name = "zerocopy-derive"
version = "0.8.36" version = "0.8.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cb7e4e8436d9db52fbd6625dbf2f45243ab84994a72882ec8227b99e72b439a" checksum = "1328722bbf2115db7e19d69ebcc15e795719e2d66b60827c6a69a117365e37a0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -3710,9 +3710,9 @@ checksum = "40990edd51aae2c2b6907af74ffb635029d5788228222c4bb811e9351c0caad3"
[[package]] [[package]]
name = "zmij" name = "zmij"
version = "1.0.17" version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439" checksum = "1966f8ac2c1f76987d69a74d0e0f929241c10e78136434e3be70ff7f58f64214"
[[package]] [[package]]
name = "zopfli" name = "zopfli"

View File

@ -31,7 +31,9 @@ impl CommandExecutor for JavaCommandExecutor {
let sender = match sender { let sender = match sender {
pumpkin::command::CommandSender::Rcon(mutex) => todo!(), pumpkin::command::CommandSender::Rcon(mutex) => todo!(),
pumpkin::command::CommandSender::Console => SimpleCommandSender::Console, pumpkin::command::CommandSender::Console => SimpleCommandSender::Console,
pumpkin::command::CommandSender::Player(player) => SimpleCommandSender::Player(player.gameprofile.id.to_string()), pumpkin::command::CommandSender::Player(player) => {
SimpleCommandSender::Player(player.gameprofile.id.to_string())
}
pumpkin::command::CommandSender::CommandBlock(block_entity, world) => todo!(), pumpkin::command::CommandSender::CommandBlock(block_entity, world) => todo!(),
}; };
self.command_tx self.command_tx

View File

@ -3,7 +3,7 @@ use std::{path::PathBuf, str::FromStr, sync::Arc};
use anyhow::bail; use anyhow::bail;
use j4rs::{Instance, InvocationArg, Jvm, JvmBuilder}; use j4rs::{Instance, InvocationArg, Jvm, JvmBuilder};
use pumpkin::{net::bedrock::play, plugin::Context, server::Server}; use pumpkin::{net::bedrock::play, plugin::Context, server::Server};
use pumpkin_util::text::TextComponent; use pumpkin_util::text::{TextComponent, color::NamedColor};
use tokio::sync::{mpsc, oneshot}; use tokio::sync::{mpsc, oneshot};
use crate::{ use crate::{
@ -280,7 +280,7 @@ impl JvmWorker {
.get_player_by_uuid(uuid::Uuid::from_str(&uuid).unwrap()) .get_player_by_uuid(uuid::Uuid::from_str(&uuid).unwrap())
{ {
player player
.send_system_message(&TextComponent::text(message)) .send_system_message(&TextComponent::from_legacy_string(&message))
.await; .await;
} }
} }