Search in sources :

Example 11 with NetworkSystem

use of org.terasology.network.NetworkSystem in project Terasology by MovingBlocks.

the class SetupRemotePlayer method step.

@Override
public boolean step() {
    NetworkSystemImpl networkSystem = (NetworkSystemImpl) context.get(NetworkSystem.class);
    EntityRef client = networkSystem.getServer().getClientEntity();
    if (client.exists()) {
        context.get(LocalPlayer.class).setClientEntity(client);
        return true;
    }
    return false;
}
Also used : LocalPlayer(org.terasology.logic.players.LocalPlayer) NetworkSystem(org.terasology.network.NetworkSystem) EntityRef(org.terasology.entitySystem.entity.EntityRef) NetworkSystemImpl(org.terasology.network.internal.NetworkSystemImpl)

Aggregations

NetworkSystem (org.terasology.network.NetworkSystem)11 TypeSerializationLibrary (org.terasology.persistence.typeHandling.TypeSerializationLibrary)5 Before (org.junit.Before)4 ContextImpl (org.terasology.context.internal.ContextImpl)3 ModuleManager (org.terasology.engine.module.ModuleManager)3 PojoPrefabManager (org.terasology.entitySystem.prefab.internal.PojoPrefabManager)3 ModuleEnvironment (org.terasology.module.ModuleEnvironment)3 EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)2 PojoEntityManager (org.terasology.entitySystem.entity.internal.PojoEntityManager)2 EventSystemImpl (org.terasology.entitySystem.event.internal.EventSystemImpl)2 ComponentLibrary (org.terasology.entitySystem.metadata.ComponentLibrary)2 EntitySystemLibrary (org.terasology.entitySystem.metadata.EntitySystemLibrary)2 NetworkSystemImpl (org.terasology.network.internal.NetworkSystemImpl)2 BiomeManager (org.terasology.world.biomes.BiomeManager)2 FileSystem (java.nio.file.FileSystem)1 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)1 ResourceUrn (org.terasology.assets.ResourceUrn)1 AssetManager (org.terasology.assets.management.AssetManager)1 ModuleAwareAssetTypeManager (org.terasology.assets.module.ModuleAwareAssetTypeManager)1 Config (org.terasology.config.Config)1