Skip to content

Commit

Permalink
chore(common): a bit of tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Dec 22, 2024
1 parent 77e26b9 commit dc685b8
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package net.kyori.adventure.platform.modcommon.impl;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.mojang.logging.LogUtils;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -68,11 +67,13 @@ public final class AdventureCommon {

static {
// Daemon thread executor for scheduled tasks
SCHEDULER = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder()
.setNameFormat("adventure-platform-mod-scheduler-%d")
.setDaemon(true)
.setUncaughtExceptionHandler((thread, ex) -> LOGGER.error("An uncaught exception occurred in scheduler thread '{}':", thread.getName(), ex))
.build());
SCHEDULER = Executors.newSingleThreadScheduledExecutor(
Thread.ofPlatform()
.name("adventure-platform-mod-scheduler", 0)
.uncaughtExceptionHandler((thread, ex) -> LOGGER.error("An uncaught exception occurred in scheduler thread '{}':", thread.getName(), ex))
.daemon()
.factory()
);
final var platformHooks = discoverHooks();
HOOKS = platformHooks;
FLATTENER = createFlattener(platformHooks);
Expand Down

0 comments on commit dc685b8

Please sign in to comment.