|
22 | 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
23 | 23 | * THE SOFTWARE. |
24 | 24 | */ |
25 | | -package org.spongepowered.neoforge.applaunch.mod.metadata; |
| 25 | +package org.spongepowered.neoforge.applaunch.plugin.discovery; |
26 | 26 |
|
27 | | -import net.neoforged.neoforgespi.language.IConfigurable; |
| 27 | +import org.spongepowered.asm.launch.platform.container.IContainerHandle; |
28 | 28 |
|
29 | | -import java.util.Collections; |
| 29 | +import java.util.Collection; |
30 | 30 | import java.util.List; |
31 | | -import java.util.Optional; |
32 | 31 |
|
33 | | -public final class PluginMixinConfigurable implements IConfigurable { |
34 | | - private final String config; |
| 32 | +public class PluginResourceContainerHandle implements IContainerHandle { |
| 33 | + private final JarContentsPluginResource resource; |
35 | 34 |
|
36 | | - public PluginMixinConfigurable(final String config) { |
37 | | - this.config = config; |
| 35 | + public PluginResourceContainerHandle(final JarContentsPluginResource resource) { |
| 36 | + this.resource = resource; |
38 | 37 | } |
39 | 38 |
|
40 | | - @SuppressWarnings("unchecked") |
41 | 39 | @Override |
42 | | - public <T> Optional<T> getConfigElement(final String... key) { |
43 | | - if (key.length == 1 && "config".equals(key[0])) { |
44 | | - return Optional.of((T) this.config); |
45 | | - } |
46 | | - return Optional.empty(); |
| 40 | + public String getAttribute(final String name) { |
| 41 | + return this.resource.property(name).orElse(null); |
47 | 42 | } |
48 | 43 |
|
49 | 44 | @Override |
50 | | - public List<? extends IConfigurable> getConfigList(final String... key) { |
51 | | - return Collections.emptyList(); |
| 45 | + public Collection<IContainerHandle> getNestedContainers() { |
| 46 | + return List.of(); |
| 47 | + } |
| 48 | + |
| 49 | + @Override |
| 50 | + public String getId() { |
| 51 | + return this.resource.module().name(); |
| 52 | + } |
| 53 | + |
| 54 | + @Override |
| 55 | + public String getDescription() { |
| 56 | + return this.resource.toString(); |
52 | 57 | } |
53 | 58 | } |
0 commit comments