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

Error

Discussion in 'Development' started by Defications2po, Jul 21, 2017.

  1. Defications2po

    Defications2po Witch

    Messages:
    51
    I have been using pmmp for a long time and i heard of some changes but i cant wrap my head around it. Heres the crashdump.

    PHP:
    PMMP Crash Dump Fri Jul 21 17:47:51 ACT 2017

    Error
    Declaration of Masks\Commands\MaskCMD::execute(pocketmine\command\CommandSender $senderstring $commandLabel, array $argsmust be compatible with pocketmine\command\Command::execute(pocketmine\command\CommandSender $sender$commandLabel, array $args)
    File: /Masks/src/Masks/Commands/MaskCMD
    Line
    33
    Type
    E_COMPILE_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN
    Masks v1

    Code
    :
    [
    24] use pocketmine\nbt\tag\ListTag;
    [
    25] use pocketmine\nbt\tag\StringTag;
    [
    26] use pocketmine\nbt\tag\IntArrayTag;
    [
    27] use pocketmine\tile\Chest;
    [
    28] use pocketmine\tile\Tile;
    [
    29] use pocketmine\event\entity\EntityInventoryChangeEvent;
    [
    30] use pocketmine\entity\Entity;
    [
    31] use pocketmine\event\block\BlockPlaceEvent;
    [
    32
    [
    33] class MaskCMD extends MaskCommand{
    [
    34]     public function __construct(Masks $plugin){
    [
    35]         parent::__construct("mask"$plugin);
    [
    36]         $this->setUsage("mask");
    [
    37]         $this->setDescription("gives mask selection");
    [
    38]     }
    [
    39]     public function execute(CommandSender $senderstring $commandLabel, array $args){
    [
    40]         if (!$sender instanceof Player){
    [
    41]             $sender->sendMessage(C::GOLD."You must be a player");
    [
    42]         }
    [
    43]         $this->masks($sender);

    Backtrace:

    pmmp version1.3 #0 [Protocol 113; API 3.0.0-ALPHA6]
    Git commit0000000000000000000000000000000000000000
    uname 
    -aWindows NT DESKTOP-KTJJ760 10.0 build 14393 (Windows 10AMD64
    PHP Version
    7.0.3
    Zend version
    3.0.0
    OS 
    WINNTwin

    Loaded plugins
    :
    DevTools 1.12.1 by PocketMine Team for API(s2.0.03.0.0-ALPHA13.0.0-ALPHA23.0.0-ALPHA33.0.0-ALPHA43.0.0-ALPHA53.0.0-ALPHA6
    EconomyAPI 2.0.9 by onebone 
    for API(s3.0.03.0.0-ALPHA62.0.02.1.0
    Masks 1 by LeoDevs 
    for API(s3.0.0-ALPHA23.0.0-ALPHA33.0.0-ALPHA43.0.0-ALPHA53.0.0-ALPHA63.0.0-ALPHA7
    Core 0.0.0.1 by  
    for API(s3.0.03.0.0-ALPHA13.0.0-ALPHA23.0.0-ALPHA33.0.0-ALPHA43.0.0-ALPHA53.0.0-ALPHA63.0.0-ALPHA73.0.0-ALPHA8
    [PHP/]
     
  2. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    You have to import pocketmine\command\CommandSender.
     
    Teamblocket likes this.
  3. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    I accidentally deleted my post. ;(

    Have you also updated to PocketMine-MP API 3.0.0-ALPHA7? The crashdump you provided says you're using API 3.0.0-ALPHA6.

    If you're planning to code your plugin to fit with the recent changes you also have to use the newest PocketMine version.
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    He probably has it imported.


    You need to update PocketMine. Your version of pocketmine is lower than the strict types commit by dktapps
     
    SalmonDE likes this.
  5. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    I think what you've done is typehinted $commandLabel as a string whereas it isn't type hinted in alpha6 as it says right here:
    Code:
    Declaration of Masks\Commands\MaskCMD::execute(pocketmine\command\CommandSender $sender, string $commandLabel, array $args) must be compatible with pocketmine\command\Command::execute(pocketmine\command\CommandSender $sender, $commandLabel, array $args)
     
    Last edited: Jul 31, 2017
  6. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    *facepalm* ah yes, I forget that crash dumps don't show every line of code from that class, but @jasonwynn10 is right, change the string $commandLabel to $commandLabel or update your Pocketmine-MP version, like @Muqsit said.
     
  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.