From a84a30d9a322b759d11d298be2c5072679db157d Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 28 Dec 2020 13:04:05 -0800 Subject: [PATCH 1/6] Fix git dependencies conrod, glium specification. Closes #28 --- Cargo.toml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 68fc013..dc9768c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,5 @@ simple_logger = "1.0.1" threadpool = "1.0" rhai = "0.9.0" smallvec = "0.6.5" - -[dependencies.conrod] -git = "https://github.com/Litecrafty/conrod" -features = ["glium", "winit"] - -[dependencies.glium] -git = "https://github.com/Litecrafty/glium" -features = ["icon_loading"] \ No newline at end of file +conrod = { git = "https://github.com/Litecrafty/conrod", features = ["glium", "winit"] } +glium = { git = "https://github.com/Litecrafty/glium", features = ["icon_loading"] } From 1c931e37504ea95e89819573bec7203b337d05ca Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 28 Dec 2020 13:12:16 -0800 Subject: [PATCH 2/6] Update to rhai 0.19.8. Closes #21 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dc9768c..35f4c81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.17.0" lazy_static = "1.1" simple_logger = "1.0.1" threadpool = "1.0" -rhai = "0.9.0" +rhai = "0.19.8" smallvec = "0.6.5" conrod = { git = "https://github.com/Litecrafty/conrod", features = ["glium", "winit"] } glium = { git = "https://github.com/Litecrafty/glium", features = ["icon_loading"] } From 22283d7af2fc739f22382d1bd3bcc194be7b504b Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 28 Dec 2020 13:25:49 -0800 Subject: [PATCH 3/6] Remove std::f32 imports. Closes #23 --- src/core/camera/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/core/camera/mod.rs b/src/core/camera/mod.rs index 7726f8e..ee554c5 100644 --- a/src/core/camera/mod.rs +++ b/src/core/camera/mod.rs @@ -15,7 +15,6 @@ use cgmath::prelude::*; use cgmath::{ortho, perspective, Deg, Euler, Matrix4, Point3, Quaternion, Vector3}; -use std::f32; const YAW: f32 = -90.0; const PITCH: f32 = 0.0; @@ -106,8 +105,6 @@ impl Camera { /// Get perspective matrix pub fn perspective(&self) -> Matrix4 { - use std::f32; - let zfar = 1024.0; let znear = 1.0; From 86812a43200cf9e89eba689359a4d63dc1cf4a29 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 28 Dec 2020 13:33:26 -0800 Subject: [PATCH 4/6] Update readme to force nightly Rust --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 1ee5c66..1331db6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,7 +29,7 @@ - Clone the repository. - Download and install [Rust](https://rustup.rs/) nightly. - Open Minecraft 1.13 jar file using any zip extractor, and copy `assets/minecraft` to Litecraft `resources` folder, or use our Launcher in developer's mode. - - Build and run with `cargo run` + - Build and run with `cargo +nightly run` - Profit! # 🎉 F.A.Q From 3d9636a1352daa1c7cf1b7bb18ed5b35be8a7958 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 28 Dec 2020 13:42:46 -0800 Subject: [PATCH 5/6] Fix warn(bare_trait_objects) --- src/core/resource_manager/mod.rs | 2 +- src/core/resource_manager/resource.rs | 2 +- src/core/resource_manager/shader_manager.rs | 2 +- src/gfx/canvas.rs | 2 +- src/gfx/scene.rs | 2 +- src/gfx/shapes.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/resource_manager/mod.rs b/src/core/resource_manager/mod.rs index 9a965dd..1e98972 100644 --- a/src/core/resource_manager/mod.rs +++ b/src/core/resource_manager/mod.rs @@ -85,7 +85,7 @@ impl ResourceManager { } /// Get and load a font file - pub fn font(resource: &Resource) -> Result> { + pub fn font(resource: &Resource) -> Result> { use conrod::text::FontCollection; info!("Loading font file '{}'", resource); diff --git a/src/core/resource_manager/resource.rs b/src/core/resource_manager/resource.rs index 18315b7..515095b 100644 --- a/src/core/resource_manager/resource.rs +++ b/src/core/resource_manager/resource.rs @@ -29,7 +29,7 @@ use std::io::{Error, ErrorKind}; use std::path::{Path, PathBuf}; use zip::read::ZipArchive; -type Result = std::result::Result>; +type Result = std::result::Result>; #[derive(PartialEq, Eq, Hash)] /// Represents a resource URI and allows loading resource data diff --git a/src/core/resource_manager/shader_manager.rs b/src/core/resource_manager/shader_manager.rs index bfc8984..a113b7d 100644 --- a/src/core/resource_manager/shader_manager.rs +++ b/src/core/resource_manager/shader_manager.rs @@ -22,7 +22,7 @@ use glium::Program; use std::collections::HashMap; use std::error::Error; -type Result = std::result::Result>; +type Result = std::result::Result>; pub struct ShaderManager { shaders: HashMap<&'static str, Program>, diff --git a/src/gfx/canvas.rs b/src/gfx/canvas.rs index 48b62c8..21b310d 100644 --- a/src/gfx/canvas.rs +++ b/src/gfx/canvas.rs @@ -81,7 +81,7 @@ impl Canvas { let resource_manager = ResourceManager::new(&display, &settings); // Create default scene - let mut scene: Box = Box::new(LoadingScene::new()); + let mut scene: Box = Box::new(LoadingScene::new()); info!("Starting script engine!"); diff --git a/src/gfx/scene.rs b/src/gfx/scene.rs index ef91184..e0c2b71 100644 --- a/src/gfx/scene.rs +++ b/src/gfx/scene.rs @@ -18,7 +18,7 @@ use glium::Frame; pub enum SceneAction { None, - ChangeScene(Box), + ChangeScene(Box), Quit, } diff --git a/src/gfx/shapes.rs b/src/gfx/shapes.rs index 5f65764..273ca68 100644 --- a/src/gfx/shapes.rs +++ b/src/gfx/shapes.rs @@ -42,7 +42,7 @@ pub struct Shapes { } impl Shapes { - pub fn new(display: &Display) -> Result> { + pub fn new(display: &Display) -> Result> { Ok(Shapes { quad: { ( From 162eb5257a291a697170cf8c9e791d28c922c787 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Mon, 28 Dec 2020 13:43:10 -0800 Subject: [PATCH 6/6] Fix warn(unused_mut) --- src/core/resource_manager/resource.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/resource_manager/resource.rs b/src/core/resource_manager/resource.rs index 515095b..c0074b9 100644 --- a/src/core/resource_manager/resource.rs +++ b/src/core/resource_manager/resource.rs @@ -157,7 +157,7 @@ impl Resource { let mut zipfile = ZipArchive::new(zipfile)?; // Read resource from ZIP - let mut file = zipfile.by_name(&self.folder("assets")); + let file = zipfile.by_name(&self.folder("assets")); // If file exist in zip if let Ok(mut file) = file {