mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Tighten validity checks for block metadata
This filters out over 200 invalid states which were previously considered just fine, including zero-width cakes, buttons with broken facing values, furnace/chest with crazy values, and more.
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\block\utils\InvalidBlockStateException;
|
||||
use pocketmine\math\Facing;
|
||||
|
||||
class Rail extends BaseRail{
|
||||
@ -66,8 +67,8 @@ class Rail extends BaseRail{
|
||||
}
|
||||
}
|
||||
|
||||
protected function getConnectionsFromMeta(int $meta) : array{
|
||||
return self::CURVE_CONNECTIONS[$meta] ?? self::CONNECTIONS[$meta] ?? [];
|
||||
protected function getConnectionsFromMeta(int $meta) : ?array{
|
||||
return self::CURVE_CONNECTIONS[$meta] ?? self::CONNECTIONS[$meta] ?? null;
|
||||
}
|
||||
|
||||
protected function getPossibleConnectionDirectionsOneConstraint(int $constraint) : array{
|
||||
|
Reference in New Issue
Block a user