mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
[BC break] doors don't have a powered flag in Bedrock
This commit is contained in:
parent
d10d660a4d
commit
3ae9341c52
@ -98,7 +98,6 @@ final class BlockLegacyMetadata{
|
||||
public const DOOR_FLAG_TOP = 0x08;
|
||||
public const DOOR_BOTTOM_FLAG_OPEN = 0x04;
|
||||
public const DOOR_TOP_FLAG_RIGHT = 0x01;
|
||||
public const DOOR_TOP_FLAG_POWERED = 0x02;
|
||||
|
||||
public const DOUBLE_PLANT_SUNFLOWER = 0;
|
||||
public const DOUBLE_PLANT_LILAC = 1;
|
||||
|
@ -36,7 +36,6 @@ use pocketmine\world\sound\DoorSound;
|
||||
|
||||
class Door extends Transparent{
|
||||
use HorizontalFacingTrait;
|
||||
use PoweredByRedstoneTrait;
|
||||
|
||||
protected bool $top = false;
|
||||
protected bool $hingeRight = false;
|
||||
@ -45,8 +44,7 @@ class Door extends Transparent{
|
||||
protected function writeStateToMeta() : int{
|
||||
if($this->top){
|
||||
return BlockLegacyMetadata::DOOR_FLAG_TOP |
|
||||
($this->hingeRight ? BlockLegacyMetadata::DOOR_TOP_FLAG_RIGHT : 0) |
|
||||
($this->powered ? BlockLegacyMetadata::DOOR_TOP_FLAG_POWERED : 0);
|
||||
($this->hingeRight ? BlockLegacyMetadata::DOOR_TOP_FLAG_RIGHT : 0);
|
||||
}
|
||||
|
||||
return BlockDataSerializer::writeLegacyHorizontalFacing(Facing::rotateY($this->facing, true)) | ($this->open ? BlockLegacyMetadata::DOOR_BOTTOM_FLAG_OPEN : 0);
|
||||
@ -56,7 +54,6 @@ class Door extends Transparent{
|
||||
$this->top = ($stateMeta & BlockLegacyMetadata::DOOR_FLAG_TOP) !== 0;
|
||||
if($this->top){
|
||||
$this->hingeRight = ($stateMeta & BlockLegacyMetadata::DOOR_TOP_FLAG_RIGHT) !== 0;
|
||||
$this->powered = ($stateMeta & BlockLegacyMetadata::DOOR_TOP_FLAG_POWERED) !== 0;
|
||||
}else{
|
||||
$this->facing = Facing::rotateY(BlockDataSerializer::readLegacyHorizontalFacing($stateMeta & 0x03), false);
|
||||
$this->open = ($stateMeta & BlockLegacyMetadata::DOOR_BOTTOM_FLAG_OPEN) !== 0;
|
||||
@ -78,7 +75,6 @@ class Door extends Transparent{
|
||||
$this->open = $other->open;
|
||||
}else{
|
||||
$this->hingeRight = $other->hingeRight;
|
||||
$this->powered = $other->powered;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user