use of slimeknights.tconstruct.fixture.MaterialRegistryFixture in project TinkersConstruct by SlimeKnights.
the class MaterialRegistryExtension method beforeEach.
@Override
public void beforeEach(ExtensionContext context) {
Map<IMaterial, List<IMaterialStats>> materialSetup = MaterialFixture.ALL_MATERIAL_FIXTURES;
Map<MaterialId, IMaterial> materials = materialSetup.keySet().stream().collect(Collectors.toMap(IMaterial::getIdentifier, Function.identity()));
Map<MaterialId, Map<MaterialStatsId, IMaterialStats>> stats = materialSetup.entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey().getIdentifier(), entry -> entry.getValue().stream().collect(Collectors.toMap(IMaterialStats::getIdentifier, Function.identity()))));
Map<MaterialStatsId, IMaterialStats> defaultStats = MaterialStatsFixture.TIC_DEFAULT_STATS.stream().collect(Collectors.toMap(IMaterialStats::getIdentifier, Function.identity()));
// empty map as nothing using the extension uses traits
materialRegistry = new MaterialRegistryFixture(materials, stats, defaultStats, Collections.emptyMap());
MaterialRegistry.INSTANCE = new MaterialRegistry(materialRegistry);
}
Aggregations