Example #1
0
        /// <summary>
        /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
        /// </summary>
        protected override void ActionPerformed(GuiButton par1GuiButton)
        {
            if (!par1GuiButton.Enabled)
            {
                return;
            }

            if (par1GuiButton.Id == 0)
            {
                EntitySign.OnInventoryChanged();
                Mc.DisplayGuiScreen(null);
            }
        }
        /// <summary>
        /// Updates Client side signs
        /// </summary>
        public override void HandleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign)
        {
            if (Mc.TheWorld.BlockExists(par1Packet130UpdateSign.XPosition, par1Packet130UpdateSign.YPosition, par1Packet130UpdateSign.ZPosition))
            {
                TileEntity tileentity = Mc.TheWorld.GetBlockTileEntity(par1Packet130UpdateSign.XPosition, par1Packet130UpdateSign.YPosition, par1Packet130UpdateSign.ZPosition);

                if (tileentity is TileEntitySign)
                {
                    TileEntitySign tileentitysign = (TileEntitySign)tileentity;

                    if (tileentitysign.Func_50007_a())
                    {
                        for (int i = 0; i < 4; i++)
                        {
                            tileentitysign.SignText[i] = par1Packet130UpdateSign.SignLines[i];
                        }

                        tileentitysign.OnInventoryChanged();
                    }
                }
            }
        }