Example #1
0
        internal static void SendLevelCustomBlocks(Player pl)
        {
            BlockDefinition[] defs = pl.level.CustomBlockDefs;
            for (int i = 1; i < defs.Length; i++)
            {
                BlockDefinition def = defs[i];
                if (def == null)
                {
                    continue;
                }
                if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt, 2) && def.Shape != 0)
                {
                    SendDefineBlockExt(pl, def, true);
                }
                else if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt) && def.Shape != 0)
                {
                    SendDefineBlockExt(pl, def, false);
                }
                else
                {
                    SendDefineBlock(pl, def);
                }

                if (pl.HasCpeExt(CpeExt.BlockPermissions))
                {
                    pl.SendSetBlockPermission(def.BlockID, pl.level.CanPlace, pl.level.CanDelete);
                }
            }
        }
Example #2
0
 public static void SendAll(Player pl) {
     if (!pl.HasCpeExt(CpeExt.BlockDefinitions)) return;
     for (int i = 1; i < GlobalDefinitions.Length; i++) {
         BlockDefinition def = GlobalDefinitions[i];
         if (def == null) continue;
         
         if (pl.HasCpeExt(CpeExt.BlockDefinitionsExt) && def.Shape != 0)
             SendDefineBlockExt(pl, def);
         else
             SendDefineBlock(pl, def);
         pl.SendSetBlockPermission(def.BlockID, 1, 1);
     }
 }