Exemple #1
0
        static void SendModel(Player pl, byte id, string model)
        {
            byte block;

            // Fallback block models for clients that don't support block definitions
            if (byte.TryParse(model, out block) && !pl.hasBlockDefs)
            {
                model = pl.level.RawFallback(block).ToString();
            }
            pl.Send(Packet.ChangeModel(id, model, pl.hasCP437));
        }
Exemple #2
0
        static void SendModel(Player pl, byte id, string model)
        {
            BlockID raw;

            if (BlockID.TryParse(model, out raw) && raw > pl.MaxRawBlock)
            {
                BlockID block = Block.FromRaw(raw);
                if (block >= Block.ExtendedCount)
                {
                    model = "humanoid"; // invalid block ids
                }
                else
                {
                    model = pl.ConvertBlock(block).ToString();
                }
            }
            pl.Send(Packet.ChangeModel(id, model, pl.hasCP437));
        }