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

File in SRC that handle time (in game) ?

Comments in 'Plugin Development' started by Guillaume351, Jul 15, 2014.

  1. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    Hello, I can't find the file that handle time in src. In found in \src\pocketmine\network\protocol a file called SetTimePacket but I don't think it's this one. Also, is it possible with the new API to fully handle the time changing ? Thanks.

    Edit : And how to schedule a repeting function without creating an other php file ? For example I create

    "public function example(){}"

    if , when the server is loading,I repeat it with

    "$this->getServer()->getScheduler()->scheduleRepeatingTask(example(), 120);" it say that I'm calling an undefined function. Sorry I'm just a beginner ^^
    Last edited: Jul 15, 2014
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    First, in PHP, you must call $this->example() to call a function in $this, instead of, like java, calling it directly.

    Second, you should put a Task object there. In a plugin, a PluginTask object is preferred. You can make a PluginTask referring to many examples.
    Guillaume351 likes this.
  3. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    So a plugin task is a function in an other file to resume ?. Thank you
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    No. A plugin task is something to be called. It is called in the server scheduler.
    Guillaume351 likes this.
  5. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    Thank you.

Share This Page

Advertisement