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

Updating plugins for API 2.0.0

Comments in 'Plugin Development' started by LDX, Sep 20, 2015.

  1. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Hello everyone, sorry if I look like a frantic noob today, but I am in a big hurry and couldn't see any similar threads right off. Okay, I need to update two plugins that are 100% essential to my private server as fast as I can, hopefully by sometime tomorrow. I would have just stayed on PM 1.5 until I was ready, but all of my friends' clients automatically updated to 0.12.1 when it came out. How can I go about updating these plugins as quickly as possible? What changes has PocketMine introduced in 1.6? Thanks.
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    LDX likes this.
  3. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    I believe API 2.0.0 uses PHP 7, so if you don't know it go learn it(obviously you know it). http://php.net/manual/en/migration70.php What are the plugins you want to update?
    Last edited: Sep 20, 2015
  4. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Both are private, they were custom made with my friends' private information built right in, so I can't share.

    I think I already tried that and it had too many bugs, but I'll check. Thanks!
    HotFireyDeath likes this.
  5. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    No, just tell me what it does(i.e block protection, commands, etc.).
  6. lucasvitegui
    Offline

    lucasvitegui Active Member

    Joined:
    Apr 18, 2015
    Posts:
    191
    Minecraft User:
    lucasviteguiBR
    I'm running in PM 1.6 dev 30. Most of Plugins issues i could solve downloading fixed plugins from other topics.
    The Biggest issue i am having now is: Players join and after two minutes they are disconnected and cant join again while server don't restart. So if you still not ran your server in 1.6 . I reccomend you tu continue using 1.5 .
  7. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    One monitors PlayerCommandPreprocessEvent, and the other monitors PlayerJoinEvent.
  8. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Oh. Well there's nothing I can do to help, but if there was code I could fix it. :( But are you sure the plugins need updating? What problems do you get when you use those two plugins on 1.6?
  9. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    It just rejects them because they aren't API 2.0.0 or greater. I guess maybe I should try just changing the API version...
  10. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Use the bleeding build #30. It is API 1.13.0, so no problems at all.
  11. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Go ahead, change it. Up the api version in plugin.yml to 2.0.0.
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There aren't observable API changes yet.
    For backwards incompatible changes in PHP 7, I believe they wouldn't affect most of the community.
    LDX and HotFireyDeath like this.
  13. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    If you use a recent non-PHP7 1.6dev build with some of the fixed plugins as posted in these forums you should be able to get it all working fine with pretty minor disconnect problems. I'm running 3 servers at 40/40 with no crashes (auto restarts every 3 hours) and at least 30 plugins working just fine.
  14. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    That's the thing, these aren't plugins from the forums. In fact, they're so private that I am the only person in the world who has a copy.
    jojoe77777 likes this.
  15. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Until I hacked into your computer and took it. ;) *wink wink*
  16. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Did you try them yet with 1.6dev? Most plugins (including yours!) work just fine, there's just the occasional thing you might need to change like isPlaceable() becomes canBePlaced() or adding null checks and other minor stuff like that. I'm fixing BanItem right now ;-) It crashes once a day when trying to get the item in a players hand on a damage event, but probably that's because shoghicp had to use a dirty fix for what is actually an MCPE creative inventory bug.

  17. killer549
    Offline

    killer549 New Member

    Joined:
    Jun 18, 2015
    Posts:
    15
    Minecraft User:
    killer549
    i think that the problem is the NBT cause api 2.0.0 + ex: "String" in api 2.0.0 is "StringTag" so u should add "...Tag"
  18. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Last post on this thread was made by @Jazzwhistle on Sep 22, 2015.
  19. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Sometimes this outdated version of XenForo show old posts instead the new ones, so it's not his fault really.
  20. AndroidHackPro
    Offline

    AndroidHackPro New Member

    Joined:
    Jul 7, 2016
    Posts:
    9
    Minecraft User:
    AndroidHackPro
    This is a problem with LiveSigns plugin

    Genisys Crash Dump Mon Jul 11 17:00:55 PDT 2016

    Error: Cannot use pocketmine\nbt\tag\String as String because 'String' is a special class name
    File: /LiveSigns_v1.2.1.phar/src/aliuly/livesigns/TileUpdTask
    Line: 10
    Type: E_COMPILE_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN : LiveSigns v1.2.1

    Code:
    [1] <?php
    [2] namespace aliuly\livesigns;
    [3]
    [4] use pocketmine\scheduler\PluginTask;
    [5] use pocketmine\plugin\Plugin;
    [6] use pocketmine\tile\Sign;
    [7] use pocketmine\network\protocol\TileEntityDataPacket;
    [8] use pocketmine\nbt\NBT;
    [9] use pocketmine\nbt\tag\Compound;
    [10] use pocketmine\nbt\tag\String;
    [11]
    [12] class TileUpdTask extends PluginTask{
    [13] /**
    [14] * @param Plugin $owner
    [15] */
    [16] public function __construct(Plugin $owner){
    [17] parent::__construct($owner);
    [18] }
    [19] public function onRun($currentTicks){
    [20] $this->getOwner()->updateVars();

    Backtrace:
    #0 (): pocketmine\Server->crashDump(boolean)

    Genisys version: 1.2dev #621 [Protocol 81; API 2.0.0]
    uname -a: Linux mcpe1.netherbox.com 2.6.32-042stab108.8 #1 SMP Wed Jul 22 17:23:23 MSK 2015 x86_64
    PHP version: 7.0.3
    Zend version: 3.0.0
    OS : Linux, linux

    Server uptime: 2 seconds
    Number of loaded worlds: 2
    Players online: 59/100

Share This Page

Advertisement