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


C# Player.SendBlockchange方法代码示例

本文整理汇总了C#中MCGalaxy.Player.SendBlockchange方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendBlockchange方法的具体用法?C# Player.SendBlockchange怎么用?C# Player.SendBlockchange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MCGalaxy.Player的用法示例。


在下文中一共展示了Player.SendBlockchange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Player_PlayerBlockChange

 void Player_PlayerBlockChange(Player p, ushort x, ushort y, ushort z, byte type)
 {
     if (started)
     {
         if (p.level == mainlevel && !blueteam.members.Contains(p) && !redteam.members.Contains(p))
         {
             p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
             Player.SendMessage(p, "You are not on a team!");
             Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
         }
         if (p.level == mainlevel && blueteam.members.Contains(p) && x == redbase.x && y == redbase.y && z == redbase.z && mainlevel.GetTile(redbase.x, redbase.y, redbase.z) != Block.air)
         {
             Player.GlobalMessageLevel(mainlevel, blueteam.color + p.name + " took the " + redteam.color + " red team's FLAG!");
             GetPlayer(p).hasflag = true;
         }
         if (p.level == mainlevel && redteam.members.Contains(p) && x == bluebase.x && y == bluebase.y && z == bluebase.z && mainlevel.GetTile(bluebase.x, bluebase.y, bluebase.z) != Block.air)
         {
             Player.GlobalMessageLevel(mainlevel, redteam.color + p.name + " took the " + blueteam.color + " blue team's FLAG");
             GetPlayer(p).hasflag = true;
         }
         if (p.level == mainlevel && blueteam.members.Contains(p) && x == bluebase.x && y == bluebase.y && z == bluebase.z && mainlevel.GetTile(bluebase.x, bluebase.y, bluebase.z) != Block.air)
         {
             if (GetPlayer(p).hasflag)
             {
                 Player.GlobalMessageLevel(mainlevel, blueteam.color + p.name + " RETURNED THE FLAG!");
                 GetPlayer(p).hasflag = false;
                 GetPlayer(p).cap++;
                 GetPlayer(p).points += cappoint;
                 blueteam.points++;
                 mainlevel.Blockchange(redbase.x, redbase.y, redbase.z, Block.red);
                 p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
                 Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
                 if (blueteam.points >= maxpoints)
                 {
                     End();
                     return;
                 }
             }
             else
             {
                 Player.SendMessage(p, "You cant take your own flag!");
                 p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
                 Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
             }
         }
         if (p.level == mainlevel && redteam.members.Contains(p) && x == redbase.x && y == redbase.y && z == redbase.z && mainlevel.GetTile(redbase.x, redbase.y, redbase.z) != Block.air)
         {
             if (GetPlayer(p).hasflag)
             {
                 Player.GlobalMessageLevel(mainlevel, redteam.color + p.name + " RETURNED THE FLAG!");
                 GetPlayer(p).hasflag = false;
                 GetPlayer(p).points += cappoint;
                 GetPlayer(p).cap++;
                 redteam.points++;
                 mainlevel.Blockchange(bluebase.x, bluebase.y, bluebase.z, Block.blue);
                 p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
                 Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
                 if (redteam.points >= maxpoints)
                 {
                     End();
                     return;
                 }
             }
             else
             {
                 Player.SendMessage(p, "You cant take your own flag!");
                 p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
                 Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
             }
         }
     }
 }
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:72,代码来源:Auto_CTF.cs


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