Search in sources :

Example 1 with WorldDumper

use of org.terasology.persistence.WorldDumper in project Terasology by MovingBlocks.

the class CoreCommands method dumpEntities.

/**
 * Writes out information on all entities to a text file for debugging
 * @throws IOException thrown when error with saving file occures
 */
@Command(shortDescription = "Writes out information on all entities to a text file for debugging", helpText = "Writes entity information out into a file named \"entityDump.txt\".")
public void dumpEntities() throws IOException {
    EngineEntityManager engineEntityManager = (EngineEntityManager) entityManager;
    PrefabSerializer prefabSerializer = new PrefabSerializer(engineEntityManager.getComponentLibrary(), engineEntityManager.getTypeSerializerLibrary());
    WorldDumper worldDumper = new WorldDumper(engineEntityManager, prefabSerializer);
    worldDumper.save(PathManager.getInstance().getHomePath().resolve("entityDump.txt"));
}
Also used : EngineEntityManager(org.terasology.entitySystem.entity.internal.EngineEntityManager) WorldDumper(org.terasology.persistence.WorldDumper) PrefabSerializer(org.terasology.persistence.serializers.PrefabSerializer) Command(org.terasology.logic.console.commandSystem.annotations.Command) ConsoleCommand(org.terasology.logic.console.commandSystem.ConsoleCommand)

Aggregations

EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)1 ConsoleCommand (org.terasology.logic.console.commandSystem.ConsoleCommand)1 Command (org.terasology.logic.console.commandSystem.annotations.Command)1 WorldDumper (org.terasology.persistence.WorldDumper)1 PrefabSerializer (org.terasology.persistence.serializers.PrefabSerializer)1