public void displayGui(IInteractionObject guiOwner) { String s = guiOwner.getGuiID(); if ("minecraft:crafting_table".equals(s)) { this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj)); } else if ("minecraft:enchanting_table".equals(s)) { this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, guiOwner)); } else if ("minecraft:anvil".equals(s)) { this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj)); } }
public void displayGui(IInteractionObject guiOwner) { String s = guiOwner.getGuiID(); if ("minecraft:crafting_table".equals(s)) { this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.world)); } else if ("minecraft:enchanting_table".equals(s)) { this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.world, guiOwner)); } else if ("minecraft:anvil".equals(s)) { this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.world)); } }
@Override public void onTick() { if (this.repairGuiTask==null||!(this.repairGuiTask instanceof GuiRepair)) return; final EntryId entryId = CurrentMode.instance.getEntryId(); if (!entryId.isNameable()) return; try { final GuiTextField textField = guiRepairTextField.get(this.repairGuiTask); final ContainerRepair containerRepair = guiRepairContainer.get(this.repairGuiTask); if (textField!=null&&containerRepair!=null) { final String text = textField.getText(); if (!StringUtils.isEmpty(text)&&!StringUtils.equals(this.repairGuiTextFieldCache, text)) { final String name = entryId.id(); Sign.setRepairName(name, textField, containerRepair); this.repairGuiTextFieldCache = name; } } return; } catch (final Exception e) { Log.notice(I18n.format("signpic.chat.error.place")); } Log.notice(I18n.format("signpic.chat.error.place")); }
@Override public void onDraw(final @Nullable GuiScreen gui) { if (gui instanceof GuiRepair&&this.repairGuiTask!=null) { final int xSize = 176; final int ySize = 166; final int guiLeft = (gui.width-xSize)/2; final int guiTop = (gui.height-ySize)/2; OpenGL.glColor4f(1f, 1f, 1f, 1f); WRenderer.startTexture(); WRenderer.texture().bindTexture(MPanel.background); final Area a = Area.abs(guiLeft-42, guiTop, guiLeft, guiTop+49); MPanel.drawBack(a); WRenderer.texture().bindTexture(SignPicLabel.defaultTexture); WGui.drawTexture(Area.size(guiLeft-42, guiTop+3, 42, 42), null, null); if (CurrentMode.instance.isShortening()) { final Area b = Area.abs(guiLeft, guiTop-20, gui.width-guiLeft, guiTop); OpenGL.glColor4f(1f, 1f, 1f, this.o.get()); WGui.drawString(I18n.format("signpic.gui.notice.shortening"), b, WGui.Align.CENTER, WGui.VerticalAlign.MIDDLE, true); } } }
public GuiAnvil(EntityPlayer player, World world, int x, int y, int z) { super(player.inventory, world, x, y, z); ContainerAnvil container = new ContainerAnvil(player, world, x, y, z); ReflectionHelper.setPrivateValue(GuiRepair.class, this, container, "field_147092_v"); inventorySlots = container; }
@Override public boolean onOpen(final @Nullable GuiScreen gui, final @Nonnull EntryId currentId) { if (gui instanceof GuiRepair) { this.repairGuiTask = (GuiRepair) gui; return true; } return false; }
@SideOnly(Side.CLIENT) @SubscribeEvent public void onButtonPress(ActionPerformedEvent.Pre e) { if (e.gui instanceof GuiRepair) { final GuiRepair repair = (GuiRepair)e.gui; switch(e.button.id) { //TODO // default: break; } } }
@SideOnly(Side.CLIENT) @SubscribeEvent public void addButtons(InitGuiEvent.Post e) { if (e.gui instanceof GuiRepair) { final List<GuiButton> list = new ArrayList<GuiButton>(); //TODO Add buttons. e.buttonList.addAll(list); } }
/** * Displays the GUI for interacting with an anvil. */ public void displayGUIAnvil(int par1, int par2, int par3) { this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, par1, par2, par3)); }
public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) { this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_)); }
public void func_82244_d(int p_82244_1_, int p_82244_2_, int p_82244_3_) { this.field_71159_c.func_71373_a(new GuiRepair(this.field_71071_by, this.field_70170_p, p_82244_1_, p_82244_2_, p_82244_3_)); }