2023-04-17 17:45:59 +02:00
|
|
|
from Finder import Finder
|
2023-04-16 19:03:13 +02:00
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
worldseed = int(input("Please enter your world seed (No text seeds, numberic form only!): "))
|
|
|
|
print("\nEnter 'Y' if your world is superflat, anything else if its not!")
|
|
|
|
print("If you don't specify this correctly, you'll get wrong coords!\n")
|
|
|
|
|
|
|
|
superflat = input("Superflat? :") == 'Y'
|
2023-04-17 17:45:59 +02:00
|
|
|
print("\n\n")
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
mode_max = 3
|
|
|
|
mode = 0
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
while mode < 1 or mode > mode_max:
|
|
|
|
print("""
|
|
|
|
Which Search-Mode would you like to use?\n
|
|
|
|
\t1: All strongholds\n
|
|
|
|
\t2: Strongholds within ring\n
|
|
|
|
\t3: nearest x strongholds\n\n
|
|
|
|
""")
|
|
|
|
|
|
|
|
mode = int(input("Please select your mode: "))
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
#would like to use match cases here, but python 3.9 isn't old enoght *yet*
|
|
|
|
out = []
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
finder = Finder(worldseed,superflat)
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
if mode == 1:
|
|
|
|
out = finder.findAll()
|
|
|
|
elif mode == 2:
|
|
|
|
ring = 0
|
|
|
|
while ring < 1 or ring > 8:
|
|
|
|
ring = int(input("Please enter your ring: "))
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
out = finder.findRing(ring)
|
|
|
|
else:
|
|
|
|
x = int(input("Please enter your x coordinate: "))
|
|
|
|
z = int(input("Please enter your z coordinate: "))
|
|
|
|
amount = int(input("How many strongholds would you like to find: "))
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
out =finder.findNearestX(np.array([x,z]),amount)
|
2023-04-16 19:03:13 +02:00
|
|
|
|
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
print("Done looking for your strongholds! Here is a list of coordinates: ")
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
if mode != 3:
|
|
|
|
for coordinate in out:
|
|
|
|
print(str(coordinate))
|
|
|
|
else:
|
|
|
|
positions = out[0]
|
|
|
|
distances = out[1]
|
2023-04-16 19:03:13 +02:00
|
|
|
|
2023-04-17 17:45:59 +02:00
|
|
|
for i in range(0, len(positions)):
|
|
|
|
print("{pos} Distance: {dis}".format(pos=positions[i],dis=distances[i]))
|