Package org.terasology.module

Examples of org.terasology.module.ModuleMetadata


        metadataReader.registerExtension(SERVER_SIDE_ONLY_EXT, Boolean.TYPE);
        metadataReader.registerExtension(IS_GAMEPLAY_EXT, Boolean.TYPE);
        metadataReader.registerExtension(DEFAULT_WORLD_GENERATOR_EXT, String.class);
        Module engineModule;
        try (Reader reader = new InputStreamReader(getClass().getResourceAsStream("/engine-module.txt"))) {
            ModuleMetadata metadata = metadataReader.read(reader);
            engineModule = ClasspathModule.create(metadata, getClass(), Module.class);
        } catch (IOException e) {
            throw new RuntimeException("Failed to read engine metadata", e);
        } catch (URISyntaxException e) {
            throw new RuntimeException("Failed to convert engine library location to path", e);
View Full Code Here


    }

    public static ModuleManager create() throws Exception {
        ModuleManager moduleManager = new ModuleManager();
        try (Reader reader = new InputStreamReader(ModuleManagerFactory.class.getResourceAsStream("/module.txt"))) {
            ModuleMetadata metadata = new ModuleMetadataReader().read(reader);
            moduleManager.getRegistry().add(ClasspathModule.create(metadata, ModuleManagerFactory.class));
        }
        moduleManager.loadEnvironment(
                Sets.newHashSet(moduleManager.getRegistry().getLatestModuleVersion(new Name("engine")),
                        moduleManager.getRegistry().getLatestModuleVersion(new Name("unittest"))), true
View Full Code Here

TOP

Related Classes of org.terasology.module.ModuleMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.