コード例 #1
0
        internal static void HandleChangedZone(Player p)
        {
            if (p.Supports(CpeExt.InstantMOTD))
            {
                p.SendMapMotd();
            }
            p.SendCurrentEnv();

            if (p.isFlying && !Hacks.CanUseFly(p))
            {
                p.Message("You cannot use %T/Fly %Son this map.");
                p.isFlying = false;
            }
        }
コード例 #2
0
ファイル: MiscHandlers.cs プロジェクト: Fam0r/MCGalaxy
        internal static void HandleChangedZone(Player p)
        {
            if (p.Supports(CpeExt.InstantMOTD))
            {
                p.SendMapMotd();
            }
            p.SendCurrentEnv();

            if (p.isFlying && !Hacks.CanUseFly(p))
            {
                p.Message("You cannot use &T/Fly &Son this map.");
                p.isFlying = false;
            }

            Zone zone = p.ZoneIn;

            if (zone != null && zone.Config.Text != "")
            {
                MessageBlock.Execute(p, zone.Config.Text, p.Pos.FeetBlockCoords);
            }
        }
コード例 #3
0
ファイル: MiscHandlers.cs プロジェクト: DiresHosting/MCDire
        internal static void HandleOnMapSent(Player p, Level prevLevel, Level level)
        {
            p.AFKCooldown = DateTime.UtcNow.AddSeconds(2);
            p.prevMsg     = "";
            p.showMBs     = false;
            p.showPortals = false;
            p.SetModel(p.Model, level); // in case had been using a level-only custom block for their model

            if (p.isFlying && !Hacks.CanUseFly(p, level))
            {
                p.Message("You cannot use %T/Fly %Son this map.");
                p.isFlying = false;
            }

            p.ZoneIn = null;
            p.OnChangedZone();
            p.SendCurrentTextures();
            p.SendCurrentBlockPermissions();

            // TODO: unshow old zones here??
            if (p.Supports(CpeExt.SelectionCuboid))
            {
                Zone[] zones = level.Zones.Items;
                foreach (Zone zn in zones)
                {
                    zn.Show(p);
                }
            }

            if (p.aiming && !level.Config.Guns)
            {
                p.aiming = false;
                p.ClearBlockchange();
            }
            if (!level.Config.UseBlockDB)
            {
                p.Message("BlockDB is disabled here, %Wyou will not be able to /undo or /redo");
            }
        }
コード例 #4
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (!Hacks.CanUseFly(p))
            {
                p.Message("You cannot use &T/Fly &Son this map.");
                p.isFlying = false; return;
            }

            p.isFlying = !p.isFlying;
            if (!p.isFlying)
            {
                return;
            }

            p.Message("You are now flying. &cJump!");

            FlyState state = new FlyState();

            state.player = p;
            SchedulerTask task = new SchedulerTask(FlyCallback, state, TimeSpan.Zero, true);

            p.CriticalTasks.Add(task);
        }