Fill null UUIDs in CraftingDataPacket, remove all UUID things from CraftingRecipe

This allows deleting lots of code, and additionally provides a huge reduction in the compressed size of CraftingDataPacket. Since we don't care about these UUIDs (they are only used in CraftingEventPacket, which is broken and unused in PM) we fill them with zeros instead.
This commit is contained in:
Dylan K. Taylor
2018-03-28 20:03:04 +01:00
parent a1090623a2
commit ec332e3e60
5 changed files with 9 additions and 86 deletions

View File

@ -25,12 +25,8 @@ namespace pocketmine\inventory;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\utils\UUID;
class ShapedRecipe implements CraftingRecipe{
/** @var UUID|null */
private $id = null;
/** @var string[] */
private $shape = [];
/** @var Item[] char => Item map */
@ -116,21 +112,6 @@ class ShapedRecipe implements CraftingRecipe{
return $this->getResults();
}
/**
* @return UUID|null
*/
public function getId() : ?UUID{
return $this->id;
}
public function setId(UUID $id){
if($this->id !== null){
throw new \InvalidStateException("Id is already set");
}
$this->id = $id;
}
/**
* @param string $key
* @param Item $item