Exemplo n.º 1
0
 def read(self, nbt: NBT, network: bool = False):
     size = nbt.getInt(network)
     if nbt.endianness == NBT.LITTLE_ENDIAN:
         array = struct.unpack("<L" * len(self.value), *nbt.get(size * 4))
     else:
         array = struct.unpack(">L" * len(self.value), *nbt.get(size * 4))
     self.value = [v for key in array for v in key]
Exemplo n.º 2
0
 def read(self, nbt: NBT, network: bool = False):
     self.value = {}
     self.tagType = nbt.getByte()
     size = nbt.getInt(network)
     i = 0
     while i < size and not nbt.feof():
         if self.tagType == NBT.TAG_Byte:
             tag = ByteTag("")
Exemplo n.º 3
0
 def read(self, nbt: NBT, network: bool = False):
     self.value = nbt.getString(network)
Exemplo n.º 4
0
 def write(self, nbt: NBT, network: bool = False):
     nbt.putString(self.value, network)
Exemplo n.º 5
0
 def write(self, nbt: NBT, network: bool = False):
     nbt.putShort(self.value)
Exemplo n.º 6
0
 def read(self, nbt: NBT, network: bool = False):
     self.value = nbt.getShort()
Exemplo n.º 7
0
 def write(self, nbt: NBT, network: bool = False):
     nbt.putInt(len(self.value), network)
     if nbt.endianness == NBT.LITTLE_ENDIAN:
         nbt.put(struct.pack("<L" * len(self.value), *self.value))
     else:
         nbt.put(struct.pack(">L" * len(self.value), *self.value))
Exemplo n.º 8
0
 def read(self, nbt: NBT, network: bool = False):
     self.value = nbt.getDouble()
Exemplo n.º 9
0
 def write(self, nbt: NBT, network: bool = False):
     nbt.putDouble(self.value)