Fix some log stuff
This commit is contained in:
parent
611dd00c48
commit
1c7f64595e
@ -5,6 +5,8 @@ import java.net.ServerSocket;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import fr.pandacube.lib.core.util.Log;
|
||||
|
||||
@Deprecated
|
||||
public class NetworkAPIListener implements Runnable {
|
||||
|
||||
@ -40,7 +42,7 @@ public class NetworkAPIListener implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("NetworkAPI '" + name + "' à l'écoute sur le port " + port);
|
||||
Log.info("NetworkAPI '" + name + "' à l'écoute sur le port " + port);
|
||||
|
||||
try {
|
||||
// réception des connexion client
|
||||
@ -57,7 +59,7 @@ public class NetworkAPIListener implements Runnable {
|
||||
} catch (IOException e) {}
|
||||
}
|
||||
|
||||
System.out.println("NetworkAPI '" + name + "' ferme le port " + port);
|
||||
Log.info("NetworkAPI '" + name + "' ferme le port " + port);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
package fr.pandacube.lib.paper.util;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import fr.pandacube.lib.core.util.Log;
|
||||
import fr.pandacube.lib.paper.PandaLibPaper;
|
||||
|
||||
public class ThreadUtil {
|
||||
@ -19,7 +21,13 @@ public class ThreadUtil {
|
||||
if (Bukkit.isPrimaryThread())
|
||||
return task.call();
|
||||
|
||||
try {
|
||||
return Bukkit.getScheduler().callSyncMethod(PandaLibPaper.getPlugin(), task).get();
|
||||
} catch (ExecutionException e) {
|
||||
Log.severe("Execution Exception while running code on server Thread. The source exception is:",
|
||||
e.getCause());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static void runOnServerThreadAndWait(Runnable task) throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user