public void SendEnvColor(byte type, string hex) { if (String.IsNullOrEmpty(hex)) { Send(Packet.EnvColor(type, -1, -1, -1)); return; } try { CustomColor c = Colors.ParseHex(hex); Send(Packet.EnvColor(type, c.R, c.G, c.B)); } catch (ArgumentException) { Send(Packet.EnvColor(type, -1, -1, -1)); } }
public void Show(Player p) { if (!p.Supports(CpeExt.SelectionCuboid) || !Shows) { return; } ColorDesc col = Colors.ParseHex(Config.ShowColor); p.Send(Packet.MakeSelection( ID, "", new Vec3U16(MinX, MinY, MinZ), new Vec3U16((ushort)(MaxX + 1), (ushort)(MaxY + 1), (ushort)(MaxZ + 1)), col.R, col.G, col.B, Config.ShowAlpha, p.hasCP437)); }