diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-08-26 22:04:05 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-08-26 22:04:05 +0900 |
| commit | 066205c5922646285c59f318d581632382248cad (patch) | |
| tree | 5fdf8209db4e2d3013c2be1ad7b80d01317c577b /runtime-engine/plugins/src | |
| parent | a6900532610247cae49f1c782442d07d8f7b1d2d (diff) | |
| download | RoughlyEnoughItems-066205c5922646285c59f318d581632382248cad.tar.gz RoughlyEnoughItems-066205c5922646285c59f318d581632382248cad.tar.bz2 RoughlyEnoughItems-066205c5922646285c59f318d581632382248cad.zip | |
Make it run
Diffstat (limited to 'runtime-engine/plugins/src')
3 files changed, 40 insertions, 1 deletions
diff --git a/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerConstructorImpl.java b/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerConstructorImpl.java new file mode 100644 index 000000000..18da7ee23 --- /dev/null +++ b/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerConstructorImpl.java @@ -0,0 +1,38 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021, 2022 shedaniel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package me.shedaniel.rei.impl.common.plugins; + +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.impl.common.provider.PluginManagerConstructor; + +import java.util.function.UnaryOperator; + +public class PluginManagerConstructorImpl implements PluginManagerConstructor { + @Override + public <P extends REIPlugin<?>> PluginManager<P> create(Class<P> clazz, UnaryOperator<PluginView<P>> constructor) { + return new PluginManagerImpl<>(clazz, constructor); + } +} diff --git a/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java b/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java index a4af54642..7544bdffd 100644 --- a/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java +++ b/runtime-engine/plugins/src/main/java/me/shedaniel/rei/impl/common/plugins/PluginManagerImpl.java @@ -62,7 +62,7 @@ public class PluginManagerImpl<P extends REIPlugin<?>> implements PluginManager< @Override public void registerReloadable(Reloadable<? extends P> reloadable) { this.reloadables.add((Reloadable<P>) reloadable); - InternalLogger.getInstance().info("Registered reloadable into plugin manager []: " + reloadable.getClass().getName(), pluginClass.getSimpleName()); + InternalLogger.getInstance().info("Registered reloadable into plugin manager [%s]: " + reloadable.getClass().getName(), pluginClass.getSimpleName()); } @Override diff --git a/runtime-engine/plugins/src/main/resources/META-INF/services/me.shedaniel.rei.impl.common.provider.PluginManagerConstructor b/runtime-engine/plugins/src/main/resources/META-INF/services/me.shedaniel.rei.impl.common.provider.PluginManagerConstructor new file mode 100644 index 000000000..816ec424b --- /dev/null +++ b/runtime-engine/plugins/src/main/resources/META-INF/services/me.shedaniel.rei.impl.common.provider.PluginManagerConstructor @@ -0,0 +1 @@ +me.shedaniel.rei.impl.common.plugins.PluginManagerConstructorImpl
\ No newline at end of file |
