bta-proxy/bta_proxy/itemstack.py

18 lines
495 B
Python
Raw Normal View History

2023-08-24 17:40:23 +03:00
from bta_proxy.datainputstream import DataInputStream
class ItemStack:
__slots__ = ("item_id", "count", "data")
def __init__(self, item_id: int, count: int, data: int):
self.item_id = item_id
self.count = count
self.data = data
@classmethod
def read_from(cls, stream: DataInputStream) -> 'ItemStack':
item_id = stream.read_short()
count = stream.read_byte()
data = stream.read_ushort()
return cls(item_id, count, data)