py2hackCraft2 1.0.32__tar.gz → 1.0.34__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2hackCraft2
3
- Version: 1.0.32
3
+ Version: 1.0.34
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,7 +8,6 @@ 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
12
11
 
13
12
  ## 概要
14
13
 
@@ -507,51 +507,51 @@ class Entity:
507
507
  else:
508
508
  return False
509
509
 
510
- def forward(self) -> bool :
510
+ def forward(self, n=1) -> bool :
511
511
  """
512
- 自分を前方に移動させる
512
+ n歩に進む
513
513
  """
514
- self.client.sendCall(self.uuid, "forward")
514
+ self.client.sendCall(self.uuid, "forward", [n])
515
515
  return str_to_bool(self.client.result)
516
516
 
517
- def back(self) -> bool :
517
+ def back(self, n=1) -> bool :
518
518
  """
519
- 自分を後方に移動させる
519
+ n歩後に進む
520
520
  """
521
- self.client.sendCall(self.uuid, "back")
521
+ self.client.sendCall(self.uuid, "back", [n])
522
522
  return str_to_bool(self.client.result)
523
523
 
524
- def up(self) -> bool :
524
+ def up(self, n=1) -> bool :
525
525
  """
526
- 自分を上方に移動させる
526
+ n歩上に進む
527
527
  """
528
- self.client.sendCall(self.uuid, "up")
528
+ self.client.sendCall(self.uuid, "up", [n])
529
529
  return str_to_bool(self.client.result)
530
530
 
531
- def down(self) -> bool :
531
+ def down(self, n=1) -> bool :
532
532
  """
533
- 自分を下方に移動させる
533
+ n歩下に進む
534
534
  """
535
- self.client.sendCall(self.uuid, "down")
535
+ self.client.sendCall(self.uuid, "down", [n])
536
536
  return str_to_bool(self.client.result)
537
537
 
538
- def stepLeft(self) -> bool :
538
+ def stepLeft(self, n=1) -> bool :
539
539
  """
540
- 自分を左に移動させる
540
+ n歩左にステップする
541
541
  """
542
- self.client.sendCall(self.uuid, "stepLeft")
542
+ self.client.sendCall(self.uuid, "stepLeft", [n])
543
543
  return str_to_bool(self.client.result)
544
544
 
545
- def stepRight(self) -> bool :
545
+ def stepRight(self, n=1) -> bool :
546
546
  """
547
- 自分を右に移動させる
547
+ n歩右にステップする
548
548
  """
549
- self.client.sendCall(self.uuid, "stepRight")
549
+ self.client.sendCall(self.uuid, "stepRight", [n])
550
550
  return str_to_bool(self.client.result)
551
551
 
552
552
  def turnLeft(self) :
553
553
  """
554
- 自分を左に回転させるaw
554
+ 自分を左に回転させる
555
555
  """
556
556
  self.client.sendCall(self.uuid, "turnLeft")
557
557
 
@@ -595,6 +595,19 @@ class Entity:
595
595
  """
596
596
  self.client.sendCall(self.uuid, "turn", [degrees])
597
597
 
598
+ def facing(self, angle: int):
599
+ """
600
+ 自分を指定した方角に向かせる
601
+ 東:270
602
+ 西:90
603
+ 南:0
604
+ 北:180
605
+
606
+ Args:
607
+ angle (int): 方角
608
+ """
609
+ self.client.sendCall(self.uuid, "facing", [angle])
610
+
598
611
  def placeX(self, x: int, y: int, z: int, cord: Coordinates=Coordinates.local, side=None,) -> bool :
599
612
  """
600
613
  指定した座標にブロックを設置する
@@ -797,6 +810,27 @@ class Entity:
797
810
  self.client.sendCall(self.uuid, "digX", [x, y, z, cord])
798
811
  return str_to_bool(self.client.result)
799
812
 
813
+ def pickupItemsX(self, x : int, y: int, z: int, cord: Coordinates = Coordinates.local) -> int :
814
+ """
815
+ 指定した座標の周辺のアイテムを拾う
816
+
817
+ Args:
818
+ x (int): X座標
819
+ y (int): Y座標
820
+ z (int): Z座標
821
+ cord (Coordinates): 座標の種類('', '^', '~')
822
+ """
823
+ self.client.sendCall(self.uuid, "pickupItemsX", [x, y, z, cord])
824
+ return int(self.client.result)
825
+
826
+ def pickupItems(self) -> int :
827
+ """
828
+ 自分の周辺のアイテムを拾う
829
+
830
+ """
831
+ self.client.sendCall(self.uuid, "pickupItemsX", [0, 0, 0, "^"])
832
+ return int(self.client.result)
833
+
800
834
  def action(self) -> bool :
801
835
  """
802
836
  自分の前方の装置を使う
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2hackCraft2
3
- Version: 1.0.32
3
+ Version: 1.0.34
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,7 +8,6 @@ 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
12
11
 
13
12
  ## 概要
14
13
 
@@ -5,7 +5,7 @@ long_description = (this_directory / "py2hackCraft/README.md").read_text()
5
5
 
6
6
  setup(
7
7
  name="py2hackCraft2",
8
- version="1.0.32",
8
+ version="1.0.34",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
11
  "websocket-client" # websocketライブラリの追加
File without changes
File without changes