本文整理汇总了C#中MCForge.Entity.Player.SendBlockChangeWhereAir方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendBlockChangeWhereAir方法的具体用法?C# Player.SendBlockChangeWhereAir怎么用?C# Player.SendBlockChangeWhereAir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCForge.Entity.Player
的用法示例。
在下文中一共展示了Player.SendBlockChangeWhereAir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
public void Use(Player p, string[] args) {
string IsFlying = (string)p.ExtraData["IsFlying"];
if (IsFlying != null) {
p.OnPlayerBigMove.Normal -= OnPlayerBigMove_Normal;
p.OnPlayerBlockChange.Normal -= OnPlayerBlockChange_Normal;
if (IsFlying == "+" && glassesFlatAndMiddle != null) {
p.ResendBlockChange(glassesFlatAndMiddle, (Vector3S)p.ExtraData["FlyLastPos"]);
}
else if (IsFlying == "water" && fluidCube != null) {
p.ResendBlockChange(fluidCube, (Vector3S)p.ExtraData["FlyLastPos"]);
}
else {
p.ResendBlockChange(glassesFlat, (Vector3S)p.ExtraData["FlyLastPos"]);
}
p.ResendBlockChange(glassesFlat, (Vector3S)p.ExtraData["FlyLastPos"]);
p.ExtraData["IsFlying"] = null;
p.SendMessage(stopFlyMessage);
return;
}
Vector3S belowBlock = p.belowBlock;
if (args.Length > 0) {
if (args[0] == "+" && glassesFlatAndMiddle != null) {
p.ExtraData["IsFlying"] = "+";
p.SendBlockChangeWhereAir(glassesFlatAndMiddle, belowBlock, 20);
p.ExtraData["FlyLastPos"] = belowBlock;
}
else if (args[0].ToLower() == "water" && fluidCube != null) {
p.ExtraData["IsFlying"] = "water";
Vector3S tmp = belowBlock;
tmp.y++;
p.SendBlockChangeWhereAir(fluidCube, tmp, 9);
p.ExtraData["FlyLastPos"] = tmp;
}
else {
p.ExtraData["IsFlying"] = "normal";
p.SendBlockChangeWhereAir(glassesFlat, belowBlock, 20);
p.ExtraData["FlyLastPos"] = belowBlock;
}
}
else {
p.ExtraData["IsFlying"] = "normal";
p.SendBlockChangeWhereAir(glassesFlat, belowBlock, 20);
p.ExtraData["FlyLastPos"] = belowBlock;
}
p.OnPlayerBigMove.Normal += OnPlayerBigMove_Normal;
p.OnPlayerBlockChange.Normal += OnPlayerBlockChange_Normal;
p.SendMessage(startFlyMessage);
}
示例2: Use
public void Use(Player p, string[] args) {
p.ExtraData.CreateIfNotExist("IsFlying", false);
p.ExtraData["IsFlying"] = !(bool)p.ExtraData["IsFlying"];
if (!(bool)p.ExtraData["IsFlying"]) {
p.OnPlayerBigMove.Normal -= OnPlayerBigMove_Normal;
p.ResendBlockChange(glasses, (Vector3S)p.ExtraData["FlyLastPos"]);
return;
}
p.SendBlockChangeWhereAir(glasses, p.belowBlock, 20);
p.ExtraData["FlyLastPos"] = p.belowBlock;
p.OnPlayerBigMove.Normal += OnPlayerBigMove_Normal;
p.SendMessage("You are now flying. &cJump!");
}
示例3: OnPlayerBigMove_Normal
void OnPlayerBigMove_Normal(Player sender, API.Events.MoveEventArgs args) {
sender.ResendBlockChange(glasses, (Vector3S)sender.ExtraData["FlyLastPos"]);
sender.ExtraData["FlyLastPos"] = sender.belowBlock;
sender.SendBlockChangeWhereAir(glasses, sender.belowBlock, 20);
}