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

Error with EssentialsPE after editing messages

Discussion in 'Requests' started by Rysieku, Aug 18, 2017.

  1. Rysieku

    Rysieku Spider Jockey

    Messages:
    34
    GitHub:
    rysieku
    Hello.
    I got problem with EssentialsPE
    I have edited plugin messages and deleted kits function.
    But now i got problem that crash my server

    Please help me fix it.
    Link for git repository in post below
     
    Last edited: Aug 18, 2017
  2. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Nobody likes looking at code in random (potentially dangerous) zip files - and most importantly we can't see what you have done. If you want answers please make it as easy as possible for people to help - you should fork the original repository on github, make your changes, and then post the link to your repo.
     
    jasonwynn10 and Rysieku like this.
  3. Rysieku

    Rysieku Spider Jockey

    Messages:
    34
    GitHub:
    rysieku
    https://github.com/Rysieku/EssentialsPE

    Add files via upload = My updated files

    Error:
    Declaration of EssentialsPE\Commands\Warp\Warp::execute(pocketmine\command\CommandSender $sender, string $alias, array $args): bool must be compatible with pocketmine\command\Command::execute(pocketmine\command\CommandSender $sender, $commandLabel, array $args)
     
  4. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    That's better - but not ideal either: look how hard it is to see what you changed in plugin.yml, for example. You could have merged only the changes you made into the existing repo instead of just replacing everything, but it's a start.

    As for your error, just read it! Looking quickly at the changes it seems you've messed up by removing return types all over the place. Which version of PocketMine are you trying to code for?

    The error says, in short:
    Code:
    Declaration of Plugin::execute(CommandSender $sender, string $alias, array $args): bool must be compatible with PocketMine::execute CommandSender $sender, $commandLabel, array $args)
    This means that your plugins function uses type hints for the execute functions parameters (CommandSender, string and array are the types; $sender, $alias and $args are the parameters), and specifies a boolean return type.

    However, the version of PocketMine that you are using only specifies return types for $sender and $args, and doesn't specify a return type at all. So your function is compatible with API version 3.0.0-ALPHA7, but your version of PocketMine is not at that API version, presumably ALPHA6 or a Spoon?

    That said, elsewhere in your plugin you have removed ALPHA7 updates that were made to the original repo... so you need to decide which version of PocketMine to target, and improve your understanding of strict types in PHP if you want to fix this.
     
    Rysieku likes this.
  5. Rysieku

    Rysieku Spider Jockey

    Messages:
    34
    GitHub:
    rysieku
    I use PocketMine 3.0.0-alpha6
     
  6. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    In that case you'll have to remove the type declaration for $alias and the return type for every execute(). And keep in mind that you'll have to add them all back when you update to alpha7.
     
    Rysieku likes this.
  7. Rysieku

    Rysieku Spider Jockey

    Messages:
    34
    GitHub:
    rysieku
    Okey, thank you! :)
     
  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.