Configuration Résolu Java : Event fait crash le serveur

  • Auteur de la discussion Auteur de la discussion Alex Fatta
  • Date de début Date de début

Alex Fatta

Commandant de la Flotte et de la Horde
13 Août 2014
1 389
1
191
187
Bonsoir !

J'ai crée un event qui est chargé de checker si un joueur touche l'eau et si oui il fait tel ou tel chose. Le problème est le suivant : quand la condition est remplie pour que l'event soit checké, bah le serveur Timed Out :/
Voici le code :

Code:
    private static ArrayList<Player> playerList = new ArrayList<>();
    private static int incremantator = 0;

    @EventHandler
    public static void touchWaterCheck(PlayerMoveEvent event) {

        if (Main.getGameIsJoinable() && Main.getGameIsLaunched()) {
            if (incremantator == 0) {
                incremantator = playerList.size();
            }

            Player player = event.getPlayer();
            Player playerToTeleport;

            Boolean hasTouched = false;

            Location loc = player.getLocation();
            loc.setY(loc.getY() - 2);
            Block blockToTest = Bukkit.getServer().getWorld(loc.getWorld().getName()).getBlockAt(loc);

            while (!hasTouched) {
                if (blockToTest.equals(Material.WATER)) {
                    player.teleport(Main.getGroundLocation());
                    loc.getBlock().setType(Material.WOOL);
                    hasTouched = true;
                }

                if (blockToTest.equals(Material.WOOL)) {
                    player.teleport(Main.getGroundLocation());
                    playerList.remove(player);
                    incremantator = playerList.size();
                    hasTouched = true;
                }
            }

            teleportNextPlayer();

        }
    }

    public static void teleportNextPlayer() {
        Player playerToTeleport = playerList.get(incremantator);
        playerToTeleport.teleport(Main.getJumpLocation());

    }

Avec Main.getGameIsJoinable() && Main.getGameIsLaunched() 2 booléens qui sont modifiés grâce à des commandes IG. Vous l'aurez donc compris : lorsque les 2 booléens sont sur true, bah c'est là que au bout d'une minute le serveur crash. Voici le crash report :

Code:
[20:32:18 ERROR]: The server has stopped responding!
[20:32:18 ERROR]: Please report this to http://www.spigotmc.org/
[20:32:18 ERROR]: Be sure to include ALL relevant console errors and Minecraft crash reports
[20:32:18 ERROR]: Spigot version: git-Spigot-0869666-03f1e37 (MC: 1.12)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Server thread dump (Look for plugins here before reporting to Spigot!):
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Server thread
[20:32:18 ERROR]:       PID: 19 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               fr.alexfatta.dac.playerManager.TeleportPlayerOnePerOne.touchWaterCheck(TeleportPlayerOnePerOne.java:45)
[20:32:18 ERROR]:               [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:32:18 ERROR]:               [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[20:32:18 ERROR]:               [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.reflect.Method.invoke(Unknown Source)
[20:32:18 ERROR]:               app//org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
[20:32:18 ERROR]:               app//org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[20:32:18 ERROR]:               app//org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:499)
[20:32:18 ERROR]:               app//org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:647)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PacketPlayInFlying.a(SourceFile:126)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PacketPlayInFlying$PacketPlayInPositionLook.a(SourceFile:18)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.FutureTask.run(Unknown Source)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:747)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Entire Thread Dump:
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Reference Handler
[20:32:18 ERROR]:       PID: 2 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.ref.Reference.waitForReferencePendingList(Native Method)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.Reference.processPendingReferences(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.Reference.access$000(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Finalizer
[20:32:18 ERROR]:       PID: 3 | Suspended: false | Native: false | State: WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Object.wait(Native Method)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.ReferenceQueue.remove(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.ReferenceQueue.remove(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Signal Dispatcher
[20:32:18 ERROR]:       PID: 4 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Attach Listener
[20:32:18 ERROR]:       PID: 5 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Common-Cleaner
[20:32:18 ERROR]:       PID: 11 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Object.wait(Native Method)
[20:32:18 ERROR]:               [email protected]/java.lang.ref.ReferenceQueue.remove(Unknown Source)
[20:32:18 ERROR]:               [email protected]/jdk.internal.ref.CleanerImpl.run(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]:               [email protected]/jdk.internal.misc.InnocuousThread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Snooper Timer
[20:32:18 ERROR]:       PID: 15 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Object.wait(Native Method)
[20:32:18 ERROR]:               [email protected]/java.util.TimerThread.mainLoop(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.TimerThread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: NonBlockingInputStreamThread
[20:32:18 ERROR]:       PID: 17 | Suspended: false | Native: false | State: WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Object.wait(Native Method)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.run(NonBlockingInputStream.java:278)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Server Infinisleeper
[20:32:18 ERROR]:       PID: 20 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.sleep(Native Method)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.DedicatedServer$1.run(DedicatedServer.java:60)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Server thread
[20:32:18 ERROR]:       PID: 19 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Thread is waiting on monitor(s):
[20:32:18 ERROR]:               Locked on:app//org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484)
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               fr.alexfatta.dac.playerManager.TeleportPlayerOnePerOne.touchWaterCheck(TeleportPlayerOnePerOne.java:45)
[20:32:18 ERROR]:               [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:32:18 ERROR]:               [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[20:32:18 ERROR]:               [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.reflect.Method.invoke(Unknown Source)
[20:32:18 ERROR]:               app//org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
[20:32:18 ERROR]:               app//org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[20:32:18 ERROR]:               app//org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:499)
[20:32:18 ERROR]:               app//org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:647)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PacketPlayInFlying.a(SourceFile:126)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PacketPlayInFlying$PacketPlayInPositionLook.a(SourceFile:18)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.FutureTask.run(Unknown Source)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:747)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: DestroyJavaVM
[20:32:18 ERROR]:       PID: 21 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Thread-3
[20:32:18 ERROR]:       PID: 23 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Thread is waiting on monitor(s):
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.cs.StreamEncoder.flush(Unknown Source)
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.cs.StreamEncoder.flush(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.io.OutputStreamWriter.flush(Unknown Source)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.flush(ConsoleReader.java:976)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.v1_12_R1.util.TerminalConsoleWriterThread.run(TerminalConsoleWriterThread.java:44)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Server console handler
[20:32:18 ERROR]:       PID: 22 | Suspended: false | Native: true | State: RUNNABLE
[20:32:18 ERROR]:       Thread is waiting on monitor(s):
[20:32:18 ERROR]:               Locked on:app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:169)
[20:32:18 ERROR]:               Locked on:app//org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:261)
[20:32:18 ERROR]:               Locked on:app//org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:198)
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               app//org.fusesource.jansi.internal.Kernel32.ReadConsoleInputW(Native Method)
[20:32:18 ERROR]:               app//org.fusesource.jansi.internal.Kernel32.readConsoleInputHelper(Kernel32.java:761)
[20:32:18 ERROR]:               app//org.fusesource.jansi.internal.Kernel32.readConsoleKeyInput(Kernel32.java:794)
[20:32:18 ERROR]:               app//org.fusesource.jansi.internal.WindowsSupport.readConsoleInput(WindowsSupport.java:97)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.WindowsTerminal.readConsoleInput(WindowsTerminal.java:215)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.WindowsTerminal.access$000(WindowsTerminal.java:55)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.WindowsTerminal$1.read(WindowsTerminal.java:157)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:169)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:137)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:246)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:261)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:198)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readCharacter(ConsoleReader.java:2145)
[20:32:18 ERROR]:               app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:2349)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.DedicatedServer$2.run(DedicatedServer.java:85)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Spigot Watchdog Thread
[20:32:18 ERROR]:       PID: 24 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/sun.management.ThreadImpl.dumpThreads0(Native Method)
[20:32:18 ERROR]:               [email protected]/sun.management.ThreadImpl.dumpAllThreads(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.management.ThreadImpl.dumpAllThreads(Unknown Source)
[20:32:18 ERROR]:               app//org.spigotmc.WatchdogThread.run(WatchdogThread.java:76)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Spigot Metrics Thread
[20:32:18 ERROR]:       PID: 25 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Object.wait(Native Method)
[20:32:18 ERROR]:               [email protected]/java.util.TimerThread.mainLoop(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.TimerThread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Netty Server IO #0
[20:32:18 ERROR]:       PID: 26 | Suspended: false | Native: false | State: RUNNABLE
[20:32:18 ERROR]:       Thread is waiting on monitor(s):
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.SelectorImpl.select(Unknown Source)
[20:32:18 ERROR]:               app//io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
[20:32:18 ERROR]:               app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:732)
[20:32:18 ERROR]:               app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:388)
[20:32:18 ERROR]:               app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: File IO Thread
[20:32:18 ERROR]:       PID: 29 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.sleep(Native Method)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.FileIOThread.c(SourceFile:51)
[20:32:18 ERROR]:               app//net.minecraft.server.v1_12_R1.FileIOThread.run(SourceFile:30)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Netty Server IO #1
[20:32:18 ERROR]:       PID: 30 | Suspended: false | Native: true | State: RUNNABLE
[20:32:18 ERROR]:       Thread is waiting on monitor(s):
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.SelectorImpl.select(Unknown Source)
[20:32:18 ERROR]:               app//io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
[20:32:18 ERROR]:               app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:732)
[20:32:18 ERROR]:               app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:388)
[20:32:18 ERROR]:               app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: threadDeathWatcher-2-1
[20:32:18 ERROR]:       PID: 31 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.sleep(Native Method)
[20:32:18 ERROR]:               app//io.netty.util.ThreadDeathWatcher$Watcher.run(ThreadDeathWatcher.java:152)
[20:32:18 ERROR]:               app//io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Netty Server IO #2
[20:32:18 ERROR]:       PID: 32 | Suspended: false | Native: true | State: RUNNABLE
[20:32:18 ERROR]:       Thread is waiting on monitor(s):
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               Locked on:[email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
[20:32:18 ERROR]:               [email protected]/sun.nio.ch.SelectorImpl.select(Unknown Source)
[20:32:18 ERROR]:               app//io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
[20:32:18 ERROR]:               app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:732)
[20:32:18 ERROR]:               app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:388)
[20:32:18 ERROR]:               app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 ERROR]: Current Thread: Async Chat Thread - #0
[20:32:18 ERROR]:       PID: 37 | Suspended: false | Native: false | State: TIMED_WAITING
[20:32:18 ERROR]:       Stack:
[20:32:18 ERROR]:               [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.SynchronousQueue.poll(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[20:32:18 ERROR]:               [email protected]/java.lang.Thread.run(Unknown Source)
[20:32:18 ERROR]: ------------------------------
[20:32:18 INFO]: Startup script './start.sh' does not exist! Stopping server.
[20:32:18 INFO]: Stopping server

Ah et aussi dernière chose, j'ai ce message au lancement du serveur dans les 15 première lignes :
Code:
>WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/C:/Users/asus/Desktop/Dossier/Serveur%20Bungee%20en%20construction/Serveur%20de%20test/spigot-1.12.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Je ne sais pas si c'est grave ou pas.

Voilà ! En vous remerciant pour votre aide ! :D

AlexFatta
 
Salut,
Ton serveur reste bloqué dans la boucle while, d'où le fait qu'il arrête de répondre.
Tu ne devrais pas utiliser une boucle while ici, sinon tu vas forcement bloqué la boucle interne du jeu.
 
  • J'aime
Reactions: DiscowZombie
Bon du coup j'ai effectué une modif et le serveur ne crash plus. Toutefois, la vérification de l'event ne s'effectue pas. C'est à dire que l'event qui vérifie le block sous le joueur ne se déclenche pas, le block n'est pas vérifié ni changé. Voici le nous veau code :

Code:
    @EventHandler
    public static void touchWaterCheck(PlayerMoveEvent event) {

        Player player = event.getPlayer();

        if (playerList.contains(player)) {
            if (Main.getGameIsJoinable() && Main.getGameIsLaunched()) {

                Location playerLocation = player.getLocation();
                Block blockToTest = Bukkit.getServer().getWorld(playerLocation.getWorld().getName()).getBlockAt(playerLocation);

                playerLocation.setY(playerLocation.getY() - 1);

                if (blockToTest.equals(Material.WATER)) {
                    player.teleport(Main.getGroundLocation());
                    playerLocation.getBlock().setType(Material.WOOL);
                    teleportNextPlayer();
                }

                if (blockToTest.equals(Material.WOOL)) {
                    player.teleport(Main.getGroundLocation());
                    playerList.remove(player);
                    incremantator = playerList.size();
                    teleportNextPlayer();
                }
            }
        }
    }

Si vous avez des idées pour résoudre le problème.. ;)

AlexFatta
 
Ok j'ai testé avec des sysout et l'event se déclenche bien. Mais ce sont mes conditions de blocks qui ne fonctionnent pas. Comment je peux comparer un block sous le joueur avec de l'eau ou un block ?

AlexFatta
 
Ah je pense qu'il faudrait plutôt faire blockToTest.getMaterial().equals(Material.WATER) (vu que tu compares avec un matériau).
 
C'est pas idiot en effet, mais je n'ai pas .getMaterial, je n'ai que getType et j'ai testé cela ne fonctionne pas :/ Dans la liste de ce qui est proposé je ne vois rien d'autre qui ferait référence au matériaux. C'est étrange que cela ne fonctionne pas :/

AlexFatta
 
Up ! :D

Code actuel :
Code:
    @EventHandler
    public void touchWaterCheck(PlayerMoveEvent event) {
        Player player = event.getPlayer();

        if (playerList.contains(player)) {
            if (Main.getGameIsJoinable() && Main.getGameIsLaunched()) {

                Location playerLocation = player.getLocation();
                playerLocation.setY(playerLocation.getY() - 2);

                Block blockToTest = Bukkit.getServer().getWorld(playerLocation.getWorld().getName()).getBlockAt(playerLocation);

                if (blockToTest.getType().equals(Material.WATER)) {
                    System.out.println("eau");
                    player.teleport(Main.getGroundLocation());
                    playerLocation.getBlock().setType(Material.WOOL);
                    teleportNextPlayer();
                }

                if (blockToTest.getType().equals(Material.WOOL)) {
                    System.out.println("laine");
                    player.teleport(Main.getGroundLocation());
                    playerList.remove(player);
                    incremantator = playerList.size();
                    teleportNextPlayer();
                }
            }
        }
    }

    public static void teleportNextPlayer() {
        System.out.println(incremantator);

        Player playerToTeleport = playerList.get(incremantator);
        playerToTeleport.teleport(Main.getJumpLocation());

        incremantator += 1;

    }

AlexFatta