Search in sources :

Example 31 with ModuleEnvironment

use of org.terasology.gestalt.module.ModuleEnvironment in project Terasology by MovingBlocks.

the class TelemetryScreen method fetchTelemetryCategoriesFromEngineOnlyEnvironment.

/**
 * refresh the telemetryCategories map.
 */
private void fetchTelemetryCategoriesFromEngineOnlyEnvironment() {
    telemetryCategories = Maps.newHashMap();
    try (ModuleEnvironment environment = moduleManager.loadEnvironment(Collections.emptySet(), false)) {
        for (Class<?> holdingType : environment.getTypesAnnotatedWith(TelemetryCategory.class)) {
            TelemetryCategory telemetryCategory = holdingType.getAnnotation(TelemetryCategory.class);
            telemetryCategories.put(telemetryCategory, holdingType);
        }
    }
}
Also used : ModuleEnvironment(org.terasology.gestalt.module.ModuleEnvironment)

Aggregations

ModuleEnvironment (org.terasology.gestalt.module.ModuleEnvironment)31 ModuleManager (org.terasology.engine.core.module.ModuleManager)24 Module (org.terasology.gestalt.module.Module)6 Name (org.terasology.gestalt.naming.Name)6 DependencyResolver (org.terasology.gestalt.module.dependencyresolution.DependencyResolver)5 ResolutionResult (org.terasology.gestalt.module.dependencyresolution.ResolutionResult)5 SimpleUri (org.terasology.engine.core.SimpleUri)4 RegisterBindButton (org.terasology.engine.input.RegisterBindButton)4 RecordAndReplayCurrentStatus (org.terasology.engine.recording.RecordAndReplayCurrentStatus)4 RecordAndReplaySerializer (org.terasology.engine.recording.RecordAndReplaySerializer)4 RecordAndReplayUtils (org.terasology.engine.recording.RecordAndReplayUtils)4 EngineEntityManager (org.terasology.engine.entitySystem.entity.internal.EngineEntityManager)3 NetworkSystem (org.terasology.engine.network.NetworkSystem)3 DirectionAndOriginPosRecorderList (org.terasology.engine.recording.DirectionAndOriginPosRecorderList)3 BlockManager (org.terasology.engine.world.block.BlockManager)3 BlockFamilyLibrary (org.terasology.engine.world.block.family.BlockFamilyLibrary)3 TypeHandlerLibrary (org.terasology.persistence.typeHandling.TypeHandlerLibrary)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 URL (java.net.URL)2 Path (java.nio.file.Path)2