1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

[14:12:47] [Server thread/CRITICAL]: ErrorException: "Creating default object from empty value" (EXC

Discussion in 'Plugin Help' started by Mochi, Jun 6, 2020.

  1. Mochi

    Mochi Baby Zombie

    Messages:
    113
    PHP:
    public function createChest(Player $player, array $itemsint $id)
        {
            
    $this->clearData($player);
            
    $this->inv[$player->getName()] = $player->getInventory()->getContents();
            
    $v3 $this->getVector($player);
            
    $this->chest[$player->getName()] = [$id$v3];
            
    $this->updateBlock($player54$v3);
            
    $pk = new ContainerOpenPacket;
            
    $pk->windowid 10;
            
    $pk->type 0;
            
    $block->= ( int ) $v3->x;
            
    $block->= ( int ) $v3->y;
            
    $block->= ( int ) $v3->z;
            
    $player->dataPacket($pk);
            
    $pk1 = new ContainerSetContentPacket;
            
    $pk1->windowid 10;
            
    $pk1->slots $items;
            
    $pk1->targetEid $id;
            
    $player->dataPacket($pk1);
        }
        public function 
    updateBlock(Player $playerint $idVector3 $v3){
            
    $block->= ( int ) $v3->x;
            
    $block->= ( int ) $v3->y;
            
    $block->= ( int ) $v3->z;
            
    $pk = new UpdateBlockPacket();
            
    $pk->blockId $id;
            
    $pk->blockData = (int) 0xb << | (0xf);
            
    $player->dataPacket($pk);
        }
        public function 
    getVector(Player $player): Vector3
        
    {
            return new 
    Vector3($player->x$player->3$player->z);
        }
        public function 
    clearData(Player $player)
        {
            if (isset(
    $this->chest[$player->getName()]))
                unset(
    $this->chest[$player->getName()]);
            if (isset(
    $this->inv[$player->getName()]))
                unset(
    $this->inv[$player->getName()]);
        }
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
  3. Mochi

    Mochi Baby Zombie

    Messages:
    113
    But i don't understand to create gui in invmenu muqsit :(
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.