mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Added stub classes for Beacon
this doesn't do anything yet, it's intended solely to prevent further loss of data.
This commit is contained in:
60
src/block/tile/Beacon.php
Normal file
60
src/block/tile/Beacon.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\tile;
|
||||
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
|
||||
final class Beacon extends Spawnable{
|
||||
private const TAG_PRIMARY = "primary"; //TAG_Int
|
||||
private const TAG_SECONDARY = "secondary"; //TAG_Int
|
||||
|
||||
/** @var int */
|
||||
private $primaryEffect = 0;
|
||||
/** @var int */
|
||||
private $secondaryEffect = 0;
|
||||
|
||||
protected function addAdditionalSpawnData(CompoundTag $nbt) : void{
|
||||
$nbt->setInt(self::TAG_PRIMARY, $this->primaryEffect);
|
||||
$nbt->setInt(self::TAG_SECONDARY, $this->secondaryEffect);
|
||||
}
|
||||
|
||||
public function readSaveData(CompoundTag $nbt) : void{
|
||||
//TODO: PC uses Primary and Secondary (capitalized first letter), we don't read them here because the IDs would be different
|
||||
$this->primaryEffect = $nbt->getInt(self::TAG_PRIMARY);
|
||||
$this->secondaryEffect = $nbt->getInt(self::TAG_SECONDARY);
|
||||
}
|
||||
|
||||
protected function writeSaveData(CompoundTag $nbt) : void{
|
||||
$nbt->setInt(self::TAG_PRIMARY, $this->primaryEffect);
|
||||
$nbt->setInt(self::TAG_SECONDARY, $this->secondaryEffect);
|
||||
}
|
||||
|
||||
public function getPrimaryEffect() : int{ return $this->primaryEffect; }
|
||||
|
||||
public function setPrimaryEffect(int $primaryEffect) : void{ $this->primaryEffect = $primaryEffect; }
|
||||
|
||||
public function getSecondaryEffect() : int{ return $this->secondaryEffect; }
|
||||
|
||||
public function setSecondaryEffect(int $secondaryEffect) : void{ $this->secondaryEffect = $secondaryEffect; }
|
||||
}
|
Reference in New Issue
Block a user