This is way better naming

This commit is contained in:
Ellpeck 2015-11-27 15:22:44 +01:00
parent 25401df669
commit 117fc49a15
12 changed files with 62 additions and 62 deletions

View file

@ -12,7 +12,7 @@ package ellpeck.actuallyadditions.event;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues; import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.nei.NeiScreenEvents; import ellpeck.actuallyadditions.nei.NEIScreenEvents;
import ellpeck.actuallyadditions.update.UpdateCheckerClientNotificationEvent; import ellpeck.actuallyadditions.update.UpdateCheckerClientNotificationEvent;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
@ -36,7 +36,7 @@ public class InitEvents{
Util.registerEvent(new TooltipEvent()); Util.registerEvent(new TooltipEvent());
if(Loader.isModLoaded("NotEnoughItems")){ if(Loader.isModLoaded("NotEnoughItems")){
Util.registerEvent(new NeiScreenEvents()); Util.registerEvent(new NEIScreenEvents());
} }
if(ConfigBoolValues.DO_UPDATE_CHECK.isEnabled()){ if(ConfigBoolValues.DO_UPDATE_CHECK.isEnabled()){

View file

@ -12,7 +12,7 @@ package ellpeck.actuallyadditions.nei;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public interface INeiRecipeHandler{ public interface INEIRecipeHandler{
ItemStack getStackForInfo(int page); ItemStack getStackForInfo(int page);
} }

View file

@ -28,41 +28,41 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{
API.registerGuiOverlay(GuiCrafter.class, "crafting"); API.registerGuiOverlay(GuiCrafter.class, "crafting");
API.registerGuiOverlayHandler(GuiCrafter.class, new DefaultOverlayHandler(), "crafting"); API.registerGuiOverlayHandler(GuiCrafter.class, new DefaultOverlayHandler(), "crafting");
CrusherRecipeHandler crusherRecipeHandler = new CrusherRecipeHandler(); NEICrusherRecipe crusherRecipe = new NEICrusherRecipe();
API.registerRecipeHandler(crusherRecipeHandler); API.registerRecipeHandler(crusherRecipe);
API.registerUsageHandler(crusherRecipeHandler); API.registerUsageHandler(crusherRecipe);
CrusherRecipeHandler.CrusherDoubleRecipeHandler crusherDoubleRecipeHandler = new CrusherRecipeHandler.CrusherDoubleRecipeHandler(); NEICrusherRecipe.Double crusherDoubleRecipe = new NEICrusherRecipe.Double();
API.registerRecipeHandler(crusherDoubleRecipeHandler); API.registerRecipeHandler(crusherDoubleRecipe);
API.registerUsageHandler(crusherDoubleRecipeHandler); API.registerUsageHandler(crusherDoubleRecipe);
FurnaceDoubleRecipeHandler furnaceDoubleRecipeHandler = new FurnaceDoubleRecipeHandler(); NEIFurnaceDoubleRecipe furnaceDoubleRecipe = new NEIFurnaceDoubleRecipe();
API.registerRecipeHandler(furnaceDoubleRecipeHandler); API.registerRecipeHandler(furnaceDoubleRecipe);
API.registerUsageHandler(furnaceDoubleRecipeHandler); API.registerUsageHandler(furnaceDoubleRecipe);
HairyBallRecipeHandler ballRecipeHandler = new HairyBallRecipeHandler(); NEIHairyBallRecipe ballRecipe = new NEIHairyBallRecipe();
API.registerRecipeHandler(ballRecipeHandler); API.registerRecipeHandler(ballRecipe);
API.registerUsageHandler(ballRecipeHandler); API.registerUsageHandler(ballRecipe);
TreasureChestRecipeHandler treasureRecipeHandler = new TreasureChestRecipeHandler(); NEITreasureChestRecipe treasureChestRecipe = new NEITreasureChestRecipe();
API.registerRecipeHandler(treasureRecipeHandler); API.registerRecipeHandler(treasureChestRecipe);
API.registerUsageHandler(treasureRecipeHandler); API.registerUsageHandler(treasureChestRecipe);
CompostRecipeHandler compostRecipeHandler = new CompostRecipeHandler(); NEICompostRecipe compostRecipe = new NEICompostRecipe();
API.registerRecipeHandler(compostRecipeHandler); API.registerRecipeHandler(compostRecipe);
API.registerUsageHandler(compostRecipeHandler); API.registerUsageHandler(compostRecipe);
CoffeeMachineRecipeHandler coffeeMachineRecipeHandler = new CoffeeMachineRecipeHandler(); NEICoffeeMachineRecipe coffeeMachineRecipe = new NEICoffeeMachineRecipe();
API.registerRecipeHandler(coffeeMachineRecipeHandler); API.registerRecipeHandler(coffeeMachineRecipe);
API.registerUsageHandler(coffeeMachineRecipeHandler); API.registerUsageHandler(coffeeMachineRecipe);
AtomicReconstructorRecipeHandler atomicReconstructorRecipeHandler = new AtomicReconstructorRecipeHandler(); NEIReconstructorRecipe reconstructorRecipe = new NEIReconstructorRecipe();
API.registerRecipeHandler(atomicReconstructorRecipeHandler); API.registerRecipeHandler(reconstructorRecipe);
API.registerUsageHandler(atomicReconstructorRecipeHandler); API.registerUsageHandler(reconstructorRecipe);
BookletInfoRecipeHandler bookletInfoRecipeHandler = new BookletInfoRecipeHandler(); NEIBookletRecipe bookletRecipe = new NEIBookletRecipe();
API.registerRecipeHandler(bookletInfoRecipeHandler); API.registerRecipeHandler(bookletRecipe);
API.registerUsageHandler(bookletInfoRecipeHandler); API.registerUsageHandler(bookletRecipe);
API.hideItem(new ItemStack(InitBlocks.blockRice)); API.hideItem(new ItemStack(InitBlocks.blockRice));
API.hideItem(new ItemStack(InitBlocks.blockCanola)); API.hideItem(new ItemStack(InitBlocks.blockCanola));

View file

@ -30,11 +30,11 @@ import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.List; import java.util.List;
public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.booklet"; public static final String NAME = "actuallyadditions.booklet";
public BookletInfoRecipeHandler(){ public NEIBookletRecipe(){
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -51,7 +51,7 @@ public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements I
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == BookletInfoRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEIBookletRecipe.class){
for(BookletPage page : InitBooklet.pagesWithItemStackData){ for(BookletPage page : InitBooklet.pagesWithItemStackData){
for(ItemStack stack : page.getItemStacksForPage()){ for(ItemStack stack : page.getItemStacksForPage()){
arecipes.add(new CachedInfoStack(stack)); arecipes.add(new CachedInfoStack(stack));

View file

@ -32,11 +32,11 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEICoffeeMachineRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.coffee"; public static final String NAME = "actuallyadditions.coffee";
public CoffeeMachineRecipeHandler(){ public NEICoffeeMachineRecipe(){
super(); super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3); RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3);
} }
@ -54,7 +54,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler implements
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == CoffeeMachineRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEICoffeeMachineRecipe.class){
ArrayList<ItemCoffee.Ingredient> ingredients = ItemCoffee.ingredients; ArrayList<ItemCoffee.Ingredient> ingredients = ItemCoffee.ingredients;
for(ItemCoffee.Ingredient ingredient : ingredients){ for(ItemCoffee.Ingredient ingredient : ingredients){
arecipes.add(new CachedCoffee(ingredient)); arecipes.add(new CachedCoffee(ingredient));

View file

@ -28,11 +28,11 @@ import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.Collections; import java.util.Collections;
public class CompostRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEICompostRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.compost"; public static final String NAME = "actuallyadditions.compost";
public CompostRecipeHandler(){ public NEICompostRecipe(){
super(); super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -54,7 +54,7 @@ public class CompostRecipeHandler extends TemplateRecipeHandler implements INeiR
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == CompostRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEICompostRecipe.class){
arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, ConfigIntValues.COMPOST_AMOUNT.getValue()))); arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, ConfigIntValues.COMPOST_AMOUNT.getValue(), TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, ConfigIntValues.COMPOST_AMOUNT.getValue())));
} }
else{ else{

View file

@ -29,9 +29,9 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEICrusherRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public CrusherRecipeHandler(){ public NEICrusherRecipe(){
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -47,7 +47,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(this.getName()) && (getClass() == CrusherRecipeHandler.class || getClass() == CrusherDoubleRecipeHandler.class)){ if(outputId.equals(this.getName()) && (getClass() == NEICrusherRecipe.class || getClass() == Double.class)){
for(CrusherRecipeRegistry.CrusherRecipe recipe : CrusherRecipeRegistry.recipes){ for(CrusherRecipeRegistry.CrusherRecipe recipe : CrusherRecipeRegistry.recipes){
arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this)); arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this));
} }
@ -120,7 +120,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
} }
protected String getName(){ protected String getName(){
return "actuallyadditions."+(this instanceof CrusherDoubleRecipeHandler ? "crushingDouble" : "crushing"); return "actuallyadditions."+(this instanceof Double ? "crushingDouble" : "crushing");
} }
@Override @Override
@ -128,7 +128,7 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
return StringUtil.localize("container.nei."+this.getName()+".name"); return StringUtil.localize("container.nei."+this.getName()+".name");
} }
public static class CrusherDoubleRecipeHandler extends CrusherRecipeHandler{ public static class Double extends NEICrusherRecipe{
@Override @Override
public ItemStack getStackForInfo(int page){ public ItemStack getStackForInfo(int page){
@ -172,8 +172,8 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler implements INeiR
public PositionedStack resultTwo; public PositionedStack resultTwo;
public int secondChance; public int secondChance;
public CachedCrush(List<ItemStack> in, List<ItemStack> outOne, List<ItemStack> outTwo, int secondChance, CrusherRecipeHandler handler){ public CachedCrush(List<ItemStack> in, List<ItemStack> outOne, List<ItemStack> outTwo, int secondChance, NEICrusherRecipe handler){
boolean isDouble = handler instanceof CrusherDoubleRecipeHandler; boolean isDouble = handler instanceof Double;
this.ingredient = new PositionedStack(in, isDouble ? 51 : 80, 21); this.ingredient = new PositionedStack(in, isDouble ? 51 : 80, 21);
this.resultOne = new PositionedStack(outOne, isDouble ? 38 : 66, 69); this.resultOne = new PositionedStack(outOne, isDouble ? 38 : 66, 69);
if(outTwo != null && !outTwo.isEmpty()){ if(outTwo != null && !outTwo.isEmpty()){

View file

@ -29,11 +29,11 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class FurnaceDoubleRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.furnaceDouble"; public static final String NAME = "actuallyadditions.furnaceDouble";
public FurnaceDoubleRecipeHandler(){ public NEIFurnaceDoubleRecipe(){
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -51,7 +51,7 @@ public class FurnaceDoubleRecipeHandler extends TemplateRecipeHandler implements
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == FurnaceDoubleRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){
Map<ItemStack, ItemStack> recipes = (Map<ItemStack, ItemStack>)FurnaceRecipes.smelting().getSmeltingList(); Map<ItemStack, ItemStack> recipes = (Map<ItemStack, ItemStack>)FurnaceRecipes.smelting().getSmeltingList();
for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){ for(Map.Entry<ItemStack, ItemStack> recipe : recipes.entrySet()){
arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue()));

View file

@ -27,11 +27,11 @@ import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
public class HairyBallRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEIHairyBallRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.ballOfHair"; public static final String NAME = "actuallyadditions.ballOfHair";
public HairyBallRecipeHandler(){ public NEIHairyBallRecipe(){
super(); super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -53,7 +53,7 @@ public class HairyBallRecipeHandler extends TemplateRecipeHandler implements INe
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == HairyBallRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEIHairyBallRecipe.class){
ArrayList<HairyBallHandler.Return> recipes = HairyBallHandler.returns; ArrayList<HairyBallHandler.Return> recipes = HairyBallHandler.returns;
for(HairyBallHandler.Return recipe : recipes){ for(HairyBallHandler.Return recipe : recipes){
arecipes.add(new CachedBallRecipe(recipe.inputItem, recipe.returnItem, recipe.itemWeight)); arecipes.add(new CachedBallRecipe(recipe.inputItem, recipe.returnItem, recipe.itemWeight));

View file

@ -31,11 +31,11 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.reconstructor"; public static final String NAME = "actuallyadditions.reconstructor";
public AtomicReconstructorRecipeHandler(){ public NEIReconstructorRecipe(){
super(); super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -57,7 +57,7 @@ public class AtomicReconstructorRecipeHandler extends TemplateRecipeHandler impl
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == AtomicReconstructorRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEIReconstructorRecipe.class){
ArrayList<ReconstructorRecipeHandler.Recipe> recipes = ReconstructorRecipeHandler.recipes; ArrayList<ReconstructorRecipeHandler.Recipe> recipes = ReconstructorRecipeHandler.recipes;
for(ReconstructorRecipeHandler.Recipe recipe : recipes){ for(ReconstructorRecipeHandler.Recipe recipe : recipes){
arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.lens)); arecipes.add(new CachedReconstructorRecipe(recipe.input, recipe.output, recipe.type.lens));

View file

@ -27,11 +27,11 @@ import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
public class TreasureChestRecipeHandler extends TemplateRecipeHandler implements INeiRecipeHandler{ public class NEITreasureChestRecipe extends TemplateRecipeHandler implements INEIRecipeHandler{
public static final String NAME = "actuallyadditions.treasureChest"; public static final String NAME = "actuallyadditions.treasureChest";
public TreasureChestRecipeHandler(){ public NEITreasureChestRecipe(){
super(); super();
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
} }
@ -53,7 +53,7 @@ public class TreasureChestRecipeHandler extends TemplateRecipeHandler implements
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == TreasureChestRecipeHandler.class){ if(outputId.equals(NAME) && getClass() == NEITreasureChestRecipe.class){
ArrayList<TreasureChestHandler.Return> recipes = TreasureChestHandler.returns; ArrayList<TreasureChestHandler.Return> recipes = TreasureChestHandler.returns;
for(TreasureChestHandler.Return recipe : recipes){ for(TreasureChestHandler.Return recipe : recipes){
arecipes.add(new CachedTreasure(recipe.input, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount)); arecipes.add(new CachedTreasure(recipe.input, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount));

View file

@ -23,7 +23,7 @@ import ellpeck.actuallyadditions.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.client.event.GuiScreenEvent;
public class NeiScreenEvents{ public class NEIScreenEvents{
private static final int NEI_BUTTON_ID = 123782; private static final int NEI_BUTTON_ID = 123782;
private BookletUtils.TexturedButton neiButton; private BookletUtils.TexturedButton neiButton;
@ -52,7 +52,7 @@ public class NeiScreenEvents{
event.buttonList.add(this.neiButton); event.buttonList.add(this.neiButton);
IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype); IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype);
this.neiButton.visible = handler instanceof INeiRecipeHandler && ((INeiRecipeHandler)handler).getStackForInfo(theGui.page) != null; this.neiButton.visible = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getStackForInfo(theGui.page) != null;
} }
} }
@ -62,12 +62,12 @@ public class NeiScreenEvents{
GuiRecipe theGui = (GuiRecipe)event.gui; GuiRecipe theGui = (GuiRecipe)event.gui;
IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype); IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype);
boolean isPage = handler instanceof INeiRecipeHandler && ((INeiRecipeHandler)handler).getStackForInfo(theGui.page) != null; boolean isPage = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getStackForInfo(theGui.page) != null;
this.neiButton.visible = isPage; this.neiButton.visible = isPage;
if(isPage && event.button.id == NEI_BUTTON_ID){ if(isPage && event.button.id == NEI_BUTTON_ID){
for(BookletPage page : InitBooklet.pagesWithItemStackData){ for(BookletPage page : InitBooklet.pagesWithItemStackData){
if(ItemUtil.contains(page.getItemStacksForPage(), ((INeiRecipeHandler)handler).getStackForInfo(theGui.page), true)){ if(ItemUtil.contains(page.getItemStacksForPage(), ((INEIRecipeHandler)handler).getStackForInfo(theGui.page), true)){
GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen, false, true); GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen, false, true);
Minecraft.getMinecraft().displayGuiScreen(book); Minecraft.getMinecraft().displayGuiScreen(book);
BookletUtils.openIndexEntry(book, page.getChapter().entry, InitBooklet.entries.indexOf(page.getChapter().entry)/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); BookletUtils.openIndexEntry(book, page.getChapter().entry, InitBooklet.entries.indexOf(page.getChapter().entry)/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true);