mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Fixed a stupid NP that crashed the BTM server.
*Hangs himself in shame now*
This commit is contained in:
parent
62aa68560c
commit
11c78bf455
1 changed files with 11 additions and 9 deletions
|
@ -38,17 +38,19 @@ public class EntrySet{
|
|||
}
|
||||
|
||||
public static EntrySet readFromNBT(NBTTagCompound compound){
|
||||
if(compound.hasKey("Entry")){
|
||||
int entry = compound.getInteger("Entry");
|
||||
int chapter = compound.getInteger("Chapter");
|
||||
int page = compound.getInteger("Page");
|
||||
if(compound != null){
|
||||
if(compound.hasKey("Entry")){
|
||||
int entry = compound.getInteger("Entry");
|
||||
int chapter = compound.getInteger("Chapter");
|
||||
int page = compound.getInteger("Page");
|
||||
|
||||
BookletEntry currentEntry = entry == -1 ? null : InitBooklet.entries.get(entry);
|
||||
BookletChapter currentChapter = chapter == -1 || entry == -1 || currentEntry.chapters.size() <= chapter ? null : currentEntry.chapters.get(chapter);
|
||||
BookletPage currentPage = chapter == -1 || currentChapter == null || currentChapter.pages.length <= page-1 ? null : currentChapter.pages[page-1];
|
||||
int pageInIndex = compound.getInteger("PageInIndex");
|
||||
BookletEntry currentEntry = entry == -1 ? null : InitBooklet.entries.get(entry);
|
||||
BookletChapter currentChapter = chapter == -1 || entry == -1 || currentEntry.chapters.size() <= chapter ? null : currentEntry.chapters.get(chapter);
|
||||
BookletPage currentPage = chapter == -1 || currentChapter == null || currentChapter.pages.length <= page-1 ? null : currentChapter.pages[page-1];
|
||||
int pageInIndex = compound.getInteger("PageInIndex");
|
||||
|
||||
return new EntrySet(currentPage, currentChapter, currentEntry, pageInIndex);
|
||||
return new EntrySet(currentPage, currentChapter, currentEntry, pageInIndex);
|
||||
}
|
||||
}
|
||||
return new EntrySet(null);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue