001    package net.minecraft.src;
002    
003    import cpw.mods.fml.common.Side;
004    import cpw.mods.fml.common.asm.SideOnly;
005    
006    @SideOnly(Side.CLIENT)
007    public class ServerData
008    {
009        public String serverName;
010        public String serverIP;
011        public String field_78846_c;
012        public String serverMOTD;
013        public long field_78844_e;
014        public boolean field_78841_f = false;
015        private boolean field_78842_g = true;
016        private boolean acceptsTextures = false;
017    
018        public ServerData(String par1Str, String par2Str)
019        {
020            this.serverName = par1Str;
021            this.serverIP = par2Str;
022        }
023    
024        /**
025         * Returns an NBTTagCompound with the server's name, IP and maybe acceptTextures.
026         */
027        public NBTTagCompound getNBTCompound()
028        {
029            NBTTagCompound var1 = new NBTTagCompound();
030            var1.setString("name", this.serverName);
031            var1.setString("ip", this.serverIP);
032    
033            if (!this.field_78842_g)
034            {
035                var1.setBoolean("acceptTextures", this.acceptsTextures);
036            }
037    
038            return var1;
039        }
040    
041        public boolean getAcceptsTextures()
042        {
043            return this.acceptsTextures;
044        }
045    
046        public boolean func_78840_c()
047        {
048            return this.field_78842_g;
049        }
050    
051        public void setAcceptsTextures(boolean par1)
052        {
053            this.acceptsTextures = par1;
054            this.field_78842_g = false;
055        }
056    
057        /**
058         * Takes an NBTTagCompound with 'name' and 'ip' keys, returns a ServerData instance.
059         */
060        public static ServerData getServerDataFromNBTCompound(NBTTagCompound par0NBTTagCompound)
061        {
062            ServerData var1 = new ServerData(par0NBTTagCompound.getString("name"), par0NBTTagCompound.getString("ip"));
063    
064            if (par0NBTTagCompound.hasKey("acceptTextures"))
065            {
066                var1.setAcceptsTextures(par0NBTTagCompound.getBoolean("acceptTextures"));
067            }
068    
069            return var1;
070        }
071    }