Problem with SimpleWarpAPI

Discussion in 'Development' started by Minto, Jun 4, 2021.

  1. Minto

    Minto Creeper

    Messages:
    4
    GitHub:
    MintoD
    How to add, delete, list warps?
     
  2. ErikX

    ErikX Baby Zombie

    Messages:
    116
    GitHub:
    ErikPDev
    The SimpleAPI file is pretty helpful on figuring it out, you can also look at command files and see how it does it.
    Here's the api's.
    PHP:
    use falkirks\simplewarp\Destination;
    use 
    falkirks\simplewarp\utils\WeakPosition;

    $this->api $this->getServer()->getPluginManager()->getPlugin("SimpleWarp")->getApi(); // Get's the api
    unset($this->api->getWarpManager()["Warp"]); // Deletes a wrap

    $dest = new Destination(new WeakPosition(0,0,0"WorldName")); // Creates a Destination
    $this->api->makeWarp("WarpName"$dest); // Creates wrap


    $this->getServer()->getPluginManager()->getPlugin("SimpleWarp")->getWarpManager()->loadWarps() // Loads wraps
     
    Primus likes this.
  3. Minto

    Minto Creeper

    Messages:
    4
    GitHub:
    MintoD
    Thanks you so much
     

Share This Page

  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.