Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

class does not exist

Comments in 'Plugin Development' started by xiaoq, Feb 7, 2016.

  1. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    I got this error, and it said class pocketmine\player does not exist, why?

    ReflectionException: "Class pocketmine\player does not exist" (EXCEPTION) in "/src/pocketmine/plugin/PluginManager" at line 732
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Because it is Player not player. This happens on filesystems that are case-sensitive .
    applqpak and xiaoq like this.
  3. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    Fix, thx, and one more question, Fatal error: Call to a member function getChunk() on null in...
    What cause this error?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You called getChunk on null. Isn't that already told?
    HotFireyDeath likes this.
  5. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    No, the problem is I never called function getChunk!
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There should be a stack trace. Show it.
    Are you trying to do something on a level that has been unloaded?
    xiaoq likes this.
  7. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    The only thing i did is unload a level, copy a level, and load a level, but after I load the level & set the level time, it crash.
    PHP:
    $this->plugin->getServer()->loadLevel($this->data["Map"]);
    $level $this->plugin->getServer()->getLevelByName($this->data["Map"]);
    if(
    $level instanceof Level){
    $level->setTime(100);
    $level->stopTime();
    }
    $this->plugin->getServer()->getLogger()->info("FINISH RESET MAP");
    It crash after I got 'FINISH RESET MAP'
  8. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    And I am sure, $level instanceof Level, btw how to stack trace?

    ps: it only crash in multicraft, it work fine in local server, same pocketmine version
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then that either means it isn't caused by this code, or ther some scheduled things went wrong in PocketMine core. Or that your multi craft using invalid PHP binaries.
    xiaoq likes this.
  10. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Delays. I got these errors too before.
    xiaoq likes this.
  11. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    Delays? what that mean? i try to check all my level by using code:
    PHP:
    foreach($this->plugin->getServer()->getLevels() as $level){
    if(
    $level instanceof Level){
    $this->plugin->getServer()->getLogger()->info($level->getFolderName()." is instanceof Level"); 
     }
    }
    And yes, all my level is instanceof Level
  12. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    And I check, it only happen when the plugin is in .phar

Share This Page

Advertisement