From b8cbd9a5f063ba9bd1027488182793eca1932639 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 17 Sep 2020 18:56:52 -0600 Subject: [PATCH] Upgrade pyCraft --- blocks.py | 1 + bot.py | 2 ++ game.py | 6 +++++- requirements.txt | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/blocks.py b/blocks.py index f3ce723..2121d61 100644 --- a/blocks.py +++ b/blocks.py @@ -20,6 +20,7 @@ SAND = 66 SINGLE_SNOW = 3921 SOUL_TORCH = 4008 +TEST_BLOCK = (616, 78, 496) AVOID = [ diff --git a/bot.py b/bot.py index 125b6c3..0d28f00 100644 --- a/bot.py +++ b/bot.py @@ -198,6 +198,8 @@ def bot(global_state): init(g) print('Initialized.') + print(blocks.mcd.windows) + while g.running: tick(g) diff --git a/game.py b/game.py index 79e5604..e837354 100644 --- a/game.py +++ b/game.py @@ -7,6 +7,7 @@ from itertools import count from panda3d.core import LPoint3f from minecraft.networking.packets import Packet, clientbound, serverbound +from minecraft.networking.types import BlockFace from protocol.packets import TimeUpdatePacket, SetSlotPacket, PlayerDiggingPacket, BlockBreakAnimationPacket, AcknowledgePlayerDiggingPacket, HeldItemChangePacket, PickItemPacket @@ -261,7 +262,7 @@ class Game: raise if command == 'break': - self.break_block((616, 78, 496)) + self.break_block(blocks.TEST_BLOCK) reply = 'ok' if command == 'gather' and data: @@ -312,6 +313,9 @@ class Game: else: reply = 'not found' + if command == 'open': + self.place_block(blocks.TEST_BLOCK, BlockFace.TOP) + if reply: print(reply) self.g.chat.send(reply) diff --git a/requirements.txt b/requirements.txt index 9cda937..d9933bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ minecraft-data==2.67.0 panda3d==1.10.6.post2 pathtools==0.1.2 pycparser==2.20 -pyCraft @ git+https://github.com/ammaraskar/pyCraft.git@cf93923acc2dcfbc076379b43842228d77aea188 +pyCraft @ git+https://github.com/ammaraskar/pyCraft.git@903c20f9e2c8751fc28af46fc0dc3f7d3ec14a82 PyNBT==3.0.0 requests==2.24.0 six==1.15.0