/** Adds the buttons (and other controls) to the screen in question. */ public void initGui() { if (this.mc.playerController.isInCreativeMode()) { super.initGui(); this.controlList.clear(); Keyboard.enableRepeatEvents(true); this.searchField = new GuiTextField( this.fontRenderer, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRenderer.FONT_HEIGHT); this.searchField.setMaxStringLength(15); this.searchField.setEnableBackgroundDrawing(false); this.searchField.setVisible(false); this.searchField.setTextColor(16777215); int var1 = selectedTabIndex; selectedTabIndex = -1; this.func_74227_b(CreativeTabs.creativeTabArray[var1]); this.field_82324_x = new CreativeCrafting(this.mc); this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); int tabCount = CreativeTabs.creativeTabArray.length; if (tabCount > 12) { controlList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<")); controlList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">")); tabPage = 0; maxPages = ((tabCount - 12) / 10) + 1; } } else { this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); } }
/** Adds the buttons (and other controls) to the screen in question. */ public void initGui() { if (this.mc.playerController.isInCreativeMode()) { super.initGui(); this.controlList.clear(); Keyboard.enableRepeatEvents(true); this.searchField = new GuiTextField( this.fontRenderer, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRenderer.FONT_HEIGHT); this.searchField.setMaxStringLength(15); this.searchField.setEnableBackgroundDrawing(false); this.searchField.setVisible(false); this.searchField.setTextColor(16777215); int var1 = selectedTabIndex; selectedTabIndex = -1; this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]); this.field_82324_x = new CreativeCrafting(this.mc); this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); } else { this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); } }