From 3a41a798ad52b6d1c8b7caaa152b8055f7b9ce31 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 20 Aug 2019 16:24:47 +0100 Subject: [PATCH] move forced overflow of SetTimePacket to SetTimePacket::create() --- src/network/mcpe/protocol/SetTimePacket.php | 2 +- src/world/World.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);