mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
Bed and Skull items now return a correct block, with appropriate type information
I wanted to do the same for banners, but unfortunately banners are a tad more complicated.
This commit is contained in:
@@ -42,7 +42,7 @@ class Bed extends Item{
|
||||
}
|
||||
|
||||
public function getBlock(?int $clickedFace = null) : Block{
|
||||
return VanillaBlocks::BED();
|
||||
return VanillaBlocks::BED()->setColor($this->color);
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
|
@@ -38,7 +38,9 @@ class Skull extends Item{
|
||||
}
|
||||
|
||||
public function getBlock(?int $clickedFace = null) : Block{
|
||||
return VanillaBlocks::MOB_HEAD();
|
||||
//TODO: we ought to be able to represent this as a regular ItemBlock
|
||||
//but that's not currently possible because the skulltype isn't part of the internal block runtimeID
|
||||
return VanillaBlocks::MOB_HEAD()->setSkullType($this->skullType);
|
||||
}
|
||||
|
||||
public function getSkullType() : SkullType{
|
||||
|
Reference in New Issue
Block a user