From e6f1cb69d1ee6871d21ff1c664cf74d1c7cceb09 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 16 Feb 2023 15:44:58 +0000 Subject: [PATCH] RuntimeBlockStateRegistry: throw a hard error on blockstates that return different state data than they were given this suggests improper validation of state data. --- src/block/RuntimeBlockStateRegistry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/block/RuntimeBlockStateRegistry.php b/src/block/RuntimeBlockStateRegistry.php index 15106d227c..ae6386e33c 100644 --- a/src/block/RuntimeBlockStateRegistry.php +++ b/src/block/RuntimeBlockStateRegistry.php @@ -100,7 +100,7 @@ class RuntimeBlockStateRegistry{ $v->decodeStateData($stateData); if($v->computeStateData() !== $stateData){ //TODO: this should probably be a hard error - throw new InvalidSerializedRuntimeDataException(get_class($block) . "::decodeStateData() accepts invalid state data (returned " . $v->computeStateData() . " for input $stateData)"); + throw new \LogicException(get_class($block) . "::decodeStateData() accepts invalid state data (returned " . $v->computeStateData() . " for input $stateData)"); } }catch(InvalidSerializedRuntimeDataException){ //invalid property combination, leave it continue;