mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user