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

Solved must be compatible with pocketmine\plugin\Plugin::__construct

Discussion in 'Development' started by XdmingXD, Jun 30, 2018.

  1. XdmingXD

    XdmingXD Baby Zombie

    Messages:
    158
    GitHub:
    xdmingxd
    Code:
    must be compatible with pocketmine\plugin\Plugin::__construct(pocketmine\plugin\PluginLoader $loader, pocketmine\Server $server, pocketmine\plugin\PluginDescription $description, string $dataFolder, string $file)
    
    I know the api changed but how do get those value like: $loader, $server ,description , $dataFolder , $file?
    PHP:
    //onEnable()
    $this->getServer()->getPluginManager()->registerEvents(new eventmanager($this), $this); //very old?
     
    Last edited: Jun 30, 2018
  2. XdmingXD

    XdmingXD Baby Zombie

    Messages:
    158
    GitHub:
    xdmingxd
    ok...I figure it out
    I extended PluginBase in the eventmanager class
    but I it used to be ok
    Why is it not allowing me to do that? @SOFe (hope you know why : D)
     
  3. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    why on earth would you make an event listener extend from PluginBase?
     
  4. XdmingXD

    XdmingXD Baby Zombie

    Messages:
    158
    GitHub:
    xdmingxd
    :facepalm: I... I forget... it was like a year ago... maybe some bizarre reason and forgot to delete it... good question...
     
    Last edited: Jul 2, 2018
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    no u
     
    jasonwynn10 and HimbeersaftLP like this.
  6. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    so how can you fix this problem ? I got the same too @@
     
  7. XdmingXD

    XdmingXD Baby Zombie

    Messages:
    158
    GitHub:
    xdmingxd
    PHP:
    class idk extends PluginBase implements Listener 
    to
    PHP:
    class idk implements Listener
     
    corytortoise likes this.
  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.