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

AxisAlignedBB::setBounds() Issue

Discussion in 'Development' started by CupidonSauce173, Oct 20, 2018.

  1. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    PHP:
    [01:50:00] [Server thread/CRITICAL]: Unhandled exception executing command 'koth join' in kothArgument 2 passed to pocketmine\math\AxisAlignedBB::setBounds() must be of the type floatstring givencalled in phar:///root/TestServer/PocketMine-MP.phar/src/pocketmine/entity/Entity.php on line 664
    [01:50:00] [Server thread/CRITICAL]: TypeError"Argument 2 passed to pocketmine\math\AxisAlignedBB::setBounds() must be of the type float, string given, called in phar:///root/TestServer/PocketMine-MP.phar/src/pocketmine/entity/Entity.php on line 664" (EXCEPTIONin "vendor/pocketmine/math/src/AxisAlignedBB" at line 45
    ok, I have no idea what is that about, I don't use this setBounds() in the plugin....I have no idea why it's here.
    I don't even use pocketmine\math\AxisAlignedBB...Here is the code that I THINK that is making the issue..
    In the Area class file.
    PHP:
        public function sendRandomSpot(Player $player){
            
    $spawn array_rand($this->spawns);
            
    $player->teleport($this->spawns[$spawn]);
        }
    in Main file.
    PHP:
        public function setPoint(Player $player$type){
            
    $save $player->getX().":".$player->getY().":".$player->getZ().":".$player->getLevel()->getName();
            
    $all $this->c->getAll();
            if (
    $type === "spawn"){
                
    $all["spawns"][] = $save;
            }else{
                
    $all[$type] = $save;
            }
            
    $this->c->setAll($all);
            
    $this->c->save();
        }
    In the command class file.
    PHP:
                    if (strtolower($args[0]) === "join"){
                        if (
    $this->plugin->sendToKoth($sender)){
                            
    $sender->sendMessage($this->plugin->getData("joined"));
                        }else{
                            
    $sender->sendMessage($this->plugin->getData("not_running"));
                        }
                        return 
    true;
    This is the only code linked to sending the player to the koth...$spawn will take a random value from this list :
    Code:
    - -10963.832:123:-11010.6221:factionmap
    - -10947.6309:120:-11014.3496:factionmap
    - -10949.6016:121:-11004.2568:factionmap
    - -10957.583:117:-10999.2998:factionmap
    - -10962.6855:116:-10990.4443:factionmap
    - -10975.8174:115:-10974.6191:factionmap
    - -10982.0273:115:-10978.457:factionmap
    - -10986.1934:144:-11039.6055:factionmap
    - -10965.6035:137:-11040.3271:factionmap
    - -10950.2559:128:-11029.2998:factionmap
    - -10947.5654:120:-11013.8867:factionmap
    - -10949.4092:121:-11004.249:factionmap
    and will send the player there. Maybe the "factionmap" that make the issue ?

    in Entity, we find :
    PHP:
        protected function recalculateBoundingBox() : void{
            
    $halfWidth $this->width 2;

            
    $this->boundingBox->setBounds(
                
    $this->$halfWidth,
                
    $this->y,
                
    $this->$halfWidth,
                
    $this->$halfWidth,
                
    $this->$this->height,
                
    $this->$halfWidth
            
    );
        }
    but I don't know why it use setBounds..does "factionmap" interfere with all of that ?
     
    Last edited: Oct 20, 2018
  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.