Hacks for banners and coral fans

This commit is contained in:
Dylan K. Taylor
2022-05-24 15:07:38 +01:00
parent a2ea0cea86
commit 81eafde074
6 changed files with 115 additions and 21 deletions

View File

@ -68,7 +68,7 @@ final class ItemSerializer{
if($item->hasAnyDamageValue()){
throw new \InvalidArgumentException("Cannot serialize a recipe wildcard");
}
$index = ($item->getId() << 16) | $item->getMeta();
$index = $item->getTypeId();
if(isset($this->serializers[$index])){
//TODO: REMOVE ME
throw new AssumptionFailedError("Registering the same item twice!");
@ -89,7 +89,7 @@ final class ItemSerializer{
if($item instanceof ItemBlock){
$data = self::standardBlock($item->getBlock());
}else{
$index = ($item->getId() << 16) | ($item instanceof Durable ? 0 : $item->getMeta());
$index = $item->getTypeId();
$locatedSerializer = $this->serializers[$index][get_class($item)] ?? null;
if($locatedSerializer === null){