CmdSetcorners.java 文件源码

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

项目:World-Border 作者:
@Override
public void execute(ICommandSender sender, EntityPlayerMP player, List<String> params, String worldName)
{
    if (worldName == null)
        worldName = Worlds.getWorldName(player.worldObj);
    else
    {
        WorldServer worldTest = Worlds.getWorld(worldName);
        if (worldTest == null)
            Util.chat(sender, "The world you specified (\"" + worldName + "\") could not be found on the server, but data for it will be stored anyway.");
    }

    try
    {
        double x1 = Double.parseDouble(params.get(0));
        double z1 = Double.parseDouble(params.get(1));
        double x2 = Double.parseDouble(params.get(2));
        double z2 = Double.parseDouble(params.get(3));
        Config.setBorderCorners(worldName, x1, z1, x2, z2);
    }
    catch(NumberFormatException ex)
    {
        sendErrorAndHelp(sender, "The x1, z1, x2, and z2 coordinate values must be numerical.");
        return;
    }

    if(player != null)
        Util.chat(sender, "Border has been set. " + Config.BorderDescription(worldName));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号