示例#1
0
    public static void Init()
    {
        TagNodeCompound player   = NBTHelper.GetPlayerData();
        int             gameMode = player["playerGameType"] as TagNodeInt;

        _mode = (GameMode)gameMode;
    }
示例#2
0
    public void Respawn()
    {
        TagNodeCompound player = NBTHelper.GetPlayerData();
        int             x      = player["SpawnX"] as TagNodeInt;
        int             y      = player["SpawnY"] as TagNodeInt;
        int             z      = player["SpawnZ"] as TagNodeInt;

        Vector3 spawnVec = new Vector3(x, y, z);

        transform.position = spawnVec;
        lastPosOnGround    = spawnVec;

        NBTHelper.RespawnRefreshChunks();

        Time.timeScale = 1;
        Health         = 20;
    }
示例#3
0
    public static void Init()
    {
        TagNodeCompound playerData = NBTHelper.GetPlayerData();
        TagNodeList     Inventory  = playerData["Inventory"] as TagNodeList;

        for (int i = 0; i < Inventory.Count; i++)
        {
            TagNodeCompound item   = Inventory[i] as TagNodeCompound;
            byte            slot   = item["Slot"] as TagNodeByte;
            byte            count  = item["Count"] as TagNodeByte;
            short           damage = item["Damage"] as TagNodeShort;
            string          id     = item["id"] as TagNodeString;

            items[slot].id     = id;
            items[slot].count  = count;
            items[slot].damage = damage;
        }
    }