py2hackCraft2 1.0.25__tar.gz → 1.0.26__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.25
3
+ Version: 1.0.26
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
@@ -172,7 +172,7 @@ class Side:
172
172
  top = "Top"
173
173
  bottom = "Bottom"
174
174
 
175
- @dataclass
175
+ @dataclass(frozen=True)
176
176
  class Location:
177
177
  """
178
178
  座標を表すデータクラス
@@ -188,7 +188,7 @@ class Location:
188
188
  z: int
189
189
  world: str = "world"
190
190
 
191
- @dataclass
191
+ @dataclass(frozen=True)
192
192
  class InteractEvent:
193
193
  """
194
194
  クリックイベントを表すデータクラス
@@ -218,7 +218,7 @@ class InteractEvent:
218
218
  y: int = 0
219
219
  z: int = 0
220
220
 
221
- @dataclass
221
+ @dataclass(frozen=True)
222
222
  class EventMessage:
223
223
  """
224
224
  イベントメッセージを表すデータクラス
@@ -234,7 +234,7 @@ class EventMessage:
234
234
  message: str
235
235
 
236
236
 
237
- @dataclass
237
+ @dataclass(frozen=True)
238
238
  class ChatMessage:
239
239
  """
240
240
  チャットメッセージを表すデータクラス
@@ -249,7 +249,7 @@ class ChatMessage:
249
249
  entityUuid: str
250
250
  message: str
251
251
 
252
- @dataclass
252
+ @dataclass(frozen=True)
253
253
  class RedstonePower:
254
254
  """
255
255
  レッドストーン信号を表すデータクラス
@@ -262,7 +262,7 @@ class RedstonePower:
262
262
  oldCurrent: int
263
263
  newCurrent: int
264
264
 
265
- @dataclass
265
+ @dataclass(frozen=True)
266
266
  class Block:
267
267
  """
268
268
  ブロックを表すデータクラス
@@ -297,7 +297,7 @@ class Block:
297
297
  z: int = 0
298
298
  world: str = "world"
299
299
 
300
- @dataclass
300
+ @dataclass(frozen=True)
301
301
  class ItemStack:
302
302
  slot: int = 0
303
303
  name: str = "air"
@@ -364,11 +364,12 @@ class Inventory:
364
364
  """
365
365
  インベントリを表すクラス
366
366
  """
367
- def __init__(self, client: _WebSocketClient, entityUUID: str, world: str, x: int, y: int, z:int, size:int):
367
+ def __init__(self, client: _WebSocketClient, entityUUID: str, world: str, x: int, y: int, z:int, size:int, items: list):
368
368
  self.client = client
369
369
  self.entityUUID = entityUUID
370
370
  self.location = Location(x, y, z, world)
371
371
  self.size = size
372
+ self.items = items
372
373
 
373
374
  def getItem(self, slot: int) -> ItemStack :
374
375
  """
@@ -401,25 +402,25 @@ class Inventory:
401
402
  """
402
403
  self.client.sendCall(self.entityUUID, "moveInventoryItem", [self.location.x, self.location.y, self.location.z, slot1, slot2])
403
404
 
404
- def storeItem(self, slot1: int, slot2: int):
405
+ def storeItem(self, item: ItemStack, slot: int):
405
406
  """
406
407
  チェストを開いたエンティティーのインベントリからこのインベントリにアイテムを入れる
407
408
 
408
409
  Args:
409
- slot1 (int): 引き出し元のアイテムのスロット番号
410
- slot2 (int): 格納先のアイテムのスロット番号
410
+ item (ItemStack): 引き出し元になるペットのアイテム
411
+ slot (int): 格納先になるチェストのアイテムスロット番号
411
412
  """
412
- self.client.sendCall(self.entityUUID, "storeInventoryItem", [self.location.x, self.location.y, self.location.z, slot1, slot2])
413
+ self.client.sendCall(self.entityUUID, "storeInventoryItem", [self.location.x, self.location.y, self.location.z, item.slot, slot])
413
414
 
414
- def retrieveItem(self, slot1: int, slot2: int):
415
+ def retrieveItem(self, slot: int, item: ItemStack):
415
416
  """
416
417
  チェストを開いたエンティティーのインベントリからこのインベントリからアイテムを取り出す
417
418
 
418
419
  Args:
419
- slot1 (int): 格納先のアイテムのスロット番号
420
- slot2 (int): 引き出し元のアイテムのスロット番号
420
+ slot (int): 格納先になるペットのアイテムスロット番号
421
+ item (ItemStack): 引き出し元になるチェストのアイテム
421
422
  """
422
- self.client.sendCall(self.entityUUID, "retrieveInventoryItem", [self.location.x, self.location.y, self.location.z, slot1, slot2])
423
+ self.client.sendCall(self.entityUUID, "retrieveInventoryItem", [self.location.x, self.location.y, self.location.z, slot, item.slot])
423
424
 
424
425
 
425
426
  class Entity:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2hackCraft2
3
- Version: 1.0.25
3
+ Version: 1.0.26
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.25",
8
+ version="1.0.26",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
11
  "websocket-client" # websocketライブラリの追加
File without changes
File without changes