mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-18 17:34:11 +00:00
ConsumingItemAnimation: fixed itemID translation for 1.16.100
This commit is contained in:
parent
1c49cedc8c
commit
37b9694845
@ -25,6 +25,7 @@ namespace pocketmine\entity\animation;
|
|||||||
|
|
||||||
use pocketmine\entity\Human;
|
use pocketmine\entity\Human;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\network\mcpe\convert\ItemTranslator;
|
||||||
use pocketmine\network\mcpe\protocol\ActorEventPacket;
|
use pocketmine\network\mcpe\protocol\ActorEventPacket;
|
||||||
|
|
||||||
final class ConsumingItemAnimation implements Animation{
|
final class ConsumingItemAnimation implements Animation{
|
||||||
@ -41,9 +42,10 @@ final class ConsumingItemAnimation implements Animation{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function encode() : array{
|
public function encode() : array{
|
||||||
|
[$netId, $netData] = ItemTranslator::getInstance()->toNetworkId($this->item->getId(), $this->item->getMeta());
|
||||||
return [
|
return [
|
||||||
//TODO: need to check the data values
|
//TODO: need to check the data values
|
||||||
ActorEventPacket::create($this->human->getId(), ActorEventPacket::EATING_ITEM, ($this->item->getId() << 16) | $this->item->getMeta())
|
ActorEventPacket::create($this->human->getId(), ActorEventPacket::EATING_ITEM, ($netId << 16) | $netData)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user