mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2025-01-03 06:28:17 +01:00
feedback: pass x, y, z as arguments since types classes are supposed to abstract away the python types and sending them over the network and calling an encode method before sending breaks that a little.
This commit is contained in:
parent
9ab2e1ae69
commit
d8fc742862
@ -245,9 +245,6 @@ class Position(Type):
|
||||
return {'x': x, 'y': y, 'z': z}
|
||||
|
||||
@staticmethod
|
||||
def send(value, socket):
|
||||
def send(x, y, z, socket):
|
||||
value = ((x & 0x3FFFFFF) << 38) | ((y & 0xFFF) << 26) | (z & 0x3FFFFFF)
|
||||
UnsignedLong.send(value, socket)
|
||||
|
||||
@staticmethod
|
||||
def encode(x, y, z):
|
||||
return ((x & 0x3FFFFFF) << 38) | ((y & 0xFFF) << 26) | (z & 0x3FFFFFF)
|
||||
|
Loading…
Reference in New Issue
Block a user