当前位置: 首页>>代码示例>>C#>>正文


C# MCForge.Level类代码示例

本文整理汇总了C#中MCForge.Level的典型用法代码示例。如果您正苦于以下问题:C# Level类的具体用法?C# Level怎么用?C# Level使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Level类属于MCForge命名空间,在下文中一共展示了Level类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: placeBlock

 public static void placeBlock(Level l, Player p, ushort x, ushort y, ushort z, ushort type)
 {
     if (p == null)
         l.Blockchange(x, y, z, type);
     else
         l.Blockchange(p, x, y, z, type);
 }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:7,代码来源:FindReference.cs

示例2: AddCactus

        public void AddCactus(Level Lvl, ushort x, ushort y, ushort z, Random Rand, bool blockChange = false, bool overwrite = true)
        {
            byte height = (byte)Rand.Next(3, 6);
            ushort yy;

            for (yy = 0; yy <= height; yy++) {
                if (overwrite || Lvl.GetTile(z, (ushort)(y + yy), z) == Block.air)
                    if (blockChange) Lvl.Blockchange(x, (ushort)(y + yy), z, Block.green);
                    else Lvl.skipChange(x, (ushort)(y + yy), z, Block.green);
            }

            int inX = 0, inZ = 0;

            switch (Rand.Next(1, 3))
            {
                case 1: inX = -1; break;
                case 2:
                default: inZ = -1; break;
            }

            for (yy = height; yy <= Rand.Next(height + 2, height + 5); yy++)
            {
                if (overwrite || Lvl.GetTile((ushort)(x + inX), (ushort)(y + yy), (ushort)(z + inZ)) == Block.air)
                    if (blockChange) Lvl.Blockchange((ushort)(x + inX), (ushort)(y + yy), (ushort)(z + inZ), Block.green);
                    else Lvl.skipChange((ushort)(x + inX), (ushort)(y + yy), (ushort)(z + inZ), Block.green);
            }
            for (yy = height; yy <= Rand.Next(height + 2, height + 5); yy++)
            {
                if (overwrite || Lvl.GetTile((ushort)(x + inX), (ushort)(y + yy), (ushort)(z + inZ)) == Block.air)
                    if (blockChange) Lvl.Blockchange((ushort)(x - inX), (ushort)(y + yy), (ushort)(z - inZ), Block.green);
                    else Lvl.skipChange((ushort)(x - inX), (ushort)(y + yy), (ushort)(z - inZ), Block.green);
            }
        }
开发者ID:WanX,项目名称:MCaznowl-Build,代码行数:33,代码来源:MapGenerator.cs

示例3: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 public static void Register(Level.OnLevelUnload method, Priority priority, Plugin plugin)
 {
     if (Find(plugin) != null)
         throw new Exception("The user tried to register 2 of the same event!");
     events.Add(new OnLevelUnloadEvent(method, priority, plugin));
     Organize();
 }
开发者ID:Cazzar,项目名称:MCaznowl-Build,代码行数:13,代码来源:OnLevelUnloadEvent.cs

示例4: Register

 /// <summary>
 /// Register this event
 /// </summary>
 /// <param name="method">This is the delegate that will get called when this event occurs</param>
 /// <param name="priority">The priority (imporantce) of this call</param>
 /// <param name="plugin">The plugin object that is registering the event</param>
 /// <param name="bypass">Register more than one of the same event</param>
 public static void Register(Level.OnLevelLoaded method, Priority priority, Plugin plugin, bool bypass = false)
 {
     if (Find(plugin) != null)
         if (!bypass)
         throw new Exception("The user tried to register 2 of the same event!");
     events.Add(new OnLevelLoadedEvent(method, priority, plugin));
     Organize();
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:15,代码来源:OnLevelLoadedEvent.cs

示例5: CancelLevelEvent

 /// <summary>
 /// Cancel Level event
 /// </summary>
 /// <param name="e">The event to cancel</param>
 /// <param name="l">The level to cancel the event on</param>
 public static void CancelLevelEvent(LevelEvents e, Level l)
 {
     switch (e)
     {
         case LevelEvents.LevelUnload:
             break;
     }
 }
开发者ID:ProLoks,项目名称:MCForge-Vanilla,代码行数:13,代码来源:Plugin.Events.cs

示例6: Find

 public static Level Find(string levelName)
 {
     net.mcforge.world.Level temp = MCForge.Gui.Program.console.getServer().getLevelHandler().findLevel(levelName);
     if (temp == null)
         return null;
     Level l = new Level(temp);
     return l;
 }
开发者ID:B00mX0r,项目名称:MCForge-GUI,代码行数:8,代码来源:Level.cs

示例7: FoundCheck

 public string FoundCheck(Level level, bool check)
 {
     if (gettinginfo == false)
     {
         Level.SaveSettings(level);
     }
     if (check) return "&aON";
     else return "&cOFF";
 }
开发者ID:Techjar,项目名称:MCForge-Vanilla,代码行数:9,代码来源:CmdMap.cs

示例8: Call

 public static void Call(ushort x, ushort y, ushort z, byte time, string extra, Level l)
 {
     events.ForEach(delegate(OnPhysicsUpdateEvent p1)
     {
         try
         {
             p1.method(x, y, z, time, extra, l);
         }
         catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the LevelUnload Event!"); Server.ErrorLog(e); }
     });
 }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:11,代码来源:OnPhysicsUpdate.cs

示例9: Call

 public static void Call(Level l)
 {
     events.ForEach(delegate(OnLevelLoadedEvent p1)
     {
         try
         {
             p1.method(l);
         }
         catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the LevelUnload Event!"); Server.ErrorLog(e); }
     });
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:11,代码来源:OnLevelLoadedEvent.cs

示例10: CancelLevelEvent

        /// <summary>
        /// Cancel Level event
        /// </summary>
        /// <param name="e">The event to cancel</param>
        /// <param name="l">The level to cancel the event on</param>
        public static void CancelLevelEvent(LevelEvents e, Level l)
        {
            switch (e)
            {
                case LevelEvents.LevelUnload:
                    l.cancelunload = true;
                    break;
                case LevelEvents.LevelSave:
                    l.cancelsave1 = true;
                    break;

            }
        }
开发者ID:RedNoodle,项目名称:MCForge-Vanilla,代码行数:18,代码来源:Plugin.Events.cs

示例11: Start

 public void Start()
 {
     StartTimer = new System.Timers.Timer(1000);
     ZombieLevel = Level.Find("main");
     int loop = 6;
     StartTimer.Start(); StartTimer.Elapsed += delegate
     {
         Server.s.Log(loop + "");
         if (loop != 0)
         {
             int amountOfPlayers = PlayerCount();
             Player.players.ForEach(delegate(Player p)
             {
                 if (p.referee)
                     amountOfPlayers--;
             });
             //if (amountOfPlayers >= 2)
             //{
                 MoreThanTwoPlayers = true;
                 loop--;
                 Player.GlobalMessage(c.gray + " - " + Server.DefaultColor + "Zombie Survival starts in " + loop + " seconds on level " +
                                      ZombieLevel.name + c.gray + " - ");
             /*}
             else
             {
                 if (MoreThanTwoPlayers)
                     Player.GlobalMessage(c.gray + " - " + Server.DefaultColor + "Zombie Survival requires more than 2 non-referee players online to play" + c.gray + " - ");
                 MoreThanTwoPlayers = false;
             }*/
         }
         else
         {
             loop = 6;
             Server.ZombieRound = true;
             int randomMinutes = Random.Next(1, 4);
             Player.GlobalMessage(c.gray + " - " + "Zombie Survival has started on level " + ZombieLevel.name + " for " + randomMinutes + " minutes! Type /g " + ZombieLevel.name + " to join! " + c.gray + " - ");
             EndRoundTimer = new System.Timers.Timer((60000 * randomMinutes) - 30000);
             EndRoundTimer.Start();
             EndRoundTimer.Elapsed += delegate { EndRound(); };
             StartTimer.Stop();
             StartTimer.Dispose();
         }
     };
 }
开发者ID:Balthizar01,项目名称:MCForge-Vanilla-Redux,代码行数:44,代码来源:ZombieSurvival.cs

示例12: NegateEdge

        //Forces the edge of a map to slope lower for island map types
        float NegateEdge(ushort x, ushort y, Level Lvl)
        {
            float tempx = 0.0f, tempy = 0.0f;
            float temp;
            if (x != 0) { tempx = ((float)x / (float)Lvl.width) * 0.5f; }
            if (y != 0) { tempy = ((float)y / (float)Lvl.height) * 0.5f; }
            tempx = Math.Abs(tempx - 0.25f);
            tempy = Math.Abs(tempy - 0.25f);
            if (tempx > tempy)
            {
                temp = tempx - 0.15f;
            }
            else
            {
                temp = tempy - 0.15f;
            }

            //s.Log("temp = " + temp.ToString());
            if (temp > 0.0f) { return temp; }
            return 0.0f;
        }
开发者ID:Cazzar,项目名称:MCForge-Vanilla,代码行数:22,代码来源:MapGenerator.cs

示例13: OnLevelLoadedEvent

 internal OnLevelLoadedEvent(Level.OnLevelLoaded method, Priority priority, Plugin plugin)
 {
     this.plugin = plugin; this.priority = priority; this.method = method;
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:4,代码来源:OnLevelLoadedEvent.cs

示例14: addLevel

 public static void addLevel(Level level)
 {
     levels.Add(level);
 }
开发者ID:CrusaderV,项目名称:MCForge-Vanilla,代码行数:4,代码来源:Server.cs

示例15: GlobalBlockchange

 public static void GlobalBlockchange(Level level, ushort x, ushort y, ushort z, byte type)
 {
     players.ForEach(delegate(Player p) { if (p.level == level) { p.SendBlockchange(x, y, z, type); } });
 }
开发者ID:Dmitchell94,项目名称:MCForge-Vanilla-Original,代码行数:4,代码来源:Player.cs


注:本文中的MCForge.Level类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。