コード例 #1
0
ファイル: JoinGamePacket.cs プロジェクト: Alword/Bost
        public bool IsFlat;                          //*

        public override void Read(byte[] array)
        {
            McInt.TryParse(ref array, out EntityId);
            McBoolean.TryParse(ref array, out IsHardcore);
            if (McUnsignedByte.TryParse(ref array, out var gamemode))
            {
                Gamemode = (Gamemodes)gamemode;
            }
            if (McByte.TryParse(ref array, out var previousGamemode))
            {
                PreviousGamemode = (Gamemodes)previousGamemode;
            }
            McVarint.TryParse(ref array, out WorldCount);
            McStringArray.TryParse(WorldCount, ref array, out WorldNames);
            McNbtCompoundTag.TryParse(ref array, out DimensionCodec);
            McNbtCompoundTag.TryParse(ref array, out Dimension);
            McString.TryParse(ref array, out WorldName);
            McLong.TryParse(ref array, out HashedSeed);
            McVarint.TryParse(ref array, out MaxPlayers);
            McVarint.TryParse(ref array, out ViewDistance);
            McBoolean.TryParse(ref array, out ReducedDebugInfo);
            McBoolean.TryParse(ref array, out EnableRespawnScreen);
            McBoolean.TryParse(ref array, out IsDebug);
            McBoolean.TryParse(ref array, out IsFlat);
        }
コード例 #2
0
        // Array size 2  Recipe IDs  Number of elements in the following array, only present if mode is 0 (init)

        public override void Read(byte[] array)
        {
            if (McVarint.TryParse(ref array, out var action))
            {
                Action = (UnlockRecipesActions)action;
            }
            McBoolean.TryParse(ref array, out CraftingRecipeBookOpen);
            McBoolean.TryParse(ref array, out CraftingRecipeBookFilterActive);
            McBoolean.TryParse(ref array, out SmeltingRecipeBookOpen);
            McBoolean.TryParse(ref array, out SmeltingRecipeBookFilterActive);
            McBoolean.TryParse(ref array, out BlastFuranceRecipeBookOpen);
            McBoolean.TryParse(ref array, out BlastFuranceRecipeBookFilterActive);
            McBoolean.TryParse(ref array, out SmokerRecipeBookOpen);
            McBoolean.TryParse(ref array, out SmokerRecipeBookFilterActive);
            McVarint.TryParse(ref array, out ArraySize1);
            McStringArray.TryParse(ArraySize1, ref array, out RecipeIDs1);
            if (Action == 0)
            {
                McVarint.TryParse(ref array, out ArraySize2);
                McStringArray.TryParse(ArraySize2, ref array, out RecipeIDs2);
            }
        }