py2hackCraft2 1.0.30__tar.gz → 1.0.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/PKG-INFO +1 -1
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft/modules.py +6 -3
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft2.egg-info/PKG-INFO +1 -1
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/setup.py +1 -1
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/README.md +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft/__init__.py +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft/material.py +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft2.egg-info/SOURCES.txt +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft2.egg-info/dependency_links.txt +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft2.egg-info/requires.txt +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/py2hackCraft2.egg-info/top_level.txt +0 -0
- {py2hackcraft2-1.0.30 → py2hackcraft2-1.0.32}/setup.cfg +0 -0
|
@@ -5,6 +5,7 @@ import json
|
|
|
5
5
|
import logging
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from typing import Callable, Any
|
|
8
|
+
from typing import Optional
|
|
8
9
|
|
|
9
10
|
def str_to_bool(s):
|
|
10
11
|
"""
|
|
@@ -879,7 +880,7 @@ class Entity:
|
|
|
879
880
|
"""
|
|
880
881
|
self.client.sendCall(self.uuid, "sendChat", [message])
|
|
881
882
|
|
|
882
|
-
def findNearbyBlockX(self, x: int, y: int, z: int, cord: Coordinates, block: str, maxDepth: int) -> Block
|
|
883
|
+
def findNearbyBlockX(self, x: int, y: int, z: int, cord: Coordinates, block: str, maxDepth: int) -> Optional[Block]:
|
|
883
884
|
"""
|
|
884
885
|
指定された座標を中心に近くのブロックを取得する
|
|
885
886
|
|
|
@@ -894,10 +895,12 @@ class Entity:
|
|
|
894
895
|
Block: 調べたブロックの情報
|
|
895
896
|
"""
|
|
896
897
|
self.client.sendCall(self.uuid, "findNearbyBlockX", [x, y, z, cord, block, maxDepth])
|
|
897
|
-
result = json.loads(self.client.result)
|
|
898
898
|
|
|
899
|
-
|
|
899
|
+
print('result = ', self.client.result)
|
|
900
|
+
# resultがNoneまたは空のケースに対応
|
|
901
|
+
if not self.client.result:
|
|
900
902
|
return None
|
|
903
|
+
|
|
901
904
|
try:
|
|
902
905
|
result = json.loads(self.client.result)
|
|
903
906
|
if not result:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|