py2hackCraft2 1.0.17__tar.gz → 1.0.18__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.17 → py2hackcraft2-1.0.18}/PKG-INFO +1 -1
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft/modules.py +83 -14
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft2.egg-info/PKG-INFO +1 -1
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/setup.py +1 -1
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/README.md +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft/__init__.py +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft/material.py +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft2.egg-info/SOURCES.txt +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft2.egg-info/dependency_links.txt +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft2.egg-info/requires.txt +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/py2hackCraft2.egg-info/top_level.txt +0 -0
- {py2hackcraft2-1.0.17 → py2hackcraft2-1.0.18}/setup.cfg +0 -0
|
@@ -154,12 +154,24 @@ class _WebSocketClient:
|
|
|
154
154
|
self.send(json.dumps(message))
|
|
155
155
|
|
|
156
156
|
class Coordinates:
|
|
157
|
+
"""
|
|
158
|
+
座標の基準を表すデータクラス
|
|
159
|
+
"""
|
|
157
160
|
world = ""
|
|
158
161
|
relative = "~"
|
|
159
162
|
local = "^"
|
|
160
163
|
|
|
161
164
|
@dataclass
|
|
162
165
|
class Location:
|
|
166
|
+
"""
|
|
167
|
+
座標を表すデータクラス。
|
|
168
|
+
|
|
169
|
+
Attributes:
|
|
170
|
+
x (str): X座標。
|
|
171
|
+
y (str): Y座標。
|
|
172
|
+
z (str): Z座標。
|
|
173
|
+
world (str): ワールド名。
|
|
174
|
+
"""
|
|
163
175
|
x: int
|
|
164
176
|
y: int
|
|
165
177
|
z: int
|
|
@@ -167,6 +179,22 @@ class Location:
|
|
|
167
179
|
|
|
168
180
|
@dataclass
|
|
169
181
|
class InteractEvent:
|
|
182
|
+
"""
|
|
183
|
+
クリックイベントを表すデータクラス。
|
|
184
|
+
|
|
185
|
+
Attributes:
|
|
186
|
+
action (str): アクションの名前。
|
|
187
|
+
player (str): クリックしたプレイヤー名。
|
|
188
|
+
player_uuid (str): クリックしたプレイヤーの一意の識別子(UUID)。
|
|
189
|
+
event (str): アイテムに設定されている名前。
|
|
190
|
+
name (str): ブロックあるいはエンティティーの名前
|
|
191
|
+
type (str): ブロックあるいはエンティティーの種類。
|
|
192
|
+
data (int): ブロックのデータ値。
|
|
193
|
+
world (str): ブロックあるいはエンティティーのいたワールド名。
|
|
194
|
+
x (int): クリックした場所のワールドにおけるX座標。
|
|
195
|
+
y (int): クリックした場所のワールドにおけるY座標。
|
|
196
|
+
z (int): クリックした場所のワールドにおけるZ座標。
|
|
197
|
+
"""
|
|
170
198
|
action: str
|
|
171
199
|
player: str
|
|
172
200
|
player_uuid: str
|
|
@@ -588,6 +616,20 @@ class Entity:
|
|
|
588
616
|
self.client.sendCall(self.uuid, "placeX", [x, y, z, cord, side, block])
|
|
589
617
|
return str_to_bool(self.client.result)
|
|
590
618
|
|
|
619
|
+
def placeHere(self, x: int, y: int, z: int, block=None, side=None) -> bool :
|
|
620
|
+
"""
|
|
621
|
+
自分を中心に指定した座標にブロックを設置する。
|
|
622
|
+
|
|
623
|
+
Args:
|
|
624
|
+
x (int): X座標。
|
|
625
|
+
y (int): Y座標。
|
|
626
|
+
z (int): Z座標。
|
|
627
|
+
block (str): 設置するブロックの種類。
|
|
628
|
+
side (str): 設置する面。
|
|
629
|
+
"""
|
|
630
|
+
self.client.sendCall(self.uuid, "placeX", [x, y, z, "^", side, block])
|
|
631
|
+
return str_to_bool(self.client.result)
|
|
632
|
+
|
|
591
633
|
def place(self, side=None) -> bool :
|
|
592
634
|
"""
|
|
593
635
|
自分の前方にブロックを設置する。
|
|
@@ -609,6 +651,31 @@ class Entity:
|
|
|
609
651
|
self.client.sendCall(self.uuid, "placeDown")
|
|
610
652
|
return str_to_bool(self.client.result, [side])
|
|
611
653
|
|
|
654
|
+
def useItemX(self, cord: Coordinates, x: int, y: int, z: int) -> bool :
|
|
655
|
+
"""
|
|
656
|
+
指定した座標にアイテムを使う
|
|
657
|
+
|
|
658
|
+
Args:
|
|
659
|
+
cord (Coordinates): 座標の種類('', '^', '~')。
|
|
660
|
+
x (int): X座標。
|
|
661
|
+
y (int): Y座標。
|
|
662
|
+
z (int): Z座標。
|
|
663
|
+
"""
|
|
664
|
+
self.client.sendCall(self.uuid, "useItemX", [x, y, z, cord])
|
|
665
|
+
return str_to_bool(self.client.result)
|
|
666
|
+
|
|
667
|
+
def useItemHere(self, x: int, y: int, z: int) -> bool :
|
|
668
|
+
"""
|
|
669
|
+
自分を中心に指定した座標にアイテムを使う
|
|
670
|
+
|
|
671
|
+
Args:
|
|
672
|
+
x (int): X座標。
|
|
673
|
+
y (int): Y座標。
|
|
674
|
+
z (int): Z座標。
|
|
675
|
+
"""
|
|
676
|
+
self.client.sendCall(self.uuid, "useItemX", [x, y, z, "^"])
|
|
677
|
+
return str_to_bool(self.client.result)
|
|
678
|
+
|
|
612
679
|
def useItem(self) -> bool :
|
|
613
680
|
"""
|
|
614
681
|
自分の前方にアイテムを使う
|
|
@@ -630,19 +697,6 @@ class Entity:
|
|
|
630
697
|
self.client.sendCall(self.uuid, "useItemDown")
|
|
631
698
|
return str_to_bool(self.client.result)
|
|
632
699
|
|
|
633
|
-
def useItemX(self, cord: Coordinates, x: int, y: int, z: int) -> bool :
|
|
634
|
-
"""
|
|
635
|
-
指定した座標にアイテムを使う
|
|
636
|
-
|
|
637
|
-
Args:
|
|
638
|
-
cord (Coordinates): 座標の種類('', '^', '~')。
|
|
639
|
-
x (int): X座標。
|
|
640
|
-
y (int): Y座標。
|
|
641
|
-
z (int): Z座標。
|
|
642
|
-
"""
|
|
643
|
-
self.client.sendCall(self.uuid, "useItemX", [x, y, z, cord])
|
|
644
|
-
return str_to_bool(self.client.result)
|
|
645
|
-
|
|
646
700
|
def harvest(self) -> bool :
|
|
647
701
|
"""
|
|
648
702
|
自分の位置のブロックを収穫する。
|
|
@@ -790,6 +844,21 @@ class Entity:
|
|
|
790
844
|
block = Block(** json.loads(self.client.result))
|
|
791
845
|
return block
|
|
792
846
|
|
|
847
|
+
def inspectHere(self, x: int, y: int, z: int) -> Block :
|
|
848
|
+
"""
|
|
849
|
+
自分を中心に指定された座標のブロックを調べる。
|
|
850
|
+
|
|
851
|
+
Args:
|
|
852
|
+
x (int): X座標。
|
|
853
|
+
y (int): Y座標。
|
|
854
|
+
z (int): Z座標。
|
|
855
|
+
Returns:
|
|
856
|
+
Block: 調べたブロックの情報。
|
|
857
|
+
"""
|
|
858
|
+
self.client.sendCall(self.uuid, "inspect", [x, y, z, "^"])
|
|
859
|
+
block = Block(** json.loads(self.client.result))
|
|
860
|
+
return block
|
|
861
|
+
|
|
793
862
|
def inspect(self) -> Block :
|
|
794
863
|
"""
|
|
795
864
|
自分のいる場所のブロックを調べる。
|
|
@@ -909,7 +978,7 @@ class Entity:
|
|
|
909
978
|
|
|
910
979
|
def setBlock(self, cord: Coordinates, x: int, y: int, z: int, block: str, data: int = 0):
|
|
911
980
|
"""
|
|
912
|
-
|
|
981
|
+
指定された座標にブロックを設置する。(クリエイティブ)
|
|
913
982
|
|
|
914
983
|
Args:
|
|
915
984
|
cord (Coordinates): 座標の種類('', '^', '~')。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|