aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-11-20 15:14:09 +0800
committershedaniel <daniel@shedaniel.me>2021-11-20 15:14:09 +0800
commit3c2be7753cebfe420cf4861e5590c8eef9469c33 (patch)
treee57d32d2f70390ffeb6f7d86fd80c1109a02750b /runtime/src/main/java
parent1854df75774d4ef0f2ba2216b4282e95f1113899 (diff)
downloadRoughlyEnoughItems-3c2be7753cebfe420cf4861e5590c8eef9469c33.tar.gz
RoughlyEnoughItems-3c2be7753cebfe420cf4861e5590c8eef9469c33.tar.bz2
RoughlyEnoughItems-3c2be7753cebfe420cf4861e5590c8eef9469c33.zip
Add support for custom types for JEI plugins
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java9
1 files changed, 6 insertions, 3 deletions
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 bed717438..0fef7bde1 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<P extends REIPlugin<?>> 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);