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

How to reduce lagg on TNT

Comments in 'Plugin Development' started by MyNameIsTriXz, May 4, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    When it explodes, the server sleeps for a second, the problem may be Event::getBlockList(), which returns about 100 blocks, would it reduce lagg when I would use foreach with coordinates, to remove the blocks at the explosion? What should I use to reduce lagg too? What do you recommend?
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    blocks count (lag) depends on explosion size, and you are right, but i think you can not reduce lag a lot.
    and what explosion do you need? just particle or explosion that damages entities, or full explosion?
    MyNameIsTriXz likes this.
  3. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    The explosiong should only remove blocks.
  4. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Php has slow arrays so if chunk has around 15 000 blocks and getblock() method search in it 100 Times. You can make your own method for Getting blocks in explosion radius. IT should be faster but idk maybe block cache has private access
    Skullex and MyNameIsTriXz like this.
  5. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Cancel EntityExplodeEvent and execute your own code to clear the blocks.
  6. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    But he want to reduce lag. This only lags server for more time
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Well if he doesn't do it PocketMine will
  8. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    No pocketmine do it before this event :D
  9. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Then that's odd, why it's Cancellable then? :eek:
  10. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    But server still checks all blocks.. He should make his own method

Share This Page

Advertisement