mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 08:56:04 +01:00
Wait for thread executors to shut down
This commit is contained in:
@@ -504,9 +504,7 @@ public final class Utils {
|
||||
* @return A list of all fields in the class.
|
||||
*/
|
||||
public static List<Field> getAllFields(Class<?> type) {
|
||||
var fields = new LinkedList<>(
|
||||
Arrays.asList(type.getDeclaredFields())
|
||||
);
|
||||
var fields = new LinkedList<>(Arrays.asList(type.getDeclaredFields()));
|
||||
|
||||
// Check for superclasses.
|
||||
if (type.getSuperclass() != null) {
|
||||
@@ -515,4 +513,16 @@ public final class Utils {
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sleeps the current thread without an exception.
|
||||
*
|
||||
* @param millis The amount of milliseconds to sleep.
|
||||
*/
|
||||
public static void sleep(long millis) {
|
||||
try {
|
||||
Thread.sleep(millis);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user