コード例 #1
0
        private void OnChatMessage(int groupId, string message, EnumChatType chattype, string data)
        {
            var pos = _clientApi.World.Player.CurrentBlockSelection?.Position ?? _clientApi.World.Player.Entity.Pos.AsBlockPos;

            if (pos == null || groupId != GlobalConstants.InfoLogChatGroup || !message.StartsWith(_triggerword))
            {
                return;
            }

            message = _cleanupRegex.Replace(message, string.Empty);
            var posX = pos.X / _chunksize;
            var posZ = pos.Z / _chunksize;

            _messages.RemoveAll(m => m.X == posX && m.Z == posZ);
            _messages.Add(new ProspectInfo(posX, posZ, message));
            _clientApi.SaveDataFile(Filename, _messages);
        }