mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
RuntimeBlockStateRegistry: throw a hard error on blockstates that return different state data than they were given
this suggests improper validation of state data.
This commit is contained in:
parent
4c3892b2d6
commit
e6f1cb69d1
@ -100,7 +100,7 @@ class RuntimeBlockStateRegistry{
|
|||||||
$v->decodeStateData($stateData);
|
$v->decodeStateData($stateData);
|
||||||
if($v->computeStateData() !== $stateData){
|
if($v->computeStateData() !== $stateData){
|
||||||
//TODO: this should probably be a hard error
|
//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
|
}catch(InvalidSerializedRuntimeDataException){ //invalid property combination, leave it
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user