Search in sources :

Example 6 with BiomeManager

use of org.terasology.world.biomes.BiomeManager in project Terasology by MovingBlocks.

the class InternalLightGeneratorTest method setup.

@Before
public void setup() throws Exception {
    super.setup();
    AssetManager assetManager = CoreRegistry.get(AssetManager.class);
    blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager);
    CoreRegistry.put(BlockManager.class, blockManager);
    airBlock = blockManager.getBlock(BlockManager.AIR_ID);
    biomeManager = Mockito.mock(BiomeManager.class);
    BlockFamilyDefinitionData solidData = new BlockFamilyDefinitionData();
    solidData.getBaseSection().setDisplayName("Stone");
    solidData.getBaseSection().setShape(assetManager.getAsset("engine:cube", BlockShape.class).get());
    solidData.getBaseSection().setTranslucent(false);
    solidData.setFamilyFactory(new SymmetricBlockFamilyFactory());
    assetManager.loadAsset(new ResourceUrn("engine:stone"), solidData, BlockFamilyDefinition.class);
    solidBlock = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:stone")));
    BlockFamilyDefinitionData fullLightData = new BlockFamilyDefinitionData();
    fullLightData.getBaseSection().setDisplayName("Torch");
    fullLightData.getBaseSection().setShape(assetManager.getAsset("engine:cube", BlockShape.class).get());
    fullLightData.getBaseSection().setLuminance(ChunkConstants.MAX_LIGHT);
    fullLightData.setFamilyFactory(new SymmetricBlockFamilyFactory());
    assetManager.loadAsset(new ResourceUrn("engine:torch"), fullLightData, BlockFamilyDefinition.class);
    fullLight = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:torch")));
}
Also used : BiomeManager(org.terasology.world.biomes.BiomeManager) BlockUri(org.terasology.world.block.BlockUri) AssetManager(org.terasology.assets.management.AssetManager) BlockFamilyDefinitionData(org.terasology.world.block.loader.BlockFamilyDefinitionData) NullWorldAtlas(org.terasology.world.block.tiles.NullWorldAtlas) ResourceUrn(org.terasology.assets.ResourceUrn) SymmetricBlockFamilyFactory(org.terasology.world.block.family.SymmetricBlockFamilyFactory) BlockManagerImpl(org.terasology.world.block.internal.BlockManagerImpl) Before(org.junit.Before)

Example 7 with BiomeManager

use of org.terasology.world.biomes.BiomeManager in project Terasology by MovingBlocks.

the class BetweenChunkPropagationTest method setup.

@Before
@Override
public void setup() throws Exception {
    super.setup();
    AssetManager assetManager = CoreRegistry.get(AssetManager.class);
    regenRules = new SunlightRegenPropagationRules();
    blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager, true);
    biomeManager = Mockito.mock(BiomeManager.class);
    CoreRegistry.put(BlockManager.class, blockManager);
    BlockFamilyDefinitionData solidData = new BlockFamilyDefinitionData();
    solidData.getBaseSection().setDisplayName("Stone");
    solidData.getBaseSection().setShape(assetManager.getAsset("engine:cube", BlockShape.class).get());
    solidData.getBaseSection().setTranslucent(false);
    solidData.setFamilyFactory(new SymmetricBlockFamilyFactory());
    assetManager.loadAsset(new ResourceUrn("engine:stone"), solidData, BlockFamilyDefinition.class);
    solid = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:stone")));
    regenWorldView = new SunlightRegenWorldView(provider);
    lightWorldView = new SunlightWorldView(provider);
    lightRules = new SunlightPropagationRules(regenWorldView);
    sunlightPropagator = new StandardBatchPropagator(lightRules, lightWorldView);
    propagator = new SunlightRegenBatchPropagator(regenRules, regenWorldView, sunlightPropagator, lightWorldView);
}
Also used : BiomeManager(org.terasology.world.biomes.BiomeManager) BlockUri(org.terasology.world.block.BlockUri) AssetManager(org.terasology.assets.management.AssetManager) SunlightRegenWorldView(org.terasology.world.propagation.light.SunlightRegenWorldView) SunlightPropagationRules(org.terasology.world.propagation.light.SunlightPropagationRules) SunlightWorldView(org.terasology.world.propagation.light.SunlightWorldView) BlockFamilyDefinitionData(org.terasology.world.block.loader.BlockFamilyDefinitionData) NullWorldAtlas(org.terasology.world.block.tiles.NullWorldAtlas) ResourceUrn(org.terasology.assets.ResourceUrn) SunlightRegenPropagationRules(org.terasology.world.propagation.light.SunlightRegenPropagationRules) SymmetricBlockFamilyFactory(org.terasology.world.block.family.SymmetricBlockFamilyFactory) BlockManagerImpl(org.terasology.world.block.internal.BlockManagerImpl) Before(org.junit.Before)

Example 8 with BiomeManager

use of org.terasology.world.biomes.BiomeManager in project Terasology by MovingBlocks.

the class ChunkTest method setup.

@Before
public void setup() throws Exception {
    super.setup();
    AssetManager assetManager = CoreRegistry.get(AssetManager.class);
    blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager);
    CoreRegistry.put(BlockManager.class, blockManager);
    BiomeManager biomeManager = Mockito.mock(BiomeManager.class);
    chunk = new ChunkImpl(new Vector3i(0, 0, 0), blockManager, biomeManager);
    BlockFamilyDefinitionData solidData = new BlockFamilyDefinitionData();
    solidData.getBaseSection().setDisplayName("Stone");
    solidData.getBaseSection().setShape(assetManager.getAsset("engine:cube", BlockShape.class).get());
    solidData.getBaseSection().setTranslucent(false);
    solidData.setFamilyFactory(new SymmetricBlockFamilyFactory());
    assetManager.loadAsset(new ResourceUrn("engine:stone"), solidData, BlockFamilyDefinition.class);
    solid = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:stone")));
}
Also used : BiomeManager(org.terasology.world.biomes.BiomeManager) BlockUri(org.terasology.world.block.BlockUri) AssetManager(org.terasology.assets.management.AssetManager) BlockFamilyDefinitionData(org.terasology.world.block.loader.BlockFamilyDefinitionData) ChunkImpl(org.terasology.world.chunks.internal.ChunkImpl) Vector3i(org.terasology.math.geom.Vector3i) NullWorldAtlas(org.terasology.world.block.tiles.NullWorldAtlas) ResourceUrn(org.terasology.assets.ResourceUrn) SymmetricBlockFamilyFactory(org.terasology.world.block.family.SymmetricBlockFamilyFactory) BlockManagerImpl(org.terasology.world.block.internal.BlockManagerImpl) Before(org.junit.Before)

Example 9 with BiomeManager

use of org.terasology.world.biomes.BiomeManager in project Terasology by MovingBlocks.

the class ChunkViewTest method setup.

@Before
public void setup() throws IOException {
    AssetManager assetManager = CoreRegistry.get(AssetManager.class);
    blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager);
    CoreRegistry.put(BlockManager.class, blockManager);
    airBlock = blockManager.getBlock(BlockManager.AIR_ID);
    biomeManager = Mockito.mock(BiomeManager.class);
    BlockFamilyDefinitionData solidData = new BlockFamilyDefinitionData();
    solidData.getBaseSection().setDisplayName("Stone");
    solidData.getBaseSection().setShape(assetManager.getAsset("engine:cube", BlockShape.class).get());
    solidData.getBaseSection().setTranslucent(false);
    solidData.setFamilyFactory(new SymmetricBlockFamilyFactory());
    assetManager.loadAsset(new ResourceUrn("engine:stone"), solidData, BlockFamilyDefinition.class);
    solidBlock = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:stone")));
}
Also used : BiomeManager(org.terasology.world.biomes.BiomeManager) BlockUri(org.terasology.world.block.BlockUri) AssetManager(org.terasology.assets.management.AssetManager) BlockFamilyDefinitionData(org.terasology.world.block.loader.BlockFamilyDefinitionData) NullWorldAtlas(org.terasology.world.block.tiles.NullWorldAtlas) ResourceUrn(org.terasology.assets.ResourceUrn) SymmetricBlockFamilyFactory(org.terasology.world.block.family.SymmetricBlockFamilyFactory) BlockManagerImpl(org.terasology.world.block.internal.BlockManagerImpl) Before(org.junit.Before)

Example 10 with BiomeManager

use of org.terasology.world.biomes.BiomeManager in project Terasology by MovingBlocks.

the class HeadlessEnvironment method setupStorageManager.

@Override
protected void setupStorageManager() throws IOException {
    ModuleManager moduleManager = context.get(ModuleManager.class);
    EngineEntityManager engineEntityManager = context.get(EngineEntityManager.class);
    BlockManager blockManager = context.get(BlockManager.class);
    BiomeManager biomeManager = context.get(BiomeManager.class);
    Path savePath = PathManager.getInstance().getSavePath("world1");
    context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(), engineEntityManager, blockManager, biomeManager));
}
Also used : EngineEntityManager(org.terasology.entitySystem.entity.internal.EngineEntityManager) BiomeManager(org.terasology.world.biomes.BiomeManager) Path(java.nio.file.Path) BlockManager(org.terasology.world.block.BlockManager) ReadWriteStorageManager(org.terasology.persistence.internal.ReadWriteStorageManager) ModuleManager(org.terasology.engine.module.ModuleManager)

Aggregations

BiomeManager (org.terasology.world.biomes.BiomeManager)11 Before (org.junit.Before)7 BlockManager (org.terasology.world.block.BlockManager)6 ResourceUrn (org.terasology.assets.ResourceUrn)5 AssetManager (org.terasology.assets.management.AssetManager)5 ModuleManager (org.terasology.engine.module.ModuleManager)4 EngineEntityManager (org.terasology.entitySystem.entity.internal.EngineEntityManager)4 BlockUri (org.terasology.world.block.BlockUri)4 SymmetricBlockFamilyFactory (org.terasology.world.block.family.SymmetricBlockFamilyFactory)4 BlockManagerImpl (org.terasology.world.block.internal.BlockManagerImpl)4 BlockFamilyDefinitionData (org.terasology.world.block.loader.BlockFamilyDefinitionData)4 NullWorldAtlas (org.terasology.world.block.tiles.NullWorldAtlas)4 Path (java.nio.file.Path)3 ModuleEnvironment (org.terasology.module.ModuleEnvironment)3 ReadWriteStorageManager (org.terasology.persistence.internal.ReadWriteStorageManager)3 WorldProvider (org.terasology.world.WorldProvider)3 ComponentSystemManager (org.terasology.engine.ComponentSystemManager)2 Game (org.terasology.game.Game)2 NetworkSystem (org.terasology.network.NetworkSystem)2 Block (org.terasology.world.block.Block)2