mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Make Block::decodeState() and encodeState() more codegen-friendly
This commit is contained in:
@ -43,15 +43,11 @@ class Vine extends Flowable{
|
||||
public function getRequiredStateDataBits() : int{ return 4; }
|
||||
|
||||
protected function decodeState(RuntimeDataReader $r) : void{
|
||||
foreach(Facing::HORIZONTAL as $facing){
|
||||
$this->setFace($facing, $r->readBool());
|
||||
}
|
||||
$this->faces = $r->readHorizontalFacingFlags();
|
||||
}
|
||||
|
||||
protected function encodeState(RuntimeDataWriter $w) : void{
|
||||
foreach(Facing::HORIZONTAL as $facing){
|
||||
$w->writeBool($this->hasFace($facing));
|
||||
}
|
||||
$w->writeHorizontalFacingFlags($this->faces);
|
||||
}
|
||||
|
||||
/** @return int[] */
|
||||
|
Reference in New Issue
Block a user