From ab0f88ad379475e05a96c481a4300bd8561ea916 Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 23 Nov 2022 09:49:32 +0100 Subject: [PATCH] Remove remove_end.py --- tools/remove_end.py | 46 --------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 tools/remove_end.py diff --git a/tools/remove_end.py b/tools/remove_end.py deleted file mode 100644 index 3b73e5575..000000000 --- a/tools/remove_end.py +++ /dev/null @@ -1,46 +0,0 @@ -world_name = "world" -path_to_map_sqlite = "../../../worlds/" + world_name + "/map.sqlite" - -import sqlite3, sys - -try: - conn = sqlite3.connect(path_to_map_sqlite) -except Error as e: - print(e) - sys.exit() - -def unsignedToSigned(i, max_positive): - if i < max_positive: - return i - else: - return i - 2*max_positive - -cursor = conn.cursor() -cursor.execute("SELECT pos FROM blocks") -poses = cursor.fetchall() -end_blocks = [] -for i0 in (poses): - i = int(i0[0]) - blockpos = i - x = unsignedToSigned(i % 4096, 2048) - i = int((i - x) / 4096) - y = unsignedToSigned(i % 4096, 2048) - i = int((i - y) / 4096) - z = unsignedToSigned(i % 4096, 2048) - - node_pos_y = y * 16 - if node_pos_y > -28811 and node_pos_y + 15 < -67: - end_blocks.append(blockpos) - -if len(end_blocks) < 1: - print ("End blocks not found") - sys.exit() - -counter = 0 -for blockpos in end_blocks: - print("Deleting ", blockpos) - cursor.execute("DELETE FROM blocks WHERE pos=" + str(blockpos)) - counter += 1 -conn.commit() - -print(counter, " block(s) deleted")