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


C# MinecraftClient.UpdateChunksAsync方法代码示例

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


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

示例1: HandlePacket

 public override void HandlePacket(MinecraftServer server, MinecraftClient client)
 {
     if (!client.ReadyToSpawn)
         return;
     client.Entity.FoodExhaustion += (float)client.Entity.GivenPosition.DistanceTo(new Vector3(X, Y, Z)) *
         (client.Entity.IsSprinting ? 0.1f : 0.01f); // TODO: Swimming
     client.Entity.GivenPosition = new Vector3(X, Y, Z);
     client.Entity.Pitch = Pitch;
     client.Entity.Yaw = Yaw;
     client.UpdateChunksAsync();
     server.ProcessSendQueue();
 }
开发者ID:Imperceptus,项目名称:Craft.Net,代码行数:12,代码来源:PlayerPositionAndLookPacket.cs

示例2: PlayerPosition

        public static void PlayerPosition(MinecraftClient client, MinecraftServer server, IPacket _packet)
        {
            var packet = (PlayerPositionPacket)_packet;
            client.Entity.FoodExhaustion += (float)client.Entity.GivenPosition.DistanceTo(
                new Vector3(packet.X, packet.Y, packet.Z)) *
                (client.Entity.IsSprinting ? 0.1f : 0.01f); // TODO: Swimming

            if ((packet.Y - client.Entity.GivenPosition.Y) > 0)
                client.Entity.PositiveDeltaY += (packet.Y - client.Entity.GivenPosition.Y);
            else
                client.Entity.PositiveDeltaY = 0;

            client.Entity.GivenPosition = new Vector3(packet.X, packet.Y, packet.Z);
            client.UpdateChunksAsync();
        }
开发者ID:ammaraskar,项目名称:Craft.Net,代码行数:15,代码来源:PlayerMovementHandlers.cs

示例3: HandlePacket

 public override void HandlePacket(MinecraftServer Server, ref MinecraftClient Client)
 {
     if (!Client.ReadyToSpawn)
         return;
     Client.Entity.Position = new Vector3(X, Y, Z);
     if (Client.Entity.Position.DistanceTo(Client.Entity.OldPosition) > 
         Client.MaxMoveDistance)
     {
         Client.SendPacket(new DisconnectPacket("Hacking: You moved too fast!"));
         Server.ProcessSendQueue();
         return;
     }
     Client.UpdateChunksAsync();
     Server.GetClientWorld(Client).EntityManager.UpdateEntity(Client.Entity);
     Server.ProcessSendQueue();
 }
开发者ID:keneo,项目名称:Craft.Net,代码行数:16,代码来源:PlayerPositionPacket.cs

示例4: HandlePacket

 public override void HandlePacket(MinecraftServer server, MinecraftClient client)
 {
     if (!client.ReadyToSpawn)
         return;
     client.Entity.Position = new Vector3(X, Y, Z);
     if (client.Entity.Position.DistanceTo(client.Entity.OldPosition) >
         client.MaxMoveDistance)
     {
         client.SendPacket(new DisconnectPacket("Hacking: You moved too fast!"));
         server.ProcessSendQueue();
         return;
     }
     client.UpdateChunksAsync();
     server.ProcessSendQueue();
     server.EntityManager.UpdateEntity(client.Entity);
 }
开发者ID:pdelvo,项目名称:Craft.Net,代码行数:16,代码来源:PlayerPositionPacket.cs


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