diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-05-16 16:21:36 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-05-16 16:21:36 +0800 |
| commit | 4e24411029bb5e21cbc91696503bab600cc7cd51 (patch) | |
| tree | c00e3c0adad17cc883a077a6051c56cbd472be37 /runtime/src/main/java/me/shedaniel/rei/impl/common | |
| parent | 1c867f9d6e686c70c36b2f2b774fdee17211fa45 (diff) | |
| download | RoughlyEnoughItems-4e24411029bb5e21cbc91696503bab600cc7cd51.tar.gz RoughlyEnoughItems-4e24411029bb5e21cbc91696503bab600cc7cd51.tar.bz2 RoughlyEnoughItems-4e24411029bb5e21cbc91696503bab600cc7cd51.zip | |
Refactor PluginManager
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/impl/common')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java | 13 |
1 files changed, 5 insertions, 8 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 249abc0c6..684be988e 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 @@ -28,15 +28,12 @@ import com.google.common.base.Stopwatch; import com.google.common.collect.FluentIterable; import com.google.common.collect.Iterables; import me.shedaniel.rei.RoughlyEnoughItemsCore; -import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; import me.shedaniel.rei.api.common.plugins.PluginManager; import me.shedaniel.rei.api.common.plugins.PluginView; import me.shedaniel.rei.api.common.plugins.REIPlugin; import me.shedaniel.rei.api.common.plugins.REIPluginProvider; import me.shedaniel.rei.api.common.registry.Reloadable; import me.shedaniel.rei.api.common.util.CollectionUtils; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; import net.minecraft.Util; import org.apache.commons.lang3.tuple.MutablePair; import org.jetbrains.annotations.ApiStatus; @@ -54,7 +51,7 @@ public class PluginManagerImpl<P extends REIPlugin<?>> implements PluginManager< private final Map<Class<? extends Reloadable<P>>, Reloadable<? super P>> cache = new ConcurrentHashMap<>(); private final Class<P> pluginClass; private final UnaryOperator<PluginView<P>> view; - private boolean arePluginsLoading = false; + private boolean reloading = false; private final List<REIPluginProvider<P>> plugins = new ArrayList<>(); private final LongConsumer reloadDoneListener; @@ -74,8 +71,8 @@ public class PluginManagerImpl<P extends REIPlugin<?>> implements PluginManager< } @Override - public boolean arePluginsReloading() { - return arePluginsLoading; + public boolean isReloading() { + return reloading; } @Override @@ -154,7 +151,7 @@ public class PluginManagerImpl<P extends REIPlugin<?>> implements PluginManager< @Override public void startReload() { try { - arePluginsLoading = true; + reloading = true; long startTime = Util.getMillis(); MutablePair<Stopwatch, String> sectionData = new MutablePair<>(Stopwatch.createUnstarted(), ""); @@ -193,7 +190,7 @@ public class PluginManagerImpl<P extends REIPlugin<?>> implements PluginManager< } catch (Throwable throwable) { throwable.printStackTrace(); } finally { - arePluginsLoading = false; + reloading = false; } } } |
