Fix: networking.types.Position.send() doesn't accept a Position.
This commit is contained in:
commit
c90afe4424
|
@ -29,8 +29,7 @@ class BlockChangePacket(Packet):
|
|||
|
||||
def write(self, socket, compression_threshold=None):
|
||||
packet_buffer = PacketBuffer()
|
||||
(x, y, z) = self.location
|
||||
Position.send(x, y, z, packet_buffer)
|
||||
Position.send(self.location, packet_buffer)
|
||||
blockData = ((self.blockId << 4) | (self.blockMeta & 0xF))
|
||||
VarInt.send(blockData)
|
||||
self._write_buffer(socket, packet_buffer, compression_threshold)
|
||||
|
|
|
@ -263,7 +263,9 @@ class Position(Type, namedtuple('Position', ('x', 'y', 'z'))):
|
|||
return Position(x=x, y=y, z=z)
|
||||
|
||||
@staticmethod
|
||||
def send(x, y, z, socket):
|
||||
def send(position, socket):
|
||||
# 'position' can be either a tuple or Position object.
|
||||
x, y, z = position
|
||||
value = ((x & 0x3FFFFFF) << 38) | ((y & 0xFFF) << 26) | (z & 0x3FFFFFF)
|
||||
UnsignedLong.send(value, socket)
|
||||
|
||||
|
|
Loading…
Reference in New Issue