mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Mojang cannot be relied on ...
This commit is contained in:
@ -70,13 +70,16 @@ final class BlockStateUpgradeSchema{
|
||||
public int $maxVersionMajor,
|
||||
public int $maxVersionMinor,
|
||||
public int $maxVersionPatch,
|
||||
public int $maxVersionRevision
|
||||
public int $maxVersionRevision,
|
||||
private int $priority
|
||||
){}
|
||||
|
||||
public function getVersionId() : int{
|
||||
return ($this->maxVersionMajor << 24) | ($this->maxVersionMinor << 16) | ($this->maxVersionPatch << 8) | $this->maxVersionRevision;
|
||||
}
|
||||
|
||||
public function getPriority() : int{ return $this->priority; }
|
||||
|
||||
public function isEmpty() : bool{
|
||||
foreach([
|
||||
$this->renamedIds,
|
||||
@ -93,22 +96,4 @@ final class BlockStateUpgradeSchema{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isBackwardsCompatible() : bool{
|
||||
if($this->backwardsCompatible === null){
|
||||
$this->backwardsCompatible = true;
|
||||
foreach([
|
||||
$this->renamedIds,
|
||||
$this->removedProperties,
|
||||
$this->remappedPropertyValues,
|
||||
$this->remappedStates
|
||||
] as $bcBreakingRules){
|
||||
if(count($bcBreakingRules) !== 0){
|
||||
$this->backwardsCompatible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//schemas which only add properties are backwards compatible
|
||||
return $this->backwardsCompatible;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user