use of com.lowdragmc.multiblocked.common.gui.component.CreatePartWidget in project Multiblocked by Low-Drag-MC.
the class PartBuilderWidget method updateList.
protected void updateList() {
setNewRenderer(null, "");
files.forEach(containers::waitToRemoved);
files.clear();
File path = new File(Multiblocked.location, "definition/part");
walkFile("Common", new ItemStackTexture(BlueprintTableTileEntity.partDefinition.getStackForm()), path, (jsonElement, file) -> {
PartDefinition definition = Multiblocked.GSON.fromJson(jsonElement, PartDefinition.class);
new PartWidget(this, definition, jsonObject -> {
if (jsonObject != null) {
FileUtility.saveJson(file, jsonObject);
}
});
});
if (Multiblocked.isCreateLoaded()) {
path = new File(path, "create");
walkFile("Create", new ItemStackTexture(AllBlocks.FLYWHEEL.asStack()), path, ((jsonElement, file) -> {
CreatePartDefinition definition = Multiblocked.GSON.fromJson(jsonElement, CreatePartDefinition.class);
new CreatePartWidget(this, definition, jsonObject -> {
if (jsonObject != null) {
FileUtility.saveJson(file, jsonObject);
}
});
}));
}
}
Aggregations