mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
ItemTranslator now operates directly using Item, rather than using item ID/meta + ItemFactory
in almost all cases where ItemTranslator is used, an Item already exists, so it doesn't make any sense to make ItemTranslator go and create another item instance just to pass to ItemSerializer.
This commit is contained in:
@@ -37,7 +37,7 @@ final class ConsumingItemAnimation implements Animation{
|
||||
){}
|
||||
|
||||
public function encode() : array{
|
||||
[$netId, $netData] = ItemTranslator::getInstance()->toNetworkId($this->item->getId(), $this->item->getMeta());
|
||||
[$netId, $netData] = ItemTranslator::getInstance()->toNetworkId($this->item);
|
||||
return [
|
||||
//TODO: need to check the data values
|
||||
ActorEventPacket::create($this->human->getId(), ActorEvent::EATING_ITEM, ($netId << 16) | $netData)
|
||||
|
Reference in New Issue
Block a user