Search in sources :

Example 11 with BlockManagerImpl

use of org.terasology.world.block.internal.BlockManagerImpl 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)

Aggregations

BlockManagerImpl (org.terasology.world.block.internal.BlockManagerImpl)11 NullWorldAtlas (org.terasology.world.block.tiles.NullWorldAtlas)8 Before (org.junit.Before)7 AssetManager (org.terasology.assets.management.AssetManager)7 ResourceUrn (org.terasology.assets.ResourceUrn)6 BlockUri (org.terasology.world.block.BlockUri)6 SymmetricBlockFamilyFactory (org.terasology.world.block.family.SymmetricBlockFamilyFactory)6 BlockFamilyDefinitionData (org.terasology.world.block.loader.BlockFamilyDefinitionData)6 BiomeManager (org.terasology.world.biomes.BiomeManager)4 Vector3i (org.terasology.math.geom.Vector3i)2 TypeSerializationLibrary (org.terasology.persistence.typeHandling.TypeSerializationLibrary)2 BlockFamilyTypeHandler (org.terasology.persistence.typeHandling.extensionTypes.BlockFamilyTypeHandler)2 BlockTypeHandler (org.terasology.persistence.typeHandling.extensionTypes.BlockTypeHandler)2 BlockManager (org.terasology.world.block.BlockManager)2 WorldAtlas (org.terasology.world.block.tiles.WorldAtlas)2 SunlightPropagationRules (org.terasology.world.propagation.light.SunlightPropagationRules)2 SunlightRegenPropagationRules (org.terasology.world.propagation.light.SunlightRegenPropagationRules)2 Config (org.terasology.config.Config)1 NetworkSystem (org.terasology.network.NetworkSystem)1 Block (org.terasology.world.block.Block)1