mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Torch facings are the wrong way round :(
This commit is contained in:
parent
ccfe485c06
commit
4d935aa8b6
@ -241,13 +241,14 @@ final class BlockStateReader{
|
||||
* @throws BlockStateDeserializeException
|
||||
*/
|
||||
public function readTorchFacing() : int{
|
||||
//TODO: horizontal directions are flipped (MCPE bug: https://bugs.mojang.com/browse/MCPE-152036)
|
||||
return match($rawValue = $this->readString(BlockStateNames::TORCH_FACING_DIRECTION)){
|
||||
StringValues::TORCH_FACING_DIRECTION_EAST => Facing::EAST,
|
||||
StringValues::TORCH_FACING_DIRECTION_NORTH => Facing::NORTH,
|
||||
StringValues::TORCH_FACING_DIRECTION_SOUTH => Facing::SOUTH,
|
||||
StringValues::TORCH_FACING_DIRECTION_EAST => Facing::WEST,
|
||||
StringValues::TORCH_FACING_DIRECTION_NORTH => Facing::SOUTH,
|
||||
StringValues::TORCH_FACING_DIRECTION_SOUTH => Facing::NORTH,
|
||||
StringValues::TORCH_FACING_DIRECTION_TOP => Facing::UP,
|
||||
StringValues::TORCH_FACING_DIRECTION_UNKNOWN => Facing::UP, //should be illegal, but 1.13 allows it
|
||||
StringValues::TORCH_FACING_DIRECTION_WEST => Facing::WEST,
|
||||
StringValues::TORCH_FACING_DIRECTION_WEST => Facing::EAST,
|
||||
default => throw $this->badValueException(BlockStateNames::TORCH_FACING_DIRECTION, $rawValue, "Invalid torch facing"),
|
||||
};
|
||||
}
|
||||
|
@ -195,12 +195,13 @@ final class BlockStateWriter{
|
||||
|
||||
/** @return $this */
|
||||
public function writeTorchFacing(int $facing) : self{
|
||||
//TODO: horizontal directions are flipped (MCPE bug: https://bugs.mojang.com/browse/MCPE-152036)
|
||||
$this->writeString(BlockStateNames::TORCH_FACING_DIRECTION, match($facing){
|
||||
Facing::UP => StringValues::TORCH_FACING_DIRECTION_TOP,
|
||||
Facing::NORTH => StringValues::TORCH_FACING_DIRECTION_NORTH,
|
||||
Facing::SOUTH => StringValues::TORCH_FACING_DIRECTION_SOUTH,
|
||||
Facing::WEST => StringValues::TORCH_FACING_DIRECTION_WEST,
|
||||
Facing::EAST => StringValues::TORCH_FACING_DIRECTION_EAST,
|
||||
Facing::SOUTH => StringValues::TORCH_FACING_DIRECTION_NORTH,
|
||||
Facing::NORTH => StringValues::TORCH_FACING_DIRECTION_SOUTH,
|
||||
Facing::EAST => StringValues::TORCH_FACING_DIRECTION_WEST,
|
||||
Facing::WEST => StringValues::TORCH_FACING_DIRECTION_EAST,
|
||||
default => throw new BlockStateSerializeException("Invalid Torch facing $facing")
|
||||
});
|
||||
return $this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user