Beispiel #1
0
 public CsActor(MCCSAPI api, IntPtr e)
 {
     if (mapi == null)
     {
         mapi = api;
     }
     ptr = e;
     initEntityAPI(api);
 }
 public static void onStart(MCCSAPI api)
 {
     try
     {
         IronLuaLoader.IronLoader.LoadLua(api);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
     Console.WriteLine("[ILUAD] IronLuaLoader 装载完成");
 }
Beispiel #3
0
 public static void onStart(MCCSAPI api)
 {
     try
     {
         csapi.api = api;
         CSharpLuaRunner.CSharpLuaRunner.RunCSharpLua(api);
         Console.WriteLine("[INFO] [CSLR] CSharpLuaRunner加载成功\n[INFO] [CSLR] 输入cslr help查看帮助");
     }
     catch (Exception e)
     {
         Console.WriteLine("[ERROR] [CSLR] " + e.Message);
     }
 }
Beispiel #4
0
        public static void onStart(MCCSAPI api)
        {
            // TODO 此接口为必要实现
            Draco.DracoBeta.Dracoup(api);
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("[Draco]加载成功!!");
            Console.WriteLine("[Draco]您正在使用DracoBeta0.8.3");
            Console.WriteLine(@"    ____                      
   / __ \_________ __________ 
  / / / / ___/ __ `/ ___/ __ \
 / /_/ / /  / /_/ / /__/ /_/ /
/_____/_/   \__,_/\___/\____/ ");
            Console.WriteLine("[Draco]Bug反馈请加QQ:2023786106");
            Console.ForegroundColor = ConsoleColor.Gray;
        }
Beispiel #5
0
 static protected bool initEntityAPI(MCCSAPI api)
 {
     if (!entityApiInited)
     {
         if (api != null)
         {
             egetArmorContainer     = api.ConvertComponentFunc <AGET>(ENTITY_GET_ARMOR_CONTAINER);
             egetAttack             = api.ConvertComponentFunc <AGET>(ENTITY_GET_ATTACK);
             esetAttack             = api.ConvertComponentFunc <ASET>(ENTITY_SET_ATTACK);
             egetCollisionBox       = api.ConvertComponentFunc <AGET>(ENTITY_GET_COLLISION_BOX);
             esetCollisionBox       = api.ConvertComponentFunc <ASET>(ENTITY_SET_COLLISION_BOX);
             egetHandContainer      = api.ConvertComponentFunc <AGET>(ENTITY_GET_HAND_CONTAINER);
             egetHealth             = api.ConvertComponentFunc <AGET>(ENTITY_GET_HEALTH);
             esetHealth             = api.ConvertComponentFunc <ASET>(ENTITY_SET_HEALTH);
             egetInventoryContainer = api.ConvertComponentFunc <AGET>(ENTITY_GET_INVENTORY_CONTAINER);
             egetName        = api.ConvertComponentFunc <AGET>(ENTITY_GET_NAME);
             esetName        = api.ConvertComponentFunc <ASETNAME>(ENTITY_SET_NAME);
             egetPosition    = api.ConvertComponentFunc <AGET>(ENTITY_GET_POSITION);
             esetPosition    = api.ConvertComponentFunc <ASET>(ENTITY_SET_POSITION);
             egetRotation    = api.ConvertComponentFunc <AGET>(ENTITY_GET_ROTATION);
             esetRotation    = api.ConvertComponentFunc <ASET>(ENTITY_SET_ROTATION);
             egetDimensionId = api.ConvertComponentFunc <AGETDIMENSIONID>(ENTITY_GET_DIMENSIONID);
             egetTypeId      = api.ConvertComponentFunc <AGETDIMENSIONID>(ENTITY_GET_TYPEID);
             egetUniqueId    = api.ConvertComponentFunc <AGETUNIQUEID>(ENTITY_GET_UNIQUEID);
             eremove         = api.ConvertComponentFunc <AREMOVE>(ENTITY_REMOVE);
             ehurt           = api.ConvertComponentFunc <AHURT>(ENTITY_HURT);
             if (api.COMMERCIAL)
             {   // 非社区内容
                 egetAbilities     = api.ConvertComponentFunc <AGET>(ENTITY_GET_ABILITIES);
                 esetAbilities     = api.ConvertComponentFunc <ASET>(ENTITY_SET_ABILITIES);
                 egetAttributes    = api.ConvertComponentFunc <AGET>(ENTITY_GET_ATTRIBUTES);
                 esetAttributes    = api.ConvertComponentFunc <ASET>(ENTITY_SET_ATTRIBUTES);
                 egetMaxAttributes = api.ConvertComponentFunc <AGET>(ENTITY_GET_MAXATTRIBUTES);
                 esetMaxAttributes = api.ConvertComponentFunc <ASET>(ENTITY_SET_MAXATTRIBUTES);
                 egetEffects       = api.ConvertComponentFunc <AGET>(ENTITY_GET_EFFECTS);
                 esetEffects       = api.ConvertComponentFunc <ASET>(ENTITY_SET_EFFECTS);
             }
             egetFromUniqueId = api.ConvertComponentFunc <AGETFROMUNIQUEID>(LEVEL_GETFROM_UNIQUEID);
             egetsFromAABB    = api.ConvertComponentFunc <AGETSFROMAABB>(LEVEL_GETSFROM_AABB);
             entityApiInited  = true;
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #6
0
 static private bool initPlayerAPI(MCCSAPI api)
 {
     if (!playerApiInited)
     {
         if (api != null)
         {
             pgetHotbarContainer = api.ConvertComponentFunc <AGET>(PLAYER_GET_HOTBAR_CONTAINER);
             pgetUuid            = api.ConvertComponentFunc <AGET>(PLAYER_GET_UUID);
             playerApiInited     = true;
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #7
0
        /// <summary>
        /// 从指定地图位置查询实体指针列表(不含玩家)
        /// </summary>
        /// <param name="api"></param>
        /// <param name="did">维度ID</param>
        /// <param name="x1"></param>
        /// <param name="y1"></param>
        /// <param name="z1"></param>
        /// <param name="x2"></param>
        /// <param name="y2"></param>
        /// <param name="z2"></param>
        /// <returns>实体指针列表</returns>
        public static ArrayList getsFromAABB(MCCSAPI api, int did, float x1, float y1, float z1, float x2, float y2, float z2)
        {
            if (egetsFromAABB == null)
            {
                initEntityAPI(api);
            }
            IntPtr pv = egetsFromAABB(did, x1, y1, z1, x2, y2, z2);

            if (pv != null && pv != IntPtr.Zero)
            {
                try {
                    return(((Std_Vector)Marshal.PtrToStructure(pv, typeof(Std_Vector))).toList());
                }
                catch { }
            }
            return(null);
        }
Beispiel #8
0
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     sbx.sbbx.aaascr(api);
     Console.ForegroundColor = ConsoleColor.Cyan;
     Console.WriteLine("[SkyBlockX]空岛核心已加载!");
     Console.WriteLine(@" ____    __               ____    ___                   __      __   __     ");
     Console.WriteLine(@"/\  _`\ /\ \             /\  _`\ /\_ \                 /\ \    /\ \ /\ \    ");
     Console.WriteLine(@"\ \,\L\_\ \ \/'\   __  __\ \ \L\ \//\ \     ___     ___\ \ \/'\\ `\`\/'/'   ");
     Console.WriteLine(@" \/_\__ \\ \ , <  /\ \/\ \\ \  _ <'\ \ \   / __`\  /'___\ \ , < `\/ > <     ");
     Console.WriteLine(@"   /\ \L\ \ \ \\`\\ \ \_\ \\ \ \L\ \\_\ \_/\ \L\ \/\ \__/\ \ \\`\  \/'/\`\  ");
     Console.WriteLine(@"   \ `\____\ \_\ \_\/`____ \\ \____//\____\ \____/\ \____\\ \_\ \_\/\_\\ \_\");
     Console.WriteLine(@"    \/_____/\/_/\/_/`/___/> \\/___/ \/____/\/___/  \/____/ \/_/\/_/\/_/ \/_/");
     Console.WriteLine(@"                       /\___/                                               ");
     Console.WriteLine(@"                       \/__/                                                ");
     Console.WriteLine("[SkyBlockX]bug反馈请加QQ:2023786106");
     Console.ForegroundColor = ConsoleColor.White;
 }
Beispiel #9
0
        /// <summary>
        /// 通用调用接口,需用户自行实现
        /// </summary>
        /// <param name="api">MC相关调用方法</param>
        public static void onStart(MCCSAPI api)
        {
            ConsoleColor color = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("[BackupMap] 自动存档备份组件已加载。");
            Console.ForegroundColor = color;

            // TODO 此接口为必要实现
            try
            {
                BackupMap.AutoBackup.init(api);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Beispiel #10
0
 /// <summary>
 /// 插件装载时的事件
 /// </summary>
 public static int onServerStart(string pathandversion)
 {
     string[] pav = pathandversion.Split(',');
     if (pav.Length > 1)
     {
         string path       = pav[0];
         string version    = pav[1];
         bool   commercial = (pav[pav.Length - 1] == "1");
         api = new MCCSAPI(path, version, commercial);
         if (api != null)
         {
             onStart(api);
             GC.KeepAlive(api);
             return(0);
         }
     }
     Console.WriteLine("Load failed.");
     return(-1);
 }
Beispiel #11
0
        /// <summary>
        /// 从查询ID处反查一个实体(或玩家)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static CsActor getFromUniqueId(MCCSAPI api, ulong id)
        {
            if (egetFromUniqueId == null)
            {
                initEntityAPI(api);
            }
            IntPtr p = egetFromUniqueId(id);

            if (p != null && p != IntPtr.Zero)
            {
                if (egetTypeId != null && egetTypeId(p) == 319)
                {
                    return(new CsPlayer(api, p));
                }
                else
                {
                    return(new CsActor(api, p));
                }
            }
            return(null);
        }
Beispiel #12
0
 static private bool initPlayerAPI(MCCSAPI api)
 {
     if (!playerApiInited)
     {
         if (api != null)
         {
             pgetHotbarContainer = api.ConvertComponentFunc <AGET>(PLAYER_GET_HOTBAR_CONTAINER);
             pgetUuid            = api.ConvertComponentFunc <AGET>(PLAYER_GET_UUID);
             pgetIPPort          = api.ConvertComponentFunc <AGET>(PLAYER_GET_IPPORT);
             paddLevel           = api.ConvertComponentFunc <PADDLEVEL>(PLAYER_ADD_LEVEL);
             pgetScoreboardId    = api.ConvertComponentFunc <PGETSCOREID>(PLAYER_GET_SCOREID);
             pcreateScoreboardId = api.ConvertComponentFunc <PGETSCOREID>(PLAYER_CREATE_SCOREID);
             pgetplFromAABB      = api.ConvertComponentFunc <AGETSFROMAABB>(LEVEL_GETPLFROM_AABB);
             playerApiInited     = true;
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #13
0
        public static int onServerStart(string pathandversion)
        {
            string path = null, version = null;
            bool   commercial = false;

            string[] pav = pathandversion.Split(',');
            if (pav.Length > 1)
            {
                path       = pav[0];
                version    = pav[1];
                commercial = (pav[pav.Length - 1] == "1");
                mapi       = new MCCSAPI(path, version, commercial);
                if (mapi != null)
                {
                    onStart(mapi);
                    GC.KeepAlive(mapi);
                    return(0);
                }
            }
            Console.WriteLine("插件开始载入。。");
            return(-1);
        }
Beispiel #14
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     Console.WriteLine("[JSR] JSRunner for BDSNetrunner by zhkj-liuxiaohua, translation by TMGCH06");
     // TODO 此接口为必要实现
     BDSJSR2.Program.init(api);
 }
Beispiel #15
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     BehaviorLog.Program.init(api);
     Console.WriteLine("[Behavior]行为日志已装载!");
 }
Beispiel #16
0
 /// <summary>
 /// 通用调用接口
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     Menu.Menu.init(api);
     Console.WriteLine("[{0}]{1}插件加载成功! By:{2}", Menu.Menu.Version, Menu.Menu.PluginName, Menu.Menu.Author);
 }
Beispiel #17
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     Console.WriteLine("[JSR] Net版JS加载平台已装载。");
     // TODO 此接口为必要实现
     BDSJSR2.Program.init(api);
 }
Beispiel #18
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     CSRDemo.Program.init(api);
     Console.WriteLine("[Demo] CSR测试插件已装载。");
 }
Beispiel #19
0
 public static void onStart(MCCSAPI api)
 {
     SweepFloor.Program.init(api);
     Console.WriteLine("[SweepFloor]加载成功!");
 }
Beispiel #20
0
 public CsPlayer(MCCSAPI api, IntPtr p) : base(api, p)
 {
     initPlayerAPI(api);
 }
Beispiel #21
0
 public static void onStart(MCCSAPI api)
 {
     Console.WriteLine("[UnlockScripting] 请等待版本适配..");
     UnlockScripting.MyClass.init(api);
 }
Beispiel #22
0
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     login.scr.litelogin(api);
     Console.WriteLine("[litelogin]登录插件已加载!");
 }
Beispiel #23
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     Testcase.Program.init(api);
     Console.WriteLine("[testcase] 测试命令已装载。用法:/testcase");
 }
Beispiel #24
0
 // TODO
 public static void onStart(MCCSAPI api)
 {
 }
Beispiel #25
0
 // 用户主实现
 public static void onStart(MCCSAPI api)
 {
     AlwaysNoCheat.Program.init(api);
 }
Beispiel #26
0
 public static void onStart(MCCSAPI api)
 {
     csapi.api = api;
     CSharpLuaRunner.CSharpLuaRunner.RunCSharpLuaRunner(api);
     Console.WriteLine("[INFO] [CSLR] CSharpLuaRunner加载成功\n[INFO] [CSLR] 输入cslr help查看帮助");
 }
Beispiel #27
0
 public static void onStart(MCCSAPI api)
 {
     Transfer.Program.init(api);
     Console.WriteLine("[CSR] [清漪花开]Transfer-->载入成功。版本:0.0.1");
 }
Beispiel #28
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     Visitor.Program.init(api);
     Console.WriteLine("[visitor] 访客命令已装载(仅限后台)。用法:visitor [playername]");
 }
Beispiel #29
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     // TODO 此接口为必要实现
     CSRDemo.Program.init(api);
 }
Beispiel #30
0
 /// <summary>
 /// 通用调用接口,需用户自行实现
 /// </summary>
 /// <param name="api">MC相关调用方法</param>
 public static void onStart(MCCSAPI api)
 {
     Console.WriteLine("[HideSeed] 已装载。请等待版本适配...");
     // TODO 此接口为必要实现
     HideSeed.Program.init(api);
 }