Package org.terasology.network

Examples of org.terasology.network.NetworkMode


    private NetworkSystem networkSystem;

    @Override
    public void postBegin() {
        Set<Prefab> existingGlobals = Sets.newHashSet();
        NetworkMode mode = networkSystem.getMode();

        for (EntityRef entity : entityManager.getEntitiesWith(AutoCreateComponent.class)) {
            existingGlobals.add(entity.getParentPrefab());
        }

        for (Prefab prefab : prefabManager.listPrefabs(AutoCreateComponent.class)) {
            AutoCreateComponent comp = prefab.getComponent(AutoCreateComponent.class);
            if (!existingGlobals.contains(prefab) && (comp.createClientSide || mode.isAuthority())) {
                entityManager.create(prefab);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.terasology.network.NetworkMode

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.