本文整理汇总了C#中MCForge.Player.click方法的典型用法代码示例。如果您正苦于以下问题:C# Player.click方法的具体用法?C# Player.click怎么用?C# Player.click使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCForge.Player
的用法示例。
在下文中一共展示了Player.click方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
public void Use(Player p, string[] args)
{
//if (p == null) stuff here, not sure if should add yet or not since Console cannot do commands at the moment.
Point3 click = p.lastClick;
if (args.Length == 0)
{
click = p.lastClick;
}
else if (args.Length == 3)
{
try
{
for (int value = 0; value < 3; value++)
{
switch (args[value].ToLower())
{
case "x":
click.x = p.lastClick.x;
break;
case "z":
click.z = p.lastClick.z;
break;
case "y":
click.y = p.lastClick.y;
break;
default:
if (isValid(args[value], value, p))
{
switch (value)
{
case 0:
click.x = short.Parse(args[0]);
break;
case 1:
click.z = short.Parse(args[1]);
break;
case 2:
click.y = short.Parse(args[2]);
break;
}
}
else
{
p.SendMessage("\"" + args[value] + "\" was not valid");
return;
}
break;
}
}
}
catch (Exception e)
{
Server.Log(e);
return;
}
}
else
{
p.SendMessage("Invalid arguments");
return;
}
p.click((ushort)click.x, (ushort)click.z, (ushort)click.y, (byte)(Blocks.Types.stone));
p.SendMessage("Click &b(" + click.x + ", " + click.z + ", " + click.y + ").");
}