Esempio n. 1
0
        /// <summary>
        /// Prevent block modification, aplies to all, residents should never get called here
        /// </summary>
        public static bool ProtectBlockBreak(VanillaSession session, WorldRegion region, PlayerDigging d)
        {
            if (IsBlockProtected(session, region) == false)
                return false;

            //Block single click from outside the adventure mode
            if (d.Status == PlayerDigging.StatusEnum.StartedDigging)
                return true;
            
            if (d.Status != PlayerDigging.StatusEnum.FinishedDigging)
                return false;

            //Old method - not needed
            BlockChange bc = new BlockChange(d.Position, BlockID.Bedrock);
            session.Player.SendToClient(bc);

            //New method - Works
            /*
            PlayerDigging pd = new PlayerDigging();
            pd.Position = d.Position;
            pd.Face = Face.Down;
            pd.Status = PlayerDigging.StatusEnum.CheckBlock;
            session.FromClient(pd);
            */

            return true;
        }
Esempio n. 2
0
        static bool DiggProtect(Client player, PlayerDigging pd)
        {
            if (pd.Status == PlayerDigging.StatusEnum.FinishedDigging)
            {
                BlockChange bc = new BlockChange(pd.Position.Offset(pd.Face), BlockID.Fire);
                player.SendToClient(bc);
				
                player.TellAbove(Chat.Purple, "You are still in spawn");
                return true;
            }
			
            return false;
        }