use of org.terasology.engine.world.propagation.light.SunlightRegenPropagationRules 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);
}
use of org.terasology.engine.world.propagation.light.SunlightRegenPropagationRules in project Terasology by MovingBlocks.
the class BulkSunlightPropagationTest method setup.
@BeforeEach
public void setup() throws Exception {
super.setup();
regenRules = new SunlightRegenPropagationRules();
AssetManager assetManager = CoreRegistry.get(AssetManager.class);
blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager, true);
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.setBlockFamily(SymmetricFamily.class);
assetManager.loadAsset(new ResourceUrn("engine:stone"), solidData, BlockFamilyDefinition.class);
solid = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:stone")));
air = blockManager.getBlock(BlockManager.AIR_ID);
Map<Vector3ic, Block> blockData = Maps.newHashMap();
regenWorldView = new StubPropagatorWorldView(Chunks.CHUNK_REGION, air, blockData);
lightWorldView = new StubPropagatorWorldView(Chunks.CHUNK_REGION, air, blockData);
lightRules = new SunlightPropagationRules(regenWorldView);
sunlightPropagator = new StandardBatchPropagator(lightRules, lightWorldView);
propagator = new SunlightRegenBatchPropagator(regenRules, regenWorldView, sunlightPropagator, lightWorldView);
}
Aggregations