GetPosCmd.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:Wurst-MC-1.12 作者:
@Override
public void call(String[] args) throws CmdException
{
    if(args.length > 1)
        throw new CmdSyntaxError();
    BlockPos blockpos = new BlockPos(WMinecraft.getPlayer());
    String pos =
        blockpos.getX() + " " + blockpos.getY() + " " + blockpos.getZ();
    if(args.length == 0)
        ChatUtils.message("Position: " + pos);
    else if(args.length == 1 && args[0].equalsIgnoreCase("copy"))
    {
        Toolkit.getDefaultToolkit().getSystemClipboard()
            .setContents(new StringSelection(pos), null);
        ChatUtils.message("Position copied to clipboard.");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号