Solved Explanation Needed

Discussion in 'Plugin Development' started by Tim_M, Mar 8, 2022.

Thread Status:
Not open for further replies.
  1. Offline

    Tim_M

    Hello, for a while now I have been trying to make a SkyWars plugin. My main issue is that for every game it creates a new world, teleports all the players in the cages and then deletes the world after the match. But apparently that's an awful way of doing it. Most servers apparently have subservers for every match (or something like that?). I have tried googling but found nothing useful on how to create something like that. If there is an online source, please link it, or try to explain what libaries to use etc. (I'm on 1.8.9)
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Tim_M Those use software that this forum does not support.
     
  3. Offline

    Tim_M

    So like bugeecord? Well what's the Bukkit solution then, the world method is kind of inefficient.
     
  4. Offline

    CraftCreeper6

    @Tim_M
    There's not really a best solution to this since they will all take at least a little bit of time. It could help to have just 1 world with many different arenas, have a blocklist for each arena that keeps track of anything that was destroyed / placed, once the game is over, loop the blocklist and reset it to normal. Have multiple versions of each arena so you can have multiple games at once, each with a separate blocklist of course.

    Don't try to instantaneously reset the arena (e.g. a loop with no delay) otherwise the server will lag for other players. Have a single BlockResetter that takes in a list of blocks to reset, queue up any blocks that need resetting and let the BlockResetter handle it with a short delay between each iteration. The BlockResetter would be a global manager, not a new instance for each arena. De-activate each arena until it is reset.

    Should be a pretty easy solution if you get the structure right.
     
  5. Offline

    Tim_M

    Yes I guess having multiple games per world would work, however how do you have multiple world borders per world (its part of the game that a world border is closing in), and so that those only affect certrain players? Also instead of the block thing it'd be much easier to load a schematic on the async thread (I think).
     
  6. Offline

    CraftCreeper6

    @Tim_M
    Custom world borders could work. Measure the distanceSquared from the player to center of your world and limit where they can go, just cancel the PlayerMoveEvent if they try to leave the arena.

    And yeah, you could load a schematic if you wish. Whatever works for you.
     
  7. Offline

    Tim_M

    Seems good, thanks!
     
Thread Status:
Not open for further replies.

Share This Page