create MaterialSet$Singleton class

This commit is contained in:
dfsek
2021-12-30 16:35:51 -07:00
parent 121dd16652
commit c6f42da61b
2 changed files with 117 additions and 3 deletions

View File

@@ -36,6 +36,11 @@ public class MaterialSetLoader implements TypeLoader<MaterialSet> {
@Override
public MaterialSet load(@NotNull AnnotatedType type, @NotNull Object o, @NotNull ConfigLoader configLoader, DepthTracker depthTracker) throws LoadException {
List<String> stringData = (List<String>) o;
if(stringData.size() == 1) {
return MaterialSet.singleton(configLoader.loadType(BlockType.class, stringData.get(0), depthTracker));
}
MaterialSet set = new MaterialSet();
for(String string : stringData) {