 # Minecraft Stacks Calculator

May 26th, 2022
615
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import math
2. close = "no"
3. while (close == "no"):
4.     amount = int(input("How many Items? : "))
5.     stacks = [0,0]
6.     stacksize = ""
7.     stacksize = input("What is the Stack Size of the Item? (Leave empty for default 64) : ")
8.     if (str(stacksize) == ""):
9.         stacksize = 64
10.     stacksize = int(stacksize)
11.     rawstacks = amount / stacksize
12.     stacks = math.floor(rawstacks)
13.     stacks = math.fmod(amount,stacksize)
14.     print("Your amount of " + str(amount) + " equals to " + str(stacks) + " Stacks and " + str(stacks) + " Items!")
15.     if (stacks > 27):
16.         chests = [0,0]
17.         rawchests = stacks  / 27
18.         chests = math.floor(rawchests)
19.         chests = math.fmod(stacks,27)
20.         print("That Equals to " + str(chests) + " Chests, " + str(chests) + " Stacks and " + str(stacks) + " Items!")
21.         result = [chests,chests,stacks]
22.     else :
23.         result = [stacks,stacks]
24.     print(result)
25.     close = input("Press Return to close, or press any key before to input another value!")
26.     if (close == ""):
27.         close = "yes"
28.     else:
29.         close = "no"
30.