Fix tests to work with new Angle type@

This commit is contained in:
Zachy committed 2019-05-17 02:09:27 +01:00
1 parent 22008c5c5c
commit 93f6d269da
4 files changed
+23 -8

No files matched your search

@@ -4,8 +4,7 @@ from minecraft.networking.packets import (
from minecraft.networking.types import (
Integer, FixedPointInteger, UnsignedByte, Byte, Boolean, UUID, Short,
VarInt, Double, Float, String, Enum, Difficulty, Dimension, GameMode,
Angle
VarInt, Double, Float, String, Enum, Difficulty, Dimension, GameMode, Angle
)
from .combat_event_packet import CombatEventPacket
+1 -1
View File
@@ -127,7 +127,7 @@ class Angle(Type):
@staticmethod
def send(value, socket):
# Normalize angle between 0 and 255 and convert to int.
UnsignedByte.send(int(255 * (value / 360)), socket)
UnsignedByte.send(round(255 * (value / 360)), socket)
class VarInt(Type):