Merge remote-tracking branch 'origin/1.12' into 1.13

This commit is contained in:
alexbegt committed 2019-05-20 12:18:22 -04:00
commit c14d405a75
5 files changed
+47 -2

No files matched your search

@@ -58,7 +58,7 @@ public class SectionData implements IDataItem {
String data = source.resourceToString(pagesInfo);
if(!data.isEmpty()) {
try {
pages = new ArrayList<>(Arrays.asList(BookLoader.GSON.fromJson(data, PageData[].class)));
pages = getPages(data);
} catch(Exception e) {
pages = new ArrayList<>();
PageData pdError = new PageData(true);
@@ -81,6 +81,15 @@ public class SectionData implements IDataItem {
icon.location = source.getResourceLocation(icon.file, true);
}
/**
* Gets a list of pages from the given data
* @param data JSON data
* @return ArrayList of pages for the book
*/
protected ArrayList<PageData> getPages(String data) {
return new ArrayList<>(Arrays.asList(BookLoader.GSON.fromJson(data, PageData[].class)));
}
public void update(@Nullable GuiBook.AdvancementCache advancementCache) {
}