mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Fixed glowing item frames
due to technical limitations, this requires separating them back into two different block types. However, this isn't too egregious since it's just one flag, and actually simplifies some code. closes #5478
This commit is contained in:
@ -44,20 +44,12 @@ class ItemFrame extends Flowable{
|
||||
|
||||
public const ROTATIONS = 8;
|
||||
|
||||
protected bool $glowing = false;
|
||||
|
||||
protected bool $hasMap = false; //makes frame appear large if set
|
||||
|
||||
protected ?Item $framedItem = null;
|
||||
protected int $itemRotation = 0;
|
||||
protected float $itemDropChance = 1.0;
|
||||
|
||||
public function getRequiredTypeDataBits() : int{ return 1; }
|
||||
|
||||
protected function describeType(RuntimeDataReader|RuntimeDataWriter $w) : void{
|
||||
$w->bool($this->glowing);
|
||||
}
|
||||
|
||||
public function getRequiredStateDataBits() : int{ return 4; }
|
||||
|
||||
protected function describeState(RuntimeDataReader|RuntimeDataWriter $w) : void{
|
||||
@ -141,14 +133,6 @@ class ItemFrame extends Flowable{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isGlowing() : bool{ return $this->glowing; }
|
||||
|
||||
/** @return $this */
|
||||
public function setGlowing(bool $glowing) : self{
|
||||
$this->glowing = $glowing;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
||||
if($this->framedItem !== null){
|
||||
$this->itemRotation = ($this->itemRotation + 1) % self::ROTATIONS;
|
||||
|
Reference in New Issue
Block a user