Esempio n. 1
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);
             if (api.COMMERCIAL)
             {   // 非社区内容
                 pgetServerStorageID = api.ConvertComponentFunc <AGET>(PLAYER_GET_STORAGEID);
             }
             playerApiInited = true;
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 2
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);
             playerApiInited     = true;
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }