Minor changes
This commit is contained in:
parent
bd70b1f55b
commit
35fa7cc6c9
@ -55,9 +55,26 @@ impl Extensions {
|
||||
}
|
||||
|
||||
// Reserve command listing command
|
||||
if &key == "commands" {
|
||||
if &key == "help" {
|
||||
let _ = write_chat_stream(stream, "Command listing".to_string());
|
||||
|
||||
let _ = write_chat_stream(
|
||||
stream,
|
||||
format!("&c{} &a[{}]", "help", "Builtin"),
|
||||
);
|
||||
let _ = write_chat_stream(
|
||||
stream,
|
||||
format!("&c{} &a[{}]", "extensions", "Builtin"),
|
||||
);
|
||||
let _ = write_chat_stream(
|
||||
stream,
|
||||
format!("&c{} &a[{}]", "kick", "Builtin"),
|
||||
);
|
||||
let _ = write_chat_stream(
|
||||
stream,
|
||||
format!("&c{} &a[{}]", "tp", "Builtin"),
|
||||
);
|
||||
|
||||
for extension in &self.extensions {
|
||||
for command in extension.commands.keys() {
|
||||
let _ = write_chat_stream(
|
||||
@ -344,7 +361,11 @@ pub struct Vec3 {
|
||||
// Custom type API
|
||||
impl Vec3 {
|
||||
fn new(x: i64, y: i64, z: i64) -> Self {
|
||||
Self { x: x.try_into().unwrap(), y: y.try_into().unwrap(), z: z.try_into().unwrap() }
|
||||
Self {
|
||||
x: x.try_into().unwrap(),
|
||||
y: y.try_into().unwrap(),
|
||||
z: z.try_into().unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
fn build_extra(builder: &mut TypeBuilder<Self>) {
|
||||
@ -403,7 +424,10 @@ impl Context {
|
||||
let event_listener: EventType = match event {
|
||||
"block_break" => EventType::BlockBreak,
|
||||
"player_leave" => EventType::PlayerLeave,
|
||||
_ => {warn!("An event listener was created with invalid type: {}", event); return},
|
||||
_ => {
|
||||
warn!("An event listener was created with invalid type: {}", event);
|
||||
return;
|
||||
}
|
||||
};
|
||||
self.event_listener.insert(event_listener, callback);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use log::{debug, info, warn};
|
||||
use log::{info, warn};
|
||||
use std::io::prelude::*;
|
||||
use std::net::TcpStream;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
BIN
src/world.wrld
BIN
src/world.wrld
Binary file not shown.
Loading…
Reference in New Issue
Block a user