mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
move forced overflow of SetTimePacket to SetTimePacket::create()
This commit is contained in:
parent
794c7b2469
commit
3a41a798ad
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user