mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-21 12:32:42 +00:00
Merge remote-tracking branch 'origin/1.12' into 1.13
This commit is contained in:
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) {
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user