Package org.terasology.network

Examples of org.terasology.network.NetworkSystem


    public void setup() {
        TypeSerializationLibrary serializationLibrary = new TypeSerializationLibrary(reflectFactory, copyStrategyLibrary);
        serializationLibrary.add(Vector3f.class, new Vector3fTypeHandler());
        serializationLibrary.add(Quat4f.class, new Quat4fTypeHandler());

        NetworkSystem networkSystem = mock(NetworkSystem.class);
        EntitySystemBuilder builder = new EntitySystemBuilder();
        EngineEntityManager entityManager = builder.build(moduleManager.getEnvironment(), networkSystem, new ReflectionReflectFactory());
        entityManager.getComponentLibrary().register(new SimpleUri("test", "gettersetter"), GetterSetterComponent.class);
        entityManager.getComponentLibrary().register(new SimpleUri("test", "string"), StringComponent.class);
        entityManager.getComponentLibrary().register(new SimpleUri("test", "integer"), IntegerComponent.class);
View Full Code Here


        EntitySystemBuilder builder = new EntitySystemBuilder();

        CoreRegistry.put(ComponentSystemManager.class, mock(ComponentSystemManager.class));

        blockManager = CoreRegistry.put(BlockManager.class, new BlockManagerImpl(mock(WorldAtlas.class), new DefaultBlockFamilyFactoryRegistry()));
        NetworkSystem networkSystem = mock(NetworkSystem.class);
        when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
        entityManager = builder.build(moduleManager.getEnvironment(), networkSystem, new ReflectionReflectFactory());
        worldStub = new WorldProviderCoreStub();
        worldProvider = new EntityAwareWorldProvider(worldStub, entityManager);

        plainBlock = new Block();
View Full Code Here

        return "Registering Blocks...";
    }

    @Override
    public boolean step() {
        NetworkSystem networkSystem = CoreRegistry.get(NetworkSystem.class);
        WorldAtlas atlas = new WorldAtlasImpl(CoreRegistry.get(Config.class).getRendering().getMaxTextureAtlasResolution());
        CoreRegistry.put(WorldAtlas.class, atlas);

        BlockManagerImpl blockManager;
        BlockFamilyFactoryRegistry blockFamilyFactoryRegistry = CoreRegistry.get(BlockFamilyFactoryRegistry.class);
        if (networkSystem.getMode().isAuthority()) {
            blockManager = new BlockManagerImpl(atlas, gameManifest.getRegisteredBlockFamilies(), gameManifest.getBlockIdMap(), true, blockFamilyFactoryRegistry);
            blockManager.subscribe(CoreRegistry.get(NetworkSystem.class));
        } else {
            blockManager = new BlockManagerImpl(atlas, gameManifest.getRegisteredBlockFamilies(), gameManifest.getBlockIdMap(), false, blockFamilyFactoryRegistry);
        }
View Full Code Here

        return "Registering Biomes...";
    }

    @Override
    public boolean step() {
        NetworkSystem networkSystem = CoreRegistry.get(NetworkSystem.class);
        ModuleEnvironment moduleEnvironment = CoreRegistry.get(ModuleManager.class).getEnvironment();

        BiomeManager biomeManager;
        if (networkSystem.getMode().isAuthority()) {
            biomeManager = new BiomeManager(moduleEnvironment, gameManifest.getBiomeIdMap());
//            biomeManager.subscribe(CoreRegistry.get(NetworkSystem.class));
            // TODO figure out what this does
        } else {
            biomeManager = new BiomeManager(moduleEnvironment, gameManifest.getBiomeIdMap());
View Full Code Here

TOP

Related Classes of org.terasology.network.NetworkSystem

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.