Search in sources :

Example 1 with SunlightWorldView

use of org.terasology.engine.world.propagation.light.SunlightWorldView in project Terasology by MovingBlocks.

the class BetweenChunkPropagationTest method setup.

@BeforeEach
@Override
public void setup() throws Exception {
    super.setup();
    AssetManager assetManager = CoreRegistry.get(AssetManager.class);
    regenRules = new SunlightRegenPropagationRules();
    blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager, true);
    CoreRegistry.put(BlockManager.class, blockManager);
    extraDataManager = new ExtraBlockDataManager();
    BlockFamilyDefinitionData solidData = new BlockFamilyDefinitionData();
    solidData.getBaseSection().setDisplayName("Stone");
    solidData.getBaseSection().setShape(assetManager.getAsset("engine:cube", BlockShape.class).get());
    solidData.getBaseSection().setTranslucent(false);
    solidData.setBlockFamily(SymmetricFamily.class);
    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 : BlockUri(org.terasology.engine.world.block.BlockUri) AssetManager(org.terasology.gestalt.assets.management.AssetManager) ExtraBlockDataManager(org.terasology.engine.world.chunks.blockdata.ExtraBlockDataManager) SunlightRegenWorldView(org.terasology.engine.world.propagation.light.SunlightRegenWorldView) SunlightPropagationRules(org.terasology.engine.world.propagation.light.SunlightPropagationRules) SunlightWorldView(org.terasology.engine.world.propagation.light.SunlightWorldView) BlockFamilyDefinitionData(org.terasology.engine.world.block.loader.BlockFamilyDefinitionData) NullWorldAtlas(org.terasology.engine.world.block.tiles.NullWorldAtlas) ResourceUrn(org.terasology.gestalt.assets.ResourceUrn) SunlightRegenPropagationRules(org.terasology.engine.world.propagation.light.SunlightRegenPropagationRules) BlockManagerImpl(org.terasology.engine.world.block.internal.BlockManagerImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)1 BlockUri (org.terasology.engine.world.block.BlockUri)1 BlockManagerImpl (org.terasology.engine.world.block.internal.BlockManagerImpl)1 BlockFamilyDefinitionData (org.terasology.engine.world.block.loader.BlockFamilyDefinitionData)1 NullWorldAtlas (org.terasology.engine.world.block.tiles.NullWorldAtlas)1 ExtraBlockDataManager (org.terasology.engine.world.chunks.blockdata.ExtraBlockDataManager)1 SunlightPropagationRules (org.terasology.engine.world.propagation.light.SunlightPropagationRules)1 SunlightRegenPropagationRules (org.terasology.engine.world.propagation.light.SunlightRegenPropagationRules)1 SunlightRegenWorldView (org.terasology.engine.world.propagation.light.SunlightRegenWorldView)1 SunlightWorldView (org.terasology.engine.world.propagation.light.SunlightWorldView)1 ResourceUrn (org.terasology.gestalt.assets.ResourceUrn)1 AssetManager (org.terasology.gestalt.assets.management.AssetManager)1