Separate hotbar from player inventory

this allows this functionality to be used with any type of inventory, and also makes it a little nicer to use in many cases.
This commit is contained in:
Dylan K. Taylor
2024-11-24 17:58:58 +00:00
parent 3e9a96b43a
commit f98cebbd62
11 changed files with 185 additions and 141 deletions

View File

@ -145,7 +145,7 @@ class Armor extends Durable{
$thisCopy = clone $this;
$new = $thisCopy->pop();
$player->getArmorInventory()->setItem($this->getArmorSlot(), $new);
$player->getInventory()->setItemInHand($existing);
$player->getHotbar()->setHeldItem($existing);
$sound = $new->getMaterial()->getEquipSound();
if($sound !== null){
$player->broadcastSound($sound);