refactor: rename a few things
This commit is contained in:
parent
93348835ac
commit
2373d6500e
@ -9,7 +9,7 @@ for _, module in
|
|||||||
"utils",
|
"utils",
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
module = "lua/" .. module
|
module = "lib/" .. module
|
||||||
package.loaded[module] = nil
|
package.loaded[module] = nil
|
||||||
require(module)
|
require(module)
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
State,
|
State,
|
||||||
scripting::{eval, exec, reload},
|
lua::{eval, exec, reload},
|
||||||
};
|
};
|
||||||
use azalea::{
|
use azalea::{
|
||||||
GameProfileComponent, brigadier::prelude::*, chat::ChatPacket, entity::metadata::Player,
|
GameProfileComponent, brigadier::prelude::*, chat::ChatPacket, entity::metadata::Player,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::{State, commands::CommandSource, http::serve, scripting};
|
use crate::{State, commands::CommandSource, http::serve, lua};
|
||||||
use azalea::prelude::*;
|
use azalea::prelude::*;
|
||||||
use hyper::{server::conn::http1, service::service_fn};
|
use hyper::{server::conn::http1, service::service_fn};
|
||||||
use hyper_util::rt::TokioIo;
|
use hyper_util::rt::TokioIo;
|
||||||
@ -53,7 +53,7 @@ pub async fn handle_event(client: Client, event: Event, state: State) -> anyhow:
|
|||||||
|
|
||||||
globals.set(
|
globals.set(
|
||||||
"client",
|
"client",
|
||||||
scripting::client::Client {
|
lua::client::Client {
|
||||||
inner: Some(client),
|
inner: Some(client),
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
State,
|
State,
|
||||||
scripting::{eval, exec, reload},
|
lua::{eval, exec, reload},
|
||||||
};
|
};
|
||||||
use http_body_util::{BodyExt, Empty, Full, combinators::BoxBody};
|
use http_body_util::{BodyExt, Empty, Full, combinators::BoxBody};
|
||||||
use hyper::{Method, Request, Response, StatusCode, body::Bytes};
|
use hyper::{Method, Request, Response, StatusCode, body::Bytes};
|
||||||
|
@ -4,7 +4,7 @@ mod arguments;
|
|||||||
mod commands;
|
mod commands;
|
||||||
mod events;
|
mod events;
|
||||||
mod http;
|
mod http;
|
||||||
mod scripting;
|
mod lua;
|
||||||
|
|
||||||
use azalea::{brigadier::prelude::CommandDispatcher, prelude::*};
|
use azalea::{brigadier::prelude::CommandDispatcher, prelude::*};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
@ -34,7 +34,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
let username = globals.get::<String>("USERNAME")?;
|
let username = globals.get::<String>("USERNAME")?;
|
||||||
|
|
||||||
globals.set("script_path", script_path)?;
|
globals.set("script_path", script_path)?;
|
||||||
scripting::register_functions(&lua, &globals)?;
|
lua::register_functions(&lua, &globals)?;
|
||||||
|
|
||||||
let mut commands = CommandDispatcher::new();
|
let mut commands = CommandDispatcher::new();
|
||||||
register(&mut commands);
|
register(&mut commands);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user