mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user