py2hackCraft2 1.1.39__tar.gz → 1.1.41__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.4
2
2
  Name: py2hackCraft2
3
- Version: 1.1.39
3
+ Version: 1.1.41
4
4
  Summary: Python client library for hackCraft2
5
5
  Home-page: https://github.com/0x48lab/hackCraft2-python
6
6
  Author: masafumi_t
@@ -585,7 +585,7 @@ class Inventory:
585
585
  """
586
586
  self.client.send_call(self.entity_uuid, "moveInventoryItem", [self.location.x, self.location.y, self.location.z, from_slot, to_slot])
587
587
 
588
- def retrieve_from_self(self, from_slot: int, to_slot: int):
588
+ def retrieve_to_self(self, from_slot: int, to_slot: int):
589
589
  """
590
590
  チェストから自分のインベントリにアイテムを取り出す
591
591
 
@@ -601,7 +601,7 @@ class Inventory:
601
601
  """
602
602
  self.client.send_call(self.entity_uuid, "retrieveInventoryItem", [self.location.x, self.location.y, self.location.z, to_slot, from_slot])
603
603
 
604
- def store_to_self(self, from_slot: int, to_slot: int):
604
+ def store_from_self(self, from_slot: int, to_slot: int):
605
605
  """
606
606
  自分のインベントリからチェストにアイテムを格納する
607
607
 
@@ -1295,12 +1295,37 @@ class Entity:
1295
1295
 
1296
1296
  def harvest(self) -> bool:
1297
1297
  """
1298
- 自分の位置のブロックを収穫する
1298
+ 自分の位置または足元の作物を収穫する
1299
+ (0, 0, 0) または (0, -1, 0) の位置にある収穫可能な作物を自動的に収穫します
1299
1300
 
1300
1301
  Returns:
1301
- bool: 操作が成功した場合はTrue、失敗した場合はFalse
1302
+ bool: 収穫が成功した場合はTrue、失敗した場合はFalse
1303
+ """
1304
+ self.client.send_call(self.uuid, "harvest")
1305
+ return str_to_bool(self.client.result)
1306
+
1307
+ def plant(self) -> bool:
1308
+ """
1309
+ 自分の足元に作物を植える
1310
+ 常に無限で、インベントリチェックなし
1311
+ (0, -1, 0) の位置にある耕地に作物を植えます
1312
+
1313
+ Returns:
1314
+ bool: 植えるのが成功した場合はTrue、失敗した場合はFalse
1315
+ """
1316
+ self.client.send_call(self.uuid, "plant")
1317
+ return str_to_bool(self.client.result)
1318
+
1319
+ def fertilizer(self) -> bool:
1320
+ """
1321
+ 自分の足元の作物に肥料(骨粉)を与える
1322
+ 常に無限で、インベントリチェックなし
1323
+ (0, -1, 0) または (0, 0, 0) の位置にある作物に肥料を与えます
1324
+
1325
+ Returns:
1326
+ bool: 肥料を与えるのが成功した場合はTrue、失敗した場合はFalse
1302
1327
  """
1303
- self.client.send_call(self.uuid, "digX", [0, 0, 0])
1328
+ self.client.send_call(self.uuid, "fertilizer")
1304
1329
  return str_to_bool(self.client.result)
1305
1330
 
1306
1331
  def dig(self) -> bool:
@@ -1356,6 +1381,62 @@ class Entity:
1356
1381
  self.client.send_call(self.uuid, "plantX", [loc.x, loc.y, loc.z, loc.cord])
1357
1382
  return str_to_bool(self.client.result)
1358
1383
 
1384
+ def harvest_at(self, loc: Location) -> bool:
1385
+ """
1386
+ 指定した座標の作物を収穫する
1387
+ 常に無限で、インベントリチェックなし
1388
+ 指定された位置にある収穫可能な作物を収穫します
1389
+
1390
+ Args:
1391
+ loc (Location): 座標情報(LocationFactory.absolute/relative/localで生成)
1392
+
1393
+ Returns:
1394
+ bool: 収穫が成功した場合はTrue、失敗した場合はFalse
1395
+
1396
+ Example:
1397
+ .. code-block:: python
1398
+
1399
+ # 絶対座標(100, 64, -200)の作物を収穫
1400
+ loc = LocationFactory.absolute(100, 64, -200)
1401
+ entity.harvest_at(loc)
1402
+
1403
+ .. code-block:: python
1404
+
1405
+ # 自分の足元の作物を収穫
1406
+ loc = LocationFactory.local(0, -1, 0)
1407
+ entity.harvest_at(loc)
1408
+ """
1409
+ self.client.send_call(self.uuid, "harvestAt", [loc.x, loc.y, loc.z, loc.cord])
1410
+ return str_to_bool(self.client.result)
1411
+
1412
+ def fertilizer_at(self, loc: Location) -> bool:
1413
+ """
1414
+ 指定した座標の作物に肥料(骨粉)を与える
1415
+ 常に無限で、インベントリチェックなし
1416
+ 指定された位置にある作物に肥料を与えます
1417
+
1418
+ Args:
1419
+ loc (Location): 座標情報(LocationFactory.absolute/relative/localで生成)
1420
+
1421
+ Returns:
1422
+ bool: 肥料を与えるのが成功した場合はTrue、失敗した場合はFalse
1423
+
1424
+ Example:
1425
+ .. code-block:: python
1426
+
1427
+ # 絶対座標(100, 64, -200)の作物に肥料を与える
1428
+ loc = LocationFactory.absolute(100, 64, -200)
1429
+ entity.fertilizer_at(loc)
1430
+
1431
+ .. code-block:: python
1432
+
1433
+ # 自分の足元の作物に肥料を与える
1434
+ loc = LocationFactory.local(0, -1, 0)
1435
+ entity.fertilizer_at(loc)
1436
+ """
1437
+ self.client.send_call(self.uuid, "fertilizerAt", [loc.x, loc.y, loc.z, loc.cord])
1438
+ return str_to_bool(self.client.result)
1439
+
1359
1440
  def till_at(self, loc: Location) -> bool:
1360
1441
  """
1361
1442
  指定した座標のブロックを耕す
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py2hackCraft2
3
- Version: 1.1.39
3
+ Version: 1.1.41
4
4
  Summary: Python client library for hackCraft2
5
5
  Home-page: https://github.com/0x48lab/hackCraft2-python
6
6
  Author: masafumi_t
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="py2hackCraft2",
5
- version="1.1.39",
5
+ version="1.1.41",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "websocket-client>=1.6.0",
File without changes
File without changes