@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")); }
public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_, this)); if (container == null) { return; } // CraftBukkit end this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); this.openContainer = container; // CraftBukkit - Use container we passed to event this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public ContainerAnvil(EntityPlayer player, World world, int x, int y, int z) { super(player.inventory, world, x, y, z, player); this.player = player; this.x = x; this.y = y; this.z = z; this.world = world; inputSlots = ReflectionHelper.getPrivateValue(ContainerRepair.class, this, "inputSlots", "field_82853_g"); outputSlot = ReflectionHelper.getPrivateValue(ContainerRepair.class, this, "outputSlot", "field_82852_f"); }
public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost) { AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost); if (MinecraftForge.EVENT_BUS.post(e)) return false; if (e.getOutput() == null) return true; outputSlot.setInventorySlotContents(0, e.getOutput()); container.maximumCost = e.getCost(); container.materialCost = e.getMaterialCost(); return false; }
public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost) { AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost); if (MinecraftForge.EVENT_BUS.post(e)) return false; if (e.output == null) return true; outputSlot.func_70299_a(0, e.output); container.field_82854_e = e.cost; container.field_82856_l = e.materialCost; return false; }
public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost) { AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost); if (MinecraftForge.EVENT_BUS.post(e)) return false; if (e.output == null) return true; outputSlot.setInventorySlotContents(0, e.output); container.maximumCost = e.cost; container.stackSizeToBeUsedInRepair = e.materialCost; return false; }
/** * Displays the GUI for interacting with an anvil. */ public void displayGUIAnvil(int par1, int par2, int par3) { this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
private AnvilData getAnvilData(ItemStack a, ItemStack b, String name) { ContainerRepair anvil = getFakeAnvil(); IInventory input = anvil.getSlot(0).inventory; IInventory output = anvil.getSlot(2).inventory; input.setInventorySlotContents(0, a); input.setInventorySlotContents(1, b); anvil.updateItemName(name); return new AnvilData(anvil.maximumCost, output.getStackInSlot(0)); }
public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) { this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); this.openContainer = new ContainerRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_, this); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public void func_82244_d(int p_82244_1_, int p_82244_2_, int p_82244_3_) { this.func_71117_bO(); this.field_71135_a.func_72567_b(new Packet100OpenWindow(this.field_71139_cq, 8, "Repairing", 9, true)); this.field_71070_bA = new ContainerRepair(this.field_71071_by, this.field_70170_p, p_82244_1_, p_82244_2_, p_82244_3_, this); this.field_71070_bA.field_75152_c = this.field_71139_cq; this.field_71070_bA.func_75132_a(this); }
ContainerRepairINNER2(ContainerRepair p_i1799_1_, IInventory p_i1799_2_, int p_i1799_3_, int p_i1799_4_, int p_i1799_5_, World p_i1799_6_, int p_i1799_7_, int p_i1799_8_, int p_i1799_9_) { super(p_i1799_2_, p_i1799_3_, p_i1799_4_, p_i1799_5_); this.field_135068_e = p_i1799_1_; this.field_135071_a = p_i1799_6_; this.field_135069_b = p_i1799_7_; this.field_135070_c = p_i1799_8_; this.field_135067_d = p_i1799_9_; }
public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { if(!p_82870_1_.field_71075_bZ.field_75098_d) { p_82870_1_.func_82242_a(-this.field_135068_e.field_82854_e); } ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(0, (ItemStack)null); if(ContainerRepair.func_82849_b(this.field_135068_e) > 0) { ItemStack var3 = ContainerRepair.func_82851_a(this.field_135068_e).func_70301_a(1); if(var3 != null && var3.field_77994_a > ContainerRepair.func_82849_b(this.field_135068_e)) { var3.field_77994_a -= ContainerRepair.func_82849_b(this.field_135068_e); ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(1, var3); } else { ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(1, (ItemStack)null); } } else { ContainerRepair.func_82851_a(this.field_135068_e).func_70299_a(1, (ItemStack)null); } this.field_135068_e.field_82854_e = 0; if(!p_82870_1_.field_71075_bZ.field_75098_d && !this.field_135071_a.field_72995_K && this.field_135071_a.func_72798_a(this.field_135069_b, this.field_135070_c, this.field_135067_d) == Block.field_82510_ck.field_71990_ca && p_82870_1_.func_70681_au().nextFloat() < 0.12F) { int var6 = this.field_135071_a.func_72805_g(this.field_135069_b, this.field_135070_c, this.field_135067_d); int var4 = var6 & 3; int var5 = var6 >> 2; ++var5; if(var5 > 2) { this.field_135071_a.func_94571_i(this.field_135069_b, this.field_135070_c, this.field_135067_d); this.field_135071_a.func_72926_e(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); } else { this.field_135071_a.func_72921_c(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); this.field_135071_a.func_72926_e(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); } } else if(!this.field_135071_a.field_72995_K) { this.field_135071_a.func_72926_e(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); } }
/** * Displays the GUI for interacting with an anvil. */ public void displayGUIAnvil(int par1, int par2, int par3) { this.incrementWindowID(); this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this); this.openContainer.windowId = this.currentWindowId; this.openContainer.addCraftingToCrafters(this); }
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerRepair(playerInventory, this.world, this.position, playerIn); }
public GuiRepair(InventoryPlayer inventoryIn, World worldIn) { super(new ContainerRepair(inventoryIn, worldIn, Minecraft.getMinecraft().thePlayer)); this.playerInventory = inventoryIn; this.anvil = (ContainerRepair)this.inventorySlots; }
public GuiRepair(InventoryPlayer inventoryIn, World worldIn) { super(new ContainerRepair(inventoryIn, worldIn, Minecraft.getMinecraft().player)); this.playerInventory = inventoryIn; this.anvil = (ContainerRepair)this.inventorySlots; }
public static void setRepairName(final @Nonnull String name, final @Nonnull GuiTextField textField, final @Nonnull ContainerRepair containerRepair) { textField.setText(name); containerRepair.updateItemName(name); sendRepairName(name); }
public GuiRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { super(new ContainerRepair(par1InventoryPlayer, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer)); this.field_147094_x = par1InventoryPlayer; this.field_147092_v = (ContainerRepair)this.field_147002_h; }
private ContainerRepair getFakeAnvil() { FakePlayer player = FakePlayer.get(turtle.getWorld()); player.alignToTurtle(turtle); return new ContainerRepair(player.inventory, turtle.getWorld(), 0, 0, 0, player); }
public GuiRepair(InventoryPlayer p_i1073_1_, World p_i1073_2_, int p_i1073_3_, int p_i1073_4_, int p_i1073_5_) { super(new ContainerRepair(p_i1073_1_, p_i1073_2_, p_i1073_3_, p_i1073_4_, p_i1073_5_, Minecraft.getMinecraft().thePlayer)); this.field_147094_x = p_i1073_1_; this.field_147092_v = (ContainerRepair)this.inventorySlots; }
ContainerRepairINNER1(ContainerRepair p_i1798_1_, String p_i1798_2_, boolean p_i1798_3_, int p_i1798_4_) { super(p_i1798_2_, p_i1798_3_, p_i1798_4_); this.field_135010_a = p_i1798_1_; }
public GuiRepair(InventoryPlayer p_i1073_1_, World p_i1073_2_, int p_i1073_3_, int p_i1073_4_, int p_i1073_5_) { super(new ContainerRepair(p_i1073_1_, p_i1073_2_, p_i1073_3_, p_i1073_4_, p_i1073_5_, Minecraft.func_71410_x().field_71439_g)); this.field_82325_q = p_i1073_1_; this.field_82327_o = (ContainerRepair)this.field_74193_d; }
public GuiRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { super(new ContainerRepair(par1InventoryPlayer, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer)); this.field_82325_q = par1InventoryPlayer; this.repairContainer = (ContainerRepair)this.inventorySlots; }