-
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.
- Loading branch information
1 parent
ae339bf
commit a7eab6c
Showing
7 changed files
with
188 additions
and
49 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "MC_calculator" | ||
version = "1.1.1" | ||
version = "1.2.0" | ||
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,21 @@ | ||
pub fn check_for_error(data: f64) -> bool { | ||
if data == 0.0 { | ||
true | ||
} else { | ||
false | ||
} | ||
} | ||
pub fn check_for_errors_p1(cords: [f64; 2]) -> bool { | ||
if cords[0] == 0.0 { | ||
true | ||
} else { | ||
false | ||
} | ||
} | ||
pub fn check_for_errors_p2(cords: [f64; 2]) -> bool { | ||
if cords[1] == 0.0 { | ||
true | ||
} else { | ||
false | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -1,72 +1,163 @@ | ||
use crate::lib::check_for_error::check_for_error; | ||
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() | ||
let is_error = check_for_error(ic); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
stack_to_items() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
items_to_stack() | ||
} | ||
false => { | ||
sc /= 64.0; | ||
println!("the item 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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
items_to_shulker() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
shulker_to_items() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
items_to_dchests() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
dchests_to_items() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
stacks_to_dchests() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
dchests_to_stacks() | ||
} | ||
false => { | ||
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() | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
dchests_to_fullshulker() | ||
} | ||
false => { | ||
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() | ||
} | ||
let is_error = check_for_error(sc); | ||
match is_error { | ||
true => { | ||
println!("Invalid Input, please Input a valid number."); | ||
fullshulker_to_dchests() | ||
} | ||
false => { | ||
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 |
---|---|---|
@@ -1,15 +1,41 @@ | ||
use crate::lib::check_for_error::check_for_error; | ||
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() | ||
let cords: [f64; 2] = input::portal_input(); | ||
let is_error = check_for_error(cords[0]); | ||
if is_error == true { | ||
println!("Invalid Input, please Input a valid number."); | ||
portal_to_nether() | ||
} else { | ||
let is_error2 = check_for_error(cords[1]); | ||
if is_error2 == true { | ||
println!("Invalid Input, please Input a valid number."); | ||
portal_to_nether() | ||
} else { | ||
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() | ||
let cords: [f64; 2] = input::portal_input(); | ||
let is_error = check_for_error(cords[0]); | ||
if is_error == true { | ||
println!("Invalid Input, please Input a valid number."); | ||
portal_to_nether() | ||
} else { | ||
let is_error2 = check_for_error(cords[1]); | ||
if is_error2 == true { | ||
println!("Invalid Input, please Input a valid number."); | ||
portal_to_overworld() | ||
} else { | ||
let xo = cords[0] / 8.0; | ||
let yo = cords[1] / 8.0; | ||
println!("the x coordinate is {}, the y coordinate is {}", xo, yo); | ||
menus::portal_input(); | ||
} | ||
} | ||
} |