diff --git a/minecraft/networking/packets/clientbound/play/__init__.py b/minecraft/networking/packets/clientbound/play/__init__.py index 692507b..d548588 100644 --- a/minecraft/networking/packets/clientbound/play/__init__.py +++ b/minecraft/networking/packets/clientbound/play/__init__.py @@ -316,4 +316,4 @@ class EntityLookPacket(Packet): {'yaw': Angle}, {'pitch': Angle}, {'on_ground': Boolean} - ] \ No newline at end of file + ] diff --git a/minecraft/networking/types/basic.py b/minecraft/networking/types/basic.py index 5d48b23..437a4ec 100644 --- a/minecraft/networking/types/basic.py +++ b/minecraft/networking/types/basic.py @@ -124,6 +124,7 @@ class Angle(Type): # Linearly transform angle in steps of 1/256 into steps of 1/360 return 360 * UnsignedByte.read(file_object) / 255 + @staticmethod def send(value, socket): # Normalize angle between 0 and 255 and convert to int. UnsignedByte.send(int(255 * (value / 360)), socket) @@ -323,4 +324,3 @@ class Position(Type, Vector): if context.protocol_version >= 443 else (x & 0x3FFFFFF) << 38 | (y & 0xFFF) << 26 | (z & 0x3FFFFFF)) UnsignedLong.send(value, socket) - diff --git a/tests/test_serialization.py b/tests/test_serialization.py index 0daff0f..fb05a76 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -60,7 +60,6 @@ class SerializationTest(unittest.TestCase): self.assertAlmostEqual( test_data, deserialized, delta=1.0/32.0) elif data_type is Angle: - print(test_data - deserialized) self.assertAlmostEqual(test_data, deserialized, delta=360/255) elif data_type is Float or data_type is Double: self.assertAlmostEquals(test_data, deserialized, 3)