mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-18 11:19:20 +00:00
Add safety checks to the book UI when the player is lost (death/dimension change should can cause that)
This commit is contained in:
1 parent
273cca6465
commit
4b42e30be6
2 files changed
+6
No files matched your search
@@ -155,6 +155,9 @@ public class BookLoader implements IResourceManagerReloadListener {
|
||||
}
|
||||
|
||||
public static void updateSavedPage(EntityPlayer player, ItemStack item, String page) {
|
||||
if(player == null) {
|
||||
return;
|
||||
}
|
||||
if(player.getHeldItem(EnumHand.MAIN_HAND) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -570,6 +570,9 @@ public class GuiBook extends GuiScreen implements IProgressMeter {
|
||||
if(loadingAchievements) {
|
||||
return;
|
||||
}
|
||||
if(mc.thePlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
PageData page = this.page == 0 ? book.findPage(0, statisticsManager) : book.findPage((this.page - 1) * 2 + 1, statisticsManager);
|
||||
|
||||
|
||||
Reference in new issue
Block a user