py2hackCraft2 1.0.13__tar.gz → 1.0.15__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.13
3
+ Version: 1.0.15
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
@@ -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
- return Entity(self.client, self.world, result)
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
  チャットを受信するまでまつ
@@ -620,6 +630,13 @@ class Entity:
620
630
  self.client.sendCall(self.uuid, "digX", [0, 0, 0])
621
631
  return str_to_bool(self.client.result)
622
632
 
633
+ def attack(self) -> bool :
634
+ """
635
+ 自分の前方を攻撃する。
636
+ """
637
+ self.client.sendCall(self.uuid, "attack")
638
+ return str_to_bool(self.client.result)
639
+
623
640
  def dig(self) -> bool :
624
641
  """
625
642
  自分の前方のブロックを壊す。
@@ -648,6 +665,27 @@ class Entity:
648
665
  self.client.sendCall(self.uuid, "digX", [x, y, z])
649
666
  return str_to_bool(self.client.result)
650
667
 
668
+ def action(self) -> bool :
669
+ """
670
+ 自分の前方の装置を使う。
671
+ """
672
+ self.client.sendCall(self.uuid, "actionFront")
673
+ return str_to_bool(self.client.result)
674
+
675
+ def actionUp(self) -> bool :
676
+ """
677
+ 自分の真上の装置を使う。
678
+ """
679
+ self.client.sendCall(self.uuid, "actionUp")
680
+ return str_to_bool(self.client.result)
681
+
682
+ def actionDown(self) -> bool :
683
+ """
684
+ 自分の真下の装置を使う。
685
+ """
686
+ self.client.sendCall(self.uuid, "actionDown")
687
+ return str_to_bool(self.client.result)
688
+
651
689
  def setItem(self, slot: int, block: str) -> bool :
652
690
  """
653
691
  自分のインベントリにアイテムを設定する。
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2hackCraft2
3
- Version: 1.0.13
3
+ Version: 1.0.15
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
@@ -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.13",
8
+ version="1.0.15",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
11
  "websocket-client" # websocketライブラリの追加
File without changes
File without changes