Block: change confusing naming of decode/computeStateData

these actually accept a combination of type and state data, so it's a bit inconsistent with other references to 'state data'.
This commit is contained in:
Dylan K. Taylor
2023-03-02 17:42:44 +00:00
parent 972f107972
commit 95c18ef99a
3 changed files with 8 additions and 8 deletions

View File

@ -97,10 +97,10 @@ class RuntimeBlockStateRegistry{
for($stateData = 0; $stateData < (1 << $bits); ++$stateData){
$v = clone $block;
try{
$v->decodeStateData($stateData);
if($v->computeStateData() !== $stateData){
$v->decodeTypeAndStateData($stateData);
if($v->computeTypeAndStateData() !== $stateData){
//TODO: this should probably be a hard error
throw new \LogicException(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->computeTypeAndStateData() . " for input $stateData)");
}
}catch(InvalidSerializedRuntimeDataException){ //invalid property combination, leave it
continue;