mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Add runtime support for wall connections
this doesn't match the 1.16+ behaviour yet, but it at least recognizes walls that are already in the post-1.16 way and doesn't break them if not interacted with.
This commit is contained in:
@ -28,6 +28,7 @@ use pocketmine\block\utils\CoralType;
|
||||
use pocketmine\block\utils\DyeColor;
|
||||
use pocketmine\block\utils\SlabType;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\block\utils\WallConnectionType;
|
||||
use pocketmine\data\bedrock\block\BlockStateData;
|
||||
use pocketmine\data\bedrock\block\BlockStateNames;
|
||||
use pocketmine\data\bedrock\block\BlockStateSerializeException;
|
||||
@ -263,6 +264,17 @@ final class BlockStateWriter{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/** @return $this */
|
||||
public function writeWallConnectionType(string $name, ?WallConnectionType $wallConnectionType) : self{
|
||||
$this->writeString($name, match($wallConnectionType){
|
||||
null => StringValues::WALL_CONNECTION_TYPE_EAST_NONE,
|
||||
WallConnectionType::SHORT() => StringValues::WALL_CONNECTION_TYPE_EAST_SHORT,
|
||||
WallConnectionType::TALL() => StringValues::WALL_CONNECTION_TYPE_EAST_TALL,
|
||||
default => throw new BlockStateSerializeException("Invalid Wall connection type " . $wallConnectionType->name())
|
||||
});
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBlockStateData() : BlockStateData{
|
||||
return new BlockStateData($this->id, $this->states, BlockStateData::CURRENT_VERSION);
|
||||
}
|
||||
|
Reference in New Issue
Block a user