use of org.terasology.gestalt.assets.ResourceUrn in project Terasology by MovingBlocks.
the class ComponentMetadataTest method testStaticFieldsIgnored.
@Test
public void testStaticFieldsIgnored() {
Reflections reflections = new Reflections(getClass().getClassLoader());
EntitySystemLibrary entitySystemLibrary = new EntitySystemLibrary(context, new TypeHandlerLibraryImpl(reflections));
ComponentLibrary lib = entitySystemLibrary.getComponentLibrary();
lib.register(new ResourceUrn("unittest:string"), StringComponent.class);
ComponentMetadata<StringComponent> metadata = lib.getMetadata(StringComponent.class);
assertNull(metadata.getField("STATIC_VALUE"));
}
use of org.terasology.gestalt.assets.ResourceUrn 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.gestalt.assets.ResourceUrn 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.gestalt.assets.ResourceUrn in project Terasology by MovingBlocks.
the class EntityAwareWorldProviderTest method createPrefabWithString.
private Prefab createPrefabWithString(String urn, String text, AssetManager assetManager) {
PrefabData prefabData = new PrefabData();
prefabData.addComponent(new StringComponent(text));
return assetManager.loadAsset(new ResourceUrn(urn), prefabData, Prefab.class);
}
use of org.terasology.gestalt.assets.ResourceUrn 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