From 242b0a3d140dae6eadade91e0ee5bfbcf403f3bf Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 20 Nov 2021 15:14:09 +0800 Subject: Add support for custom types for JEI plugins --- .../me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/src/main/java/me') diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java index bda591fb1..f0680cd47 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java @@ -178,10 +178,13 @@ public class PluginManagerImpl

> implements PluginManager< try (SectionClosable section = section(stage, sectionName + wrapper.getPluginProviderName() + "/")) { if (reloadable == null || !wrapper.plugin.shouldBeForcefullyDoneOnMainThread(reloadable)) { consumer.accept(wrapper); - } else if (Platform.getEnvironment() == Env.CLIENT) { - EnvExecutor.runInEnv(Env.CLIENT, () -> () -> queueExecutionClient(() -> consumer.accept(wrapper))); } else { - queueExecution(() -> consumer.accept(wrapper)); + RoughlyEnoughItemsCore.LOGGER.warn("Forcing plugin " + wrapper.getPluginProviderName() + " to run on the main thread for " + sectionName + "! This is extremely dangerous, and have large performance implications."); + if (Platform.getEnvironment() == Env.CLIENT) { + EnvExecutor.runInEnv(Env.CLIENT, () -> () -> queueExecutionClient(() -> consumer.accept(wrapper))); + } else { + queueExecution(() -> consumer.accept(wrapper)); + } } } catch (Throwable throwable) { RoughlyEnoughItemsCore.LOGGER.error(wrapper.getPluginProviderName() + " plugin failed to " + sectionName + "!", throwable); -- cgit