# 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[0] = math.floor(rawstacks)
13.     stacks[1] = math.fmod(amount,stacksize)
14.     print("Your amount of " + str(amount) + " equals to " + str(stacks[0]) + " Stacks and " + str(stacks[1]) + " Items!")
15.     if (stacks[0] > 27):
16.         chests = [0,0]
17.         rawchests = stacks[0]  / 27
18.         chests[0] = math.floor(rawchests)
19.         chests[1] = math.fmod(stacks[0],27)
20.         print("That Equals to " + str(chests[0]) + " Chests, " + str(chests[1]) + " Stacks and " + str(stacks[1]) + " Items!")
21.         result = [chests[0],chests[1],stacks[1]]
22.     else :
23.         result = [stacks[0],stacks[1]]
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.