use of org.terasology.engine.world.block.loader.BlockFamilyDefinitionData in project Terasology by MovingBlocks.
the class ChunkTest method setup.
@BeforeEach
public void setup() throws Exception {
super.setup();
AssetManager assetManager = CoreRegistry.get(AssetManager.class);
blockManager = new BlockManagerImpl(new NullWorldAtlas(), assetManager);
CoreRegistry.put(BlockManager.class, blockManager);
ExtraBlockDataManager extraDataManager = new ExtraBlockDataManager();
chunk = new ChunkImpl(new Vector3i(0, 0, 0), blockManager, extraDataManager);
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")));
}
use of org.terasology.engine.world.block.loader.BlockFamilyDefinitionData in project Terasology by MovingBlocks.
the class EntityAwareWorldProviderTest method createBlock.
private Block createBlock(String urn, AssetManager assetManager, BlockManager blockManager) {
BlockFamilyDefinitionData data = new BlockFamilyDefinitionData();
data.setBlockFamily(SymmetricFamily.class);
assetManager.loadAsset(new ResourceUrn(urn), data, BlockFamilyDefinition.class);
return blockManager.getBlock(urn);
}
use of org.terasology.engine.world.block.loader.BlockFamilyDefinitionData in project Terasology by MovingBlocks.
the class ChunkViewTest method setup.
@BeforeEach
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);
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);
solidBlock = blockManager.getBlock(new BlockUri(new ResourceUrn("engine:stone")));
}
Aggregations