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

0.15 Client Updates

Comments in 'Plugin Development' started by Jazzwhistle, Jun 17, 2016.

  1. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Hi, I'm not sure if the problem I have is client side, PocketMine or a plugin problem: for any plugin that protects blocks, for example, players without permission can see themselves break/place blocks in forbidden areas even though the blocks are not actually broken/placed on the server, or visible to anyone else.

    For other plugins doing other block placement it seems the same is true - my LockIt plugin opens an iron door when tapped with a key, I hear the sound but the door doesn't open - unless I logout/login and then I see it is indeed open, but didn't display as such to me.

    Should we now be updating chunks manually for all clients, or using priorities differently, or something else... or is this a PM or client bug?

    Thanks
    Last edited: Jun 17, 2016
    applqpak likes this.
  2. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    When calling setBlock(), make sure that it's returning 'true'; also try adding an additional "true" parameter to setBlock() so the block is sent immediately to the player.

    If it still happens, have you looked at what packets are being sent to and from the server? (see PacketLogger)

    You shouldn't be sending chunks unless you're updating a ton of blocks.
    applqpak and Jazzwhistle like this.
  3. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    I'll try that for setBlock(), but for opening an Iron Door I didn't have to setBlock() on PM pre PocketMine-MP_1.6dev-27_ef8227a0_API-2.0.0.phar, all doors opened normally when tapped, and I could cancel the PlayerInteractEvent to keep them closed. I was only calling setBlock() to close the door, but I'm now doing it with setDamage() instead.

    To sum up the problems I'm having since the 0.15 update:

    Iron Doors now only seem to be openable using redstone. Tap to open doesn't seem work in cmode or smode. Maybe deliberate?

    Using setDamage() to open/close a door sounds like it works, and does actually work... but I can't see the change until I relog

    For ordinary doors, I can no longer cancel a PlayerInteractEvent, the door opens regardless.

    For plugins such as WorldProtect, EconomyLand, Plots etc... any prohibited block break/place still display for the player, but are only client side.

    I'll try your suggestions now, thanks, and test using setBlock() to open the door too.
    Last edited: Jun 17, 2016
    applqpak likes this.
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Try
    PHP:
    $direct true;
    $update true;
    $level->setBlock(Vector3 $posBlock $block$direct$update);
    applqpak and Jazzwhistle like this.
  5. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    The update parameter is already set to true by default, you don't have to set it again. Also, the only effect it has is server-sided; the issue here is client-bound packet-related.
    Jazzwhistle and applqpak like this.
  6. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Well I tried it anyway, but to no effect. It's all working exactly as it should, setBlock() returns true, a trace of the door's metadata shows it is indeed switching from closed to open state, and I even get the nice door open/closes sounds that I didn't set myself... but I don't see the door open.

    The code is here if anyone has time to look https://github.com/Awzaw/LockIt, and it works perfectly pre 0.15.

    On 0.15 it all still appears to work fine, but feels like the doors state is simply not updating correctly client side, hence the title of the thread. Added to my observations about protection plugins, maybe it's all a single issue?
    Last edited: Jun 17, 2016
    applqpak likes this.
  7. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    Are you using this? ( https://github.com/PocketMine/PocketMine-MP/commit/ef8227a074c7acaa1c244ee4c709603c21ee1584 ) If so, it's a PocketMine issue; blocks don't update.
    applqpak and Jazzwhistle like this.
  8. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Thank you, that was driving me crazy, so for once I'm glad it's a PM problem xD

    Any ideas about not being able to cancel normal door tap open by cancelling PlayerInteractEvent?
    applqpak likes this.
  9. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    https://github.com/PocketMine/PocketMine-MP/blob/master/src/pocketmine/level/Level.php#L1369
    Note that the $direct parameter is deprecated. It may be removed in future updates (ironically: if there is to be any).
  10. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Client will always see that block flicker if broken, in case you replace it. You can try to knockback player or calculate if he went through that door.
  11. Fanfan54
    Offline

    Fanfan54 New Member

    Joined:
    Dec 20, 2015
    Posts:
    2
    Minecraft User:
    Fanfan54MC
    Hi, can you send me/upload the phar (or zip file of "bin") you're using to connect with 0.15, so I can check what's happening?

    Thanks :)
  12. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    "bin" holds PHP binaries. If you want to get same build of PM he is using, just pull from Github.
  13. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    Or git clone --recursive

Share This Page

Advertisement