Reloading server automatically

Discussion in 'Plugin Development' started by TerroDoor, Dec 8, 2019.

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

    TerroDoor

    I’m clearing certain blocks inside a cuboid upon reloads every 30 min,

    My question is if a repeating task is suitable for this if it’s put into the onEnable?

    Thanks!!


    Sent from my iPhone using Tapatalk
     
  2. Offline

    timtower Administrator Administrator Moderator

    @TerroDoor Do make sure that you check if the world is loaded, but otherwise you should be fine.
     
  3. Offline

    TerroDoor

    Thanks for the tip @timtower, how do I make a check for a loaded world?

    Is that the nether or multiple over worlds(haven’t yet tried this).


    Sent from my iPhone using Tapatalk
     
  4. Offline

    timtower Administrator Administrator Moderator

    @TerroDoor Bukkit.getWorld(name)
    Will return null if the world isn't loaded yet.
    The check should be done regardless of world type.

    What I normally do is save data per world for this.
    In the onEnable I load the data for the currently loaded worlds and I load additional data when a new world gets loaded.
     
  5. Offline

    TerroDoor

    Thanks for this I’m looking into worlds now!

    can they be created/loaded/saved? If so what am I trying to load and save? So far upon reloads I’m only loading/saving my Config with all the player data that I need


    Sent from my iPhone using Tapatalk
     
  6. Offline

    timtower Administrator Administrator Moderator

    Don't start to load worlds, let the plugins that made them do that.

    The playerdata is what you need to load based on the world.
     
  7. Offline

    TerroDoor

    Okay I’m following, so upon creating a world it is also being loaded? I only have ever used the default world that gets created on start “world”.

    How would I create let’s say a “Hub” world to send the players to when I’m reloading my “PvP” world?


    Sent from my iPhone using Tapatalk
     
  8. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page