PocketMine-MP 5.28.1 git-88cdc2eb67c40075559c3ef51418b418cd5488e9
Loading...
Searching...
No Matches
BiomeMountainParamsData.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 int $steepBlock,
23 private bool $northSlopes,
24 private bool $southSlopes,
25 private bool $westSlopes,
26 private bool $eastSlopes,
27 private bool $topSlideEnabled,
28 ){}
29
30 public function getSteepBlock() : int{ return $this->steepBlock; }
31
32 public function hasNorthSlopes() : bool{ return $this->northSlopes; }
33
34 public function hasSouthSlopes() : bool{ return $this->southSlopes; }
35
36 public function hasWestSlopes() : bool{ return $this->westSlopes; }
37
38 public function hasEastSlopes() : bool{ return $this->eastSlopes; }
39
40 public function hasTopSlideEnabled() : bool{ return $this->topSlideEnabled; }
41
42 public static function read(PacketSerializer $in) : self{
43 $steepBlock = $in->getLInt();
44 $northSlopes = $in->getBool();
45 $southSlopes = $in->getBool();
46 $westSlopes = $in->getBool();
47 $eastSlopes = $in->getBool();
48 $topSlideEnabled = $in->getBool();
49
50 return new self(
51 $steepBlock,
52 $northSlopes,
53 $southSlopes,
54 $westSlopes,
55 $eastSlopes,
56 $topSlideEnabled
57 );
58 }
59
60 public function write(PacketSerializer $out) : void{
61 $out->putLInt($this->steepBlock);
62 $out->putBool($this->northSlopes);
63 $out->putBool($this->southSlopes);
64 $out->putBool($this->westSlopes);
65 $out->putBool($this->eastSlopes);
66 $out->putBool($this->topSlideEnabled);
67 }
68}