Obliterate BlockLegacyIds

This commit is contained in:
Dylan K. Taylor
2022-06-25 14:42:32 +01:00
parent cac72d73fb
commit 00b4e4016c
5 changed files with 498 additions and 1011 deletions

View File

@ -32,19 +32,15 @@ class BlockIdentifier{
*/
public function __construct(
private int $blockTypeId,
private int $legacyBlockId,
private int $legacyVariant,
private ?int $legacyItemId = null,
private int $legacyItemId,
private int $legacyItemVariant,
private ?string $tileClass = null
){
if($blockTypeId < 0){
throw new \InvalidArgumentException("Block type ID may not be negative");
}
if($legacyBlockId < 0){
throw new \InvalidArgumentException("Legacy block ID may not be negative");
}
if($legacyVariant < 0){
throw new \InvalidArgumentException("Legacy block variant may not be negative");
if($legacyItemVariant < 0){
throw new \InvalidArgumentException("Legacy item variant may not be negative");
}
if($tileClass !== null){
@ -54,25 +50,18 @@ class BlockIdentifier{
public function getBlockTypeId() : int{ return $this->blockTypeId; }
/**
* @deprecated
*/
public function getLegacyBlockId() : int{
return $this->legacyBlockId;
}
/**
* @deprecated
*/
public function getLegacyVariant() : int{
return $this->legacyVariant;
return $this->legacyItemVariant;
}
/**
* @deprecated
*/
public function getLegacyItemId() : int{
return $this->legacyItemId ?? ($this->legacyBlockId > 255 ? 255 - $this->legacyBlockId : $this->legacyBlockId);
return $this->legacyItemId;
}
/**