aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-11-20 15:14:09 +0800
committershedaniel <daniel@shedaniel.me>2021-11-20 18:30:29 +0800
commit242b0a3d140dae6eadade91e0ee5bfbcf403f3bf (patch)
treee609dfac7b8272bd5d5bb39b22b80432c26f2423 /runtime/src/main/java/me/shedaniel
parent8984313c6cd387dbb9448d5b1d824ab147a3b003 (diff)
downloadRoughlyEnoughItems-242b0a3d140dae6eadade91e0ee5bfbcf403f3bf.tar.gz
RoughlyEnoughItems-242b0a3d140dae6eadade91e0ee5bfbcf403f3bf.tar.bz2
RoughlyEnoughItems-242b0a3d140dae6eadade91e0ee5bfbcf403f3bf.zip
Add support for custom types for JEI plugins
Diffstat (limited to 'runtime/src/main/java/me/shedaniel')
-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 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<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);