PocketMine-MP 5.28.1 git-88cdc2eb67c40075559c3ef51418b418cd5488e9
Loading...
Searching...
No Matches
BiomeSurfaceMaterialData.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 $topBlock,
23 private int $midBlock,
24 private int $seaFloorBlock,
25 private int $foundationBlock,
26 private int $seaBlock,
27 private int $seaFloorDepth
28 ){}
29
30 public function getTopBlock() : int{ return $this->topBlock; }
31
32 public function getMidBlock() : int{ return $this->midBlock; }
33
34 public function getSeaFloorBlock() : int{ return $this->seaFloorBlock; }
35
36 public function getFoundationBlock() : int{ return $this->foundationBlock; }
37
38 public function getSeaBlock() : int{ return $this->seaBlock; }
39
40 public function getSeaFloorDepth() : int{ return $this->seaFloorDepth; }
41
42 public static function read(PacketSerializer $in) : self{
43 $topBlock = $in->getLInt();
44 $midBlock = $in->getLInt();
45 $seaFloorBlock = $in->getLInt();
46 $foundationBlock = $in->getLInt();
47 $seaBlock = $in->getLInt();
48 $seaFloorDepth = $in->getLInt();
49
50 return new self(
51 $topBlock,
52 $midBlock,
53 $seaFloorBlock,
54 $foundationBlock,
55 $seaBlock,
56 $seaFloorDepth
57 );
58 }
59
60 public function write(PacketSerializer $out) : void{
61 $out->putLInt($this->topBlock);
62 $out->putLInt($this->midBlock);
63 $out->putLInt($this->seaFloorBlock);
64 $out->putLInt($this->foundationBlock);
65 $out->putLInt($this->seaBlock);
66 $out->putLInt($this->seaFloorDepth);
67 }
68}