Development Assistance Server is getting in reload loop!?!?

Discussion in 'Plugin Help/Development/Requests' started by Awesomebanana2002, May 12, 2015.

?

Please help!

  1. Something that fixes it

    0 vote(s)
    0.0%
  2. .

    0 vote(s)
    0.0%
Multiple votes are allowed.
Thread Status:
Not open for further replies.
  1. Hi,

    I am developing a skywars minigame. When the game restarts, the server reloads, and that couses the island world to unload, delete, and then the original world is replacing it. But when I reload it once, it errors 'File is in use'.. So I have to reload it twice. I tried this:
    Code:
        public static void reloadTwice() {
            File reloader = new File(plugin.getDataFolder(), "reload");
            try {
                reloader.createNewFile();
                GameState.setState(GameState.RESTARTING);
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                Bukkit.getScheduler().scheduleSyncDelayedTask(Skywars.plugin,
                        new Runnable() {
                            public void run() {
                                Bukkit.reload();
                            }
                        }, 10);
            }
        }
    And here are the general classes that uses it:

    When the server restarts:
    Code:
    package com.WouterBukkit.threads;
    
    import org.bukkit.scheduler.BukkitRunnable;
    
    import com.WouterBukkit.Skywars;
    
    public class ReloadCountdown extends BukkitRunnable {
    
        @Override
        public void run() {
            Skywars.reloadTwice();
        }
    
    }
    
    This makes the server to reload twice always:
    Code:
        @EventHandler
        public void serverCommandEvent(ServerCommandEvent e) {
            if(e.getCommand().equalsIgnoreCase("reload")) {
                e.setCommand("");
                Skywars.reloadTwice();
            }
        }
    Please help ..

    Sorry for my bad English ;)
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Cuz its the only plugin I have installed and i wont install others.. It just takes 1 second.
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Awesomebanana2002 But why do you need a reload? Why not write your plugin so it won't depend on it?
     
  5. It it the only fix I can think about.. I can give you the errors.

    This error is giving by MultiVerse-Core:
    Code:
    [14:51:57 ERROR]: Could not pass event PlayerTeleportEvent to Multiverse-Core v2
    .4-b527
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:305) ~[Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:502) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:487) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer.teleport(CraftPlaye
    r.java:448) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity.teleport(CraftEntit
    y.java:223) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at com.WouterBukkit.Map$1.run(Map.java:55) [Skywars.jar:?]
            at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java
    :71) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHea
    rtbeat(CraftScheduler.java:350) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:7
    09) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
    16) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
    34) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
    :537) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
    Caused by: java.lang.NullPointerException
            at com.onarandombox.MultiverseCore.listeners.MVPlayerListener.playerTele
    port(MVPlayerListener.java:193) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0
    _45]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0
    _45]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .8.0_45]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:301) ~[Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            ... 13 more
    But and I get another error (If I uninstall MV-Core then this error keeps comming):
    Code:
    [14:51:57 WARN]: [Skywars] Task #9 for Skywars v1 generated an exception
    java.lang.NullPointerException
            at org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer.teleport(CraftPlaye
    r.java:464) ~[Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity.teleport(CraftEntit
    y.java:223) ~[Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at com.WouterBukkit.Map$1.run(Map.java:55) ~[?:?]
            at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java
    :71) ~[Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHea
    rtbeat(CraftScheduler.java:350) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:7
    09) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:3
    16) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:6
    34) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java
    :537) [Spigot18.jar:git-Spigot-4faf77a-17a3db7]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
     
  6. Offline

    timtower Administrator Administrator Moderator

    Moved to Bukkit alternatives.
    @Awesomebanana2002 That is an error on your side I am afraid.
     
  7. Thats couse I can't find any Bukkit 1.8 versions :'(
     
  8. Offline

    timtower Administrator Administrator Moderator

    @Awesomebanana2002 It is a nullpointer, not related to version.
    And outdated doesn't mean broken till proven otherwise.
     
  9. I need to use UUID's
     
  10. Offline

    timtower Administrator Administrator Moderator

  11. Tried it. Now Effect.<something> doesn't work anymore..
     
  12. Offline

    Scorpionvssub

    Did you update multiverse to its latest? sometimes that tends to solve a hell of a lot.
     
  13. Fail! I'd put a delay for loading the spawns and it works -_- .. But still thanks :D
     
Thread Status:
Not open for further replies.

Share This Page