-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved files so github actions does not fail
- Loading branch information
1 parent
037917e
commit 8e0185f
Showing
7 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "MC_calculator" | ||
version = "1.1.1" | ||
edition = "2021" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::io; | ||
pub fn portal_input() -> [f32; 2] { | ||
let mut cords: [f32; 2] = [0.0, 0.0]; | ||
println!("Please enter the x coordinate"); | ||
let mut x = String::new(); | ||
io::stdin().read_line(&mut x).expect("Failed to read line"); | ||
println!("Please enter the z coordinate"); | ||
let mut z = String::new(); | ||
io::stdin().read_line(&mut z).expect("Failed to read line"); | ||
cords[1] = z.trim().parse().unwrap(); | ||
cords[0] = x.trim().parse().unwrap(); | ||
cords | ||
} | ||
pub fn storage_input() -> f32 { | ||
let mut input = String::new(); | ||
io::stdin() | ||
.read_line(&mut input) | ||
.expect("Failed to read line"); | ||
input.trim().parse().unwrap() | ||
} | ||
pub fn menu_input() -> String { | ||
let mut input = String::new(); | ||
io::stdin() | ||
.read_line(&mut input) | ||
.expect("Failed to read line"); | ||
input | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::lib::input; | ||
use std::process::exit; | ||
pub mod lib { | ||
pub mod input; | ||
} | ||
pub mod opperations { | ||
pub mod item_opperations; | ||
pub mod portal_opperations; | ||
} | ||
mod menus; | ||
|
||
fn main() { | ||
println!("Enter:\n 1 => portal linking\n 2 => item operations\n 3 => quit"); | ||
let doing = input::menu_input(); | ||
match doing.trim() { | ||
"1" => menus::portal_input(), | ||
"2" => menus::item_operations_input(), | ||
"3" => exit(0), | ||
_ => { | ||
println!("Invalid Input"); | ||
main() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use crate::{input, main, opperations::item_opperations, opperations::portal_opperations}; | ||
|
||
pub fn portal_input() { | ||
println!("Please enter to where the portal should be connected?:\n 1 => to nether \n 2 => to overworld \n 3 => menu "); | ||
let dim = input::menu_input(); | ||
match dim.trim() { | ||
"1" => portal_opperations::portal_to_nether(), | ||
"2" => portal_opperations::portal_to_overworld(), | ||
"3" => main(), | ||
_ => { | ||
println!("Please enter a dimension"); | ||
portal_input() | ||
} | ||
} | ||
} | ||
pub fn item_operations_input() { | ||
println!("Enter:\n 1 => stacks to items\n 2 => items to stacks\n 3 => items to shulkers\n 4 => Shulker to items\n 5 => items_to_dchests\n 6 => dchests_to_items\n 7 => stacks_to_dchests\n 8 => dchests_to_stacks\n 9 => dchests_to_fullshulker\n 10 => fullshulker_to_dchests\n 11 => menu"); | ||
let doing = input::menu_input(); | ||
match doing.trim() { | ||
"1" => item_opperations::stack_to_items(), | ||
"2" => item_opperations::items_to_stack(), | ||
"3" => item_opperations::items_to_shulker(), | ||
"4" => item_opperations::shulker_to_items(), | ||
"5" => item_opperations::items_to_dchests(), | ||
"6" => item_opperations::dchests_to_items(), | ||
"7" => item_opperations::stacks_to_dchests(), | ||
"8" => item_opperations::dchests_to_stacks(), | ||
"9" => item_opperations::dchests_to_fullshulker(), | ||
"10" => item_opperations::fullshulker_to_dchests(), | ||
"11" => main(), | ||
_ => { | ||
println!("Invalid Input"); | ||
item_operations_input() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
use crate::{input, menus}; | ||
|
||
pub fn stack_to_items() { | ||
println!("Please enter the stack count that you want to turn into items"); | ||
let mut ic = input::storage_input(); | ||
ic *= 64.0; | ||
println!("the item count is {}", ic); | ||
menus::item_operations_input() | ||
} | ||
pub fn items_to_stack() { | ||
println!("Please enter the item count that you want to turn into stacks"); | ||
let mut sc = input::storage_input(); | ||
sc /= 64.0; | ||
println!("the stack count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn items_to_shulker() { | ||
println!("Please enter the item count that you want to turn into shulkerboxes"); | ||
let mut sc = input::storage_input(); | ||
sc /= 1728.0; | ||
println!("the shulker count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn shulker_to_items() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc *= 1728.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn items_to_dchests() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc /= 3456.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn dchests_to_items() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc *= 3456.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn stacks_to_dchests() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc /= 54.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn dchests_to_stacks() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc *= 54.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn dchests_to_fullshulker() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc *= 93312.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} | ||
pub fn fullshulker_to_dchests() { | ||
println!("Please enter the shulker count that you want to turn into items"); | ||
let mut sc = input::storage_input(); | ||
sc /= 93312.0; | ||
println!("the item count is {}", sc); | ||
menus::item_operations_input() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use crate::{input, menus}; | ||
pub fn portal_to_nether() { | ||
let cords: [f32; 2] = input::portal_input(); | ||
let xn = cords[0] * 8.0; | ||
let yn = cords[1] * 8.0; | ||
println!("the x coordinate is {}, the y coordinate is {}", xn, yn); | ||
menus::portal_input() | ||
} | ||
pub fn portal_to_overworld() { | ||
let cords: [f32; 2] = input::portal_input(); | ||
let xo: f32 = cords[0] / 8.0; | ||
let yo: f32 = cords[1] / 8.0; | ||
println!("the x coordinate is {}, the y coordinate is {}", xo, yo); | ||
menus::portal_input() | ||
} |