diff --git a/src/network/mcpe/protocol/SetTimePacket.php b/src/network/mcpe/protocol/SetTimePacket.php index afc7cd2dc..a86d87046 100644 --- a/src/network/mcpe/protocol/SetTimePacket.php +++ b/src/network/mcpe/protocol/SetTimePacket.php @@ -35,7 +35,7 @@ class SetTimePacket extends DataPacket implements ClientboundPacket{ public static function create(int $time) : self{ $result = new self; - $result->time = $time; + $result->time = $time & 0xffffffff; //avoid overflowing the field, since the packet uses an int32 return $result; } diff --git a/src/world/World.php b/src/world/World.php index c1c3c61c6..b697d3711 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -691,7 +691,7 @@ class World implements ChunkManager{ * @param Player ...$targets If empty, will send to all players in the world. */ public function sendTime(Player ...$targets){ - $pk = SetTimePacket::create($this->time & 0xffffffff); //avoid overflowing the field, since the packet uses an int32 + $pk = SetTimePacket::create($this->time); if(empty($targets)){ $this->broadcastGlobalPacket($pk);