Solved Crashing When Testing Minigame Plugin

Discussion in 'Spigot Plugin Development' started by Hello1231, Feb 5, 2020.

  1. So I was testing my plugin when it crashed, and I know that this code is why:
    Code (Java):
    ListenerClass.count = 1; //ListenerClass.count is a public static byte
                while (ListenerClass.count == 1) {
                    if (BoatMain.players.size() >= 2) {//BoatMain.players is a public static ArrayList<UUID>
                    ListenerClass.count = 3;
                    BoatMain.setTimer(30);
                    BoatMain.startTimer();
                    }
                }
    At the time it crashed, BoatMain.players was empty, so the code that it was supposed to allow access to shouldn't have been reached, but here is the code for the timer if needed:
    Code (Text):
    public static void setTimer(int amount) {
            time = amount; //time is a static int
        }
     
        public static void startTimer() {
            BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
            taskID = scheduler.scheduleSyncRepeatingTask(BoatMain.getInstance(), new Runnable() {
                @Override
                public void run() {              
            if(time == 0) {
                List<UUID> players2 = BoatMain.getAll(); //BoatMain.getAll() just  does: return new ArrayList<UUID>(players);
                for (UUID item2 : players2) {
                     Player pltp = Bukkit.getPlayer(item2);
                     pltp.sendMessage(ChatColor.GREEN + "The Boat Race Is Starting!"); }
                ListenerClass.RunRace();
                stopTimer();
                return;
            }
            if (BoatMain.players.size() < 2)
            {
                List<UUID> players2 = BoatMain.getAll();
                for (UUID item2 : players2) {
                     Player pltp = Bukkit.getPlayer(item2);
                     pltp.sendMessage(ChatColor.RED + "The Boat Race Was Cancelled Because There Aren't Enough Players"); }
                stopTimer();
                return;
            }
            if(time % 5 == 0) {
                List<UUID> players2 = BoatMain.getAll();
                for (UUID item2 : players2) {
                     Player pltp = Bukkit.getPlayer(item2);
                     pltp.sendMessage(ChatColor.AQUA + "The Boat Race Will Start In " + time + " Seconds"); }
            }
            time = time - 1;
                }
            }, 0L, 20L);
        }
         public static void stopTimer() {
                Bukkit.getScheduler().cancelTask(taskID);
                ListenerClass.count = 1;
            }
    I hope I included everything, if I missed something, let me know. Thanks!
     
    #1 Hello1231, Feb 5, 2020
    Last edited: Feb 5, 2020
  2. The Stack-trace please
    And also what line the error occurred (please comment in code)
     
    • Useful Useful x 1
  3. The error occured at
    Code (Text):
    while (ListenerClass.count == 1) {
    me.flyfunman.BoatRace.ListenerClass.StartRace(ListenerClass.java:59)
    [17:06:25 ERROR]: me.flyfunman.BoatRace.ListenerClass.invClickEvent(ListenerClass.java:186)
    [17:06:25 ERROR]: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [17:06:25 ERROR]: sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [17:06:25 ERROR]: sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [17:06:25 ERROR]: java.lang.reflect.Method.invoke(Unknown Source)
    [17:06:25 ERROR]: org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:312)
    [17:06:25 ERROR]: org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:66)
    [17:06:25 ERROR]: org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507)
    [17:06:25 ERROR]: org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:2107)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PacketPlayInWindowClick.a(SourceFile:33)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PacketPlayInWindowClick.a(SourceFile:10)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID.loadGameProfile(ProfileHelperUID.java:72)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID.access$100(ProfileHelperUID.java:34)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID$3.run(ProfileHelperUID.java:227)
    [17:06:25 ERROR]: org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftTask.run(CraftTask.java:81)
    [17:06:25 ERROR]: org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
     
  4. The interresting part is where it says "caused by". This unfortunately does not tell a lot...
     
    • Useful Useful x 1
  5. Here is everything it said when it crashed:
    [17:06:25 ERROR]: The server has stopped responding! This is (probably) not a Spigot bug.
    [17:06:25 ERROR]: If you see a plugin in the Server thread dump below, then please report it to that author
    [17:06:25 ERROR]: *Especially* if it looks like HTTP or MySQL operations are occurring
    [17:06:25 ERROR]: If you see a world save or edit, then it means you did far more than your server can handle at once
    [17:06:25 ERROR]: If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes
    [17:06:25 ERROR]: If you are unsure or still think this is a Spigot bug, please report to https://www.spigotmc.org/
    [17:06:25 ERROR]: Be sure to include ALL relevant console errors and Minecraft crash reports
    [17:06:25 ERROR]: Spigot version: git-Spigot-e6eb36f-d3ed151 (MC: 1.13.2)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Server thread dump (Look for plugins here before reporting to Spigot!):
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Server thread
    [17:06:25 ERROR]: PID: 17 | Suspended: false | Native: false | State: RUNNABLE
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: me.flyfunman.BoatRace.ListenerClass.StartRace(ListenerClass.java:59)
    [17:06:25 ERROR]: me.flyfunman.BoatRace.ListenerClass.invClickEvent(ListenerClass.java:186)
    [17:06:25 ERROR]: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [17:06:25 ERROR]: sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [17:06:25 ERROR]: sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [17:06:25 ERROR]: java.lang.reflect.Method.invoke(Unknown Source)
    [17:06:25 ERROR]: org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:312)
    [17:06:25 ERROR]: org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:66)
    [17:06:25 ERROR]: org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507)
    [17:06:25 ERROR]: org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:2107)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PacketPlayInWindowClick.a(SourceFile:33)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PacketPlayInWindowClick.a(SourceFile:10)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID.loadGameProfile(ProfileHelperUID.java:72)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID.access$100(ProfileHelperUID.java:34)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID$3.run(ProfileHelperUID.java:227)
    [17:06:25 ERROR]: org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftTask.run(CraftTask.java:81)
    [17:06:25 ERROR]: org.bukkit.craftbukkit.v1_13_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Craft Scheduler Thread - 38
    [17:06:25 ERROR]: PID: 280 | Suspended: false | Native: true | State: RUNNABLE
    [17:06:25 ERROR]: Thread is waiting on monitor(s):
    [17:06:25 ERROR]: Locked on:sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    [17:06:25 ERROR]: Locked on:sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.net.SocketInputStream.socketRead0(Native Method)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Craft Scheduler Thread - 29
    [17:06:25 ERROR]: PID: 271 | Suspended: false | Native: true | State: RUNNABLE
    [17:06:25 ERROR]: Thread is waiting on monitor(s):
    [17:06:25 ERROR]: Locked on:sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    [17:06:25 ERROR]: Locked on:sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.net.SocketInputStream.socketRead0(Native Method)
    [17:06:25 ERROR]: java.net.SocketInputStream.socketRead(Unknown Source)
    [17:06:25 ERROR]: java.net.SocketInputStream.read(Unknown Source)
    [17:06:25 ERROR]: java.net.SocketInputStream.read(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.InputRecord.readFully(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.InputRecord.readV3Record(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.InputRecord.read(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: java.net.SocketInputStream.socketRead0(Native Method)
    [17:06:25 ERROR]: java.net.SocketInputStream.socketRead(Unknown Source)
    [17:06:25 ERROR]: java.net.SocketInputStream.read(Unknown Source)
    [17:06:25 ERROR]: java.net.SocketInputStream.read(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.InputRecord.readFully(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.InputRecord.readV3Record(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.InputRecord.read(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    [17:06:25 ERROR]: sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    [17:06:25 ERROR]: de.robingrether.idisguise.management.profile.ProfileHelperUID.loadGameProfile(ProfileHelperUID.java:72)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    [17:06:25 ERROR]: java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Timer-2
    [17:06:25 ERROR]: PID: 200 | Suspended: false | Native: false | State: TIMED_WAITING
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.lang.Object.wait(Native Method)
    [17:06:25 ERROR]: java.util.TimerThread.mainLoop(Unknown Source)
    [17:06:25 ERROR]: java.util.TimerThread.run(Unknown Source)
    [17:06:25 ERROR]: Thread is waiting on monitor(s):
    [17:06:25 ERROR]: Locked on:java.io.BufferedOutputStream.write(Unknown Source)
    [17:06:25 ERROR]: Locked on:java.io.PrintStream.write(Unknown Source)
    [17:06:25 ERROR]: Locked on:java.io.PrintStream.write(Unknown Source)
    [17:06:25 ERROR]: Locked on:java.io.PrintStream.write(Unknown Source)
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.io.FileOutputStream.writeBytes(Native Method)
    [17:06:25 ERROR]: java.io.FileOutputStream.write(Unknown Source)
    [17:06:25 ERROR]: java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    [17:06:25 ERROR]: java.io.BufferedOutputStream.write(Unknown Source)
    [17:06:25 ERROR]: java.io.PrintStream.write(Unknown Source)
    [17:06:25 ERROR]: org.fusesource.jansi.AnsiOutputStream.write(AnsiOutputStream.java:82)
    [17:06:25 ERROR]: java.io.FilterOutputStream.write(Unknown Source)
    [17:06:25 ERROR]: java.io.PrintStream.write(Unknown Source)
    [17:06:25 ERROR]: java.io.PrintStream.write(Unknown Source)
    [17:06:25 ERROR]: java.io.FilterOutputStream.write(Unknown Source)
    [17:06:25 ERROR]: org.bukkit.craftbukkit.v1_13_R2.util.TerminalConsoleWriterThread.run(TerminalConsoleWriterThread.java:36)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: DestroyJavaVM
    [17:06:25 ERROR]: PID: 19 | Suspended: false | Native: false | State: RUNNABLE
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Server thread
    [17:06:25 ERROR]: PID: 17 | Suspended: false | Native: false | State: RUNNABLE
    [17:06:25 ERROR]: Thread is waiting on monitor(s):
    [17:06:25 ERROR]: Locked on:eek:rg.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492)
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: me.flyfunman.BoatRace.ListenerClass.StartRace(ListenerClass.java:59)
    [17:06:25 ERROR]: me.flyfunman.BoatRace.ListenerClass.invClickEvent(ListenerClass.java:186)
    [17:06:25 ERROR]: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [17:06:25 ERROR]: sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [17:06:25 ERROR]: sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [17:06:25 ERROR]: java.lang.reflect.Method.invoke(Unknown Source)
    [17:06:25 ERROR]: org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:312)
    [17:06:25 ERROR]: org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:66)
    [17:06:25 ERROR]: org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507)
    [17:06:25 ERROR]: org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:2107)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PacketPlayInWindowClick.a(SourceFile:33)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PacketPlayInWindowClick.a(SourceFile:10)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:9)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.PlayerConnectionUtils$$Lambda$2816/3243876.run(Unknown Source)
    [17:06:25 ERROR]: java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    [17:06:25 ERROR]: java.util.concurrent.FutureTask.run(Unknown Source)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.SystemUtils.a(SourceFile:199)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:896)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:831)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:729)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Server Infinisleeper
    [17:06:25 ERROR]: PID: 18 | Suspended: false | Native: false | State: TIMED_WAITING
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.lang.Thread.sleep(Native Method)
    [17:06:25 ERROR]: net.minecraft.server.v1_13_R2.DedicatedServer$1.run(DedicatedServer.java:66)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: NonBlockingInputStreamThread
    [17:06:25 ERROR]: PID: 15 | Suspended: false | Native: false | State: WAITING
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.lang.Object.wait(Native Method)
    [17:06:25 ERROR]: org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.run(NonBlockingInputStream.java:278)
    [17:06:25 ERROR]: java.lang.Thread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Snooper Timer
    [17:06:25 ERROR]: PID: 13 | Suspended: false | Native: false | State: WAITING
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.lang.Object.wait(Native Method)
    [17:06:25 ERROR]: java.lang.Object.wait(Unknown Source)
    [17:06:25 ERROR]: java.util.TimerThread.mainLoop(Unknown Source)
    [17:06:25 ERROR]: java.util.TimerThread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Attach Listener
    [17:06:25 ERROR]: PID: 5 | Suspended: false | Native: false | State: RUNNABLE
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Signal Dispatcher
    [17:06:25 ERROR]: PID: 4 | Suspended: false | Native: false | State: RUNNABLE
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Finalizer
    [17:06:25 ERROR]: PID: 3 | Suspended: false | Native: false | State: WAITING
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.lang.Object.wait(Native Method)
    [17:06:25 ERROR]: java.lang.ref.ReferenceQueue.remove(Unknown Source)
    [17:06:25 ERROR]: java.lang.ref.ReferenceQueue.remove(Unknown Source)
    [17:06:25 ERROR]: java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 ERROR]: Current Thread: Reference Handler
    [17:06:25 ERROR]: PID: 2 | Suspended: false | Native: false | State: WAITING
    [17:06:25 ERROR]: Stack:
    [17:06:25 ERROR]: java.lang.Object.wait(Native Method)
    [17:06:25 ERROR]: java.lang.Object.wait(Unknown Source)
    [17:06:25 ERROR]: java.lang.ref.Reference.tryHandlePending(Unknown Source)
    [17:06:25 ERROR]: java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    [17:06:25 ERROR]: ------------------------------
    [17:06:25 INFO]: Startup script './start.sh' does not exist! Stopping server.
    [17:06:25 INFO]: Stopping server
     
  6. Ah, this is more revealing.
    In your code it says:
    Code (Java):
    while (ListenerClass.count == 1) {
        if (BoatMain.players.size() >= 2) {//BoatMain.players is a public static ArrayList<UUID>
        ListenerClass.count = 3;
        BoatMain.setTimer(30);
        BoatMain.startTimer();
        }
    }
    When/where are you resetting ListenerClass.count?
    As far as I can see, that happens only if the Player's size is greater than two. Is that always the case?
    What is happening here is that you are breaking into an infinite loop. If the BoatMain.players() was empty, that means that it just continued with that while-loop (since that condition is never false).
    This means effectively that the main -thread has been stalled, and eventually the server stopped responding (and got killed by what I assume is some sort of watchdog)
     
    • Useful Useful x 1
  7. The only other occurrences are when the variable is set to 3 in a command that starts the race early and when the timer is canceled (code in the original post). How would I fix the problem?
     
  8. If you really need that infinite while-loop, put it into another thread. But I doubt this, so you should come up with another solution to your problem. What is it that you want to accomplish with that?
     
    • Useful Useful x 1
  9. It's meant to check if there are enough players, but you're probably right, I'm going to try checking when players join instead. Thanks for your help!:)
     
    • Like Like x 1