py2hackCraft2 1.0.14__tar.gz → 1.0.16__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.14 → py2hackcraft2-1.0.16}/PKG-INFO +2 -1
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft/modules.py +49 -14
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft2.egg-info/PKG-INFO +2 -1
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/setup.py +1 -1
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/README.md +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft/__init__.py +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft/material.py +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft2.egg-info/SOURCES.txt +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft2.egg-info/dependency_links.txt +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft2.egg-info/requires.txt +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/py2hackCraft2.egg-info/top_level.txt +0 -0
- {py2hackCraft2-1.0.14 → py2hackcraft2-1.0.16}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: py2hackCraft2
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.16
|
|
4
4
|
Summary: These are APIs that connect to the hackCraft2 server from Python to manipulate pets.
|
|
5
5
|
Home-page: https://pypi.org/project/py2hackCraft2/
|
|
6
6
|
Author: Masafumi Terazono
|
|
@@ -8,6 +8,7 @@ Author-email: masafumi_t@0x48lab.com
|
|
|
8
8
|
License: MIT
|
|
9
9
|
Keywords: hackCraft2
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: websocket-client
|
|
11
12
|
|
|
12
13
|
## 概要
|
|
13
14
|
|
|
@@ -311,8 +311,15 @@ class Player:
|
|
|
311
311
|
result = self.client.result
|
|
312
312
|
if(result is None):
|
|
313
313
|
raise ValueError("Entity '%s' not found" % name)
|
|
314
|
+
|
|
314
315
|
|
|
315
|
-
|
|
316
|
+
entity = Entity(self.client, self.world, result)
|
|
317
|
+
#ロールバックできるように設定
|
|
318
|
+
self.client.send(json.dumps({
|
|
319
|
+
"type": "start",
|
|
320
|
+
"data": {"entity": entity.uuid}
|
|
321
|
+
}))
|
|
322
|
+
return entity
|
|
316
323
|
|
|
317
324
|
class Inventory:
|
|
318
325
|
"""
|
|
@@ -386,6 +393,9 @@ class Entity:
|
|
|
386
393
|
self.uuid = uuid
|
|
387
394
|
self.positions = []
|
|
388
395
|
|
|
396
|
+
def reset(self):
|
|
397
|
+
self.client.sendCall(self.uuid, "restoreArea")
|
|
398
|
+
|
|
389
399
|
def waitForPlayerChat(self):
|
|
390
400
|
"""
|
|
391
401
|
チャットを受信するまでまつ
|
|
@@ -548,6 +558,12 @@ class Entity:
|
|
|
548
558
|
self.client.sendCall(self.uuid, "addForce", [x, y, z])
|
|
549
559
|
return str_to_bool(self.client.result)
|
|
550
560
|
|
|
561
|
+
def jump(self, degrees: int):
|
|
562
|
+
"""
|
|
563
|
+
ジャンプさせる。
|
|
564
|
+
"""
|
|
565
|
+
self.client.sendCall(self.uuid, "jump")
|
|
566
|
+
|
|
551
567
|
def turn(self, degrees: int):
|
|
552
568
|
"""
|
|
553
569
|
自分を回転させる。
|
|
@@ -557,11 +573,17 @@ class Entity:
|
|
|
557
573
|
"""
|
|
558
574
|
self.client.sendCall(self.uuid, "turn", [degrees])
|
|
559
575
|
|
|
560
|
-
def
|
|
576
|
+
def placeX(self, x, y, z, cord) -> bool :
|
|
561
577
|
"""
|
|
562
|
-
|
|
578
|
+
指定した座標にブロックを設置する。
|
|
579
|
+
|
|
580
|
+
Args:
|
|
581
|
+
x (int): X座標。
|
|
582
|
+
y (int): Y座標。
|
|
583
|
+
z (int): Z座標。
|
|
584
|
+
cord (str): 座標の種類('', '^', '~')。
|
|
563
585
|
"""
|
|
564
|
-
self.client.sendCall(self.uuid, "placeX", [x, y, z])
|
|
586
|
+
self.client.sendCall(self.uuid, "placeX", [x, y, z, cord])
|
|
565
587
|
return str_to_bool(self.client.result)
|
|
566
588
|
|
|
567
589
|
def place(self) -> bool :
|
|
@@ -606,11 +628,17 @@ class Entity:
|
|
|
606
628
|
self.client.sendCall(self.uuid, "useItemDown")
|
|
607
629
|
return str_to_bool(self.client.result)
|
|
608
630
|
|
|
609
|
-
def
|
|
631
|
+
def useItemX(self, x, y, z, cord) -> bool :
|
|
610
632
|
"""
|
|
611
|
-
|
|
633
|
+
指定した座標にアイテムを使う
|
|
634
|
+
|
|
635
|
+
Args:
|
|
636
|
+
x (int): X座標。
|
|
637
|
+
y (int): Y座標。
|
|
638
|
+
z (int): Z座標。
|
|
639
|
+
cord (str): 座標の種類('', '^', '~')。
|
|
612
640
|
"""
|
|
613
|
-
self.client.sendCall(self.uuid, "useItemX", [x, y, z])
|
|
641
|
+
self.client.sendCall(self.uuid, "useItemX", [x, y, z, cord])
|
|
614
642
|
return str_to_bool(self.client.result)
|
|
615
643
|
|
|
616
644
|
def harvest(self) -> bool :
|
|
@@ -648,11 +676,17 @@ class Entity:
|
|
|
648
676
|
self.client.sendCall(self.uuid, "digDown")
|
|
649
677
|
return str_to_bool(self.client.result)
|
|
650
678
|
|
|
651
|
-
def
|
|
679
|
+
def digX(self, x, y, z, cord) -> bool :
|
|
652
680
|
"""
|
|
653
|
-
|
|
681
|
+
指定した座標のブロックを壊す。
|
|
682
|
+
|
|
683
|
+
Args:
|
|
684
|
+
x (int): X座標。
|
|
685
|
+
y (int): Y座標。
|
|
686
|
+
z (int): Z座標。
|
|
687
|
+
cord (str): 座標の種類('', '^', '~')。
|
|
654
688
|
"""
|
|
655
|
-
self.client.sendCall(self.uuid, "digX", [x, y, z])
|
|
689
|
+
self.client.sendCall(self.uuid, "digX", [x, y, z, cord])
|
|
656
690
|
return str_to_bool(self.client.result)
|
|
657
691
|
|
|
658
692
|
def action(self) -> bool :
|
|
@@ -719,7 +753,7 @@ class Entity:
|
|
|
719
753
|
self.client.sendCall(self.uuid, "dropItem", [slot1])
|
|
720
754
|
return str_to_bool(self.client.result)
|
|
721
755
|
|
|
722
|
-
def
|
|
756
|
+
def grabItem(self, slot: int) -> bool :
|
|
723
757
|
"""
|
|
724
758
|
自分のインベントリのアイテムを手に持たせる。
|
|
725
759
|
|
|
@@ -738,18 +772,19 @@ class Entity:
|
|
|
738
772
|
"""
|
|
739
773
|
self.client.sendCall(self.uuid, "sendChat", [message])
|
|
740
774
|
|
|
741
|
-
def
|
|
775
|
+
def inspectX(self, x: int, y: int, z: int, cord: str) -> Block :
|
|
742
776
|
"""
|
|
743
|
-
|
|
777
|
+
指定された座標のブロックを調べる。
|
|
744
778
|
|
|
745
779
|
Args:
|
|
746
780
|
x (int): X座標。
|
|
747
781
|
y (int): Y座標。
|
|
748
782
|
z (int): Z座標。
|
|
783
|
+
cord (str): 座標の種類('', '^', '~')。
|
|
749
784
|
Returns:
|
|
750
785
|
Block: 調べたブロックの情報。
|
|
751
786
|
"""
|
|
752
|
-
self.client.sendCall(self.uuid, "inspect", [x, y, z])
|
|
787
|
+
self.client.sendCall(self.uuid, "inspect", [x, y, z, cord])
|
|
753
788
|
block = Block(** json.loads(self.client.result))
|
|
754
789
|
return block
|
|
755
790
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: py2hackCraft2
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.16
|
|
4
4
|
Summary: These are APIs that connect to the hackCraft2 server from Python to manipulate pets.
|
|
5
5
|
Home-page: https://pypi.org/project/py2hackCraft2/
|
|
6
6
|
Author: Masafumi Terazono
|
|
@@ -8,6 +8,7 @@ Author-email: masafumi_t@0x48lab.com
|
|
|
8
8
|
License: MIT
|
|
9
9
|
Keywords: hackCraft2
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: websocket-client
|
|
11
12
|
|
|
12
13
|
## 概要
|
|
13
14
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|