mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Merge branch 'master' of https://github.com/Vazkii/Botania
This commit is contained in:
commit
185ca19c9b
5 files changed
+34
-1
No files matched your search
@@ -40,6 +40,9 @@ public final class LexiconRecipeMappings {
|
||||
map(stack, entry, page, false);
|
||||
}
|
||||
|
||||
public static void remove(ItemStack stack) {
|
||||
mappings.remove(stackToString(stack));
|
||||
}
|
||||
|
||||
public static EntryData getDataForStack(ItemStack stack) {
|
||||
return mappings.get(stackToString(stack));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Botania", apiVersion = "29", provides = "BotaniaAPI")
|
||||
@API(owner = "Botania", apiVersion = "30", provides = "BotaniaAPI")
|
||||
package vazkii.botania.api;
|
||||
import cpw.mods.fml.common.API;
|
||||
|
||||
@@ -309,4 +309,18 @@ public class GuiLexicon extends GuiScreen {
|
||||
super.keyTyped(par1, par2);
|
||||
}
|
||||
|
||||
public static boolean isValidLexiconGui(GuiLexicon gui) {
|
||||
if(gui.isCategoryIndex())
|
||||
return true;
|
||||
if(gui.isIndex()) {
|
||||
GuiLexiconIndex indexGui=(GuiLexiconIndex)gui;
|
||||
if(indexGui.category==null)
|
||||
return true;
|
||||
return BotaniaAPI.getAllCategories().contains(indexGui.category);
|
||||
}
|
||||
GuiLexiconEntry entryGui=(GuiLexiconEntry)gui;
|
||||
if(!BotaniaAPI.getAllEntries().contains(entryGui.entry))
|
||||
return false;
|
||||
return entryGui.page < entryGui.entry.pages.size();
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,15 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
|
||||
buttonList.add(rightButton = new GuiButtonPage(2, left + guiWidth - 18, top + guiHeight - 10, true));
|
||||
buttonList.add(shareButton = new GuiButtonShare(3, left + guiWidth - 6, top - 2));
|
||||
|
||||
if(!GuiLexicon.isValidLexiconGui(this)) {
|
||||
currentOpenLexicon = new GuiLexicon();
|
||||
mc.displayGuiScreen(currentOpenLexicon);
|
||||
ClientTickHandler.notifyPageChange();
|
||||
return;
|
||||
}
|
||||
|
||||
LexiconPage page = entry.pages.get(this.page);
|
||||
|
||||
page.onOpened(this);
|
||||
updatePageButtons();
|
||||
}
|
||||
|
||||
@@ -73,6 +73,14 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
if(!GuiLexicon.isValidLexiconGui(this)) {
|
||||
currentOpenLexicon = new GuiLexicon();
|
||||
mc.displayGuiScreen(currentOpenLexicon);
|
||||
ClientTickHandler.notifyPageChange();
|
||||
return;
|
||||
}
|
||||
|
||||
buttonList.add(backButton = new GuiButtonBack(12, left + guiWidth / 2 - 8, top + guiHeight + 2));
|
||||
buttonList.add(leftButton = new GuiButtonPage(13, left, top + guiHeight - 10, false));
|
||||
buttonList.add(rightButton = new GuiButtonPage(14, left + guiWidth - 18, top + guiHeight - 10, true));
|
||||
|
||||
Reference in new issue
Block a user