PocketMine-MP 5.28.1 git-88cdc2eb67c40075559c3ef51418b418cd5488e9
Loading...
Searching...
No Matches
BiomeMultinoiseGenRulesData.php
1<?php
2
3/*
4 * This file is part of BedrockProtocol.
5 * Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6 *
7 * BedrockProtocol is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13declare(strict_types=1);
14
15namespace pocketmine\network\mcpe\protocol\types\biome\chunkgen;
16
18
20
21 public function __construct(
22 private float $temperature,
23 private float $humidity,
24 private float $altitude,
25 private float $weirdness,
26 private float $weight,
27 ){}
28
29 public function getTemperature() : float{ return $this->temperature; }
30
31 public function getHumidity() : float{ return $this->humidity; }
32
33 public function getAltitude() : float{ return $this->altitude; }
34
35 public function getWeirdness() : float{ return $this->weirdness; }
36
37 public function getWeight() : float{ return $this->weight; }
38
39 public static function read(PacketSerializer $in) : self{
40 $temperature = $in->getLFloat();
41 $humidity = $in->getLFloat();
42 $altitude = $in->getLFloat();
43 $weirdness = $in->getLFloat();
44 $weight = $in->getLFloat();
45
46 return new self(
47 $temperature,
48 $humidity,
49 $altitude,
50 $weirdness,
51 $weight
52 );
53 }
54
55 public function write(PacketSerializer $out) : void{
56 $out->putLFloat($this->temperature);
57 $out->putLFloat($this->humidity);
58 $out->putLFloat($this->altitude);
59 $out->putLFloat($this->weirdness);
60 $out->putLFloat($this->weight);
61 }
62}