• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WorldEditException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sk89q.worldedit.WorldEditException的典型用法代码示例。如果您正苦于以下问题:Java WorldEditException类的具体用法?Java WorldEditException怎么用?Java WorldEditException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WorldEditException类属于com.sk89q.worldedit包,在下文中一共展示了WorldEditException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setBlock

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Override
  public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException
  {
  	Player player = WorldGuardExtraFlagsPlugin.getPlugin().getServer().getPlayer(this.actor.getUniqueId());
if (WorldGuardUtils.hasBypass(player))
  	{
  		return super.setBlock(location, block);
  	}
  	else
  	{
  		if (WorldGuardExtraFlagsPlugin.getWorldGuardPlugin().getRegionContainer().createQuery().getApplicableRegions(BukkitUtil.toLocation(player.getWorld(), location)).queryValue(WorldGuardUtils.wrapPlayer(player), FlagUtils.WORLDEDIT) != State.DENY)
  		{
  			return super.setBlock(location, block);
  		}
  		else
  		{
  			return false;
  		}
  	}
  }
 
开发者ID:isokissa3,项目名称:WorldGuardExtraFlagsPlugin,代码行数:21,代码来源:WorldEditFlag.java


示例2: getMask

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
/**
 * Gets an {@link Mask} from a {@link ArgumentStack}.
 *
 * @param context the context
 * @return a pattern
 * @throws ParameterException on error
 * @throws WorldEditException on error
 */
@BindingMatch(type = Mask.class,
        behavior = BindingBehavior.CONSUMES,
        consumedCount = 1)
public Mask getMask(ArgumentStack context) throws ParameterException, WorldEditException {
    Actor actor = context.getContext().getLocals().get(Actor.class);
    ParserContext parserContext = new ParserContext();
    parserContext.setActor(context.getContext().getLocals().get(Actor.class));
    if (actor instanceof Entity) {
        Extent extent = ((Entity) actor).getExtent();
        if (extent instanceof World) {
            parserContext.setWorld((World) extent);
        }
    }
    parserContext.setSession(worldEdit.getSessionManager().get(actor));
    try {
        return worldEdit.getMaskFactory().parseFromInput(context.next(), parserContext);
    } catch (NoMatchException e) {
        throw new ParameterException(e.getMessage(), e);
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:29,代码来源:WorldEditBinding.java


示例3: rotate

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"/rotate"},
        usage = "<y-axis> [<x-axis>] [<z-axis>]",
        desc = "Rotate the contents of the clipboard",
        help = "Non-destructively rotate the contents of the clipboard.\n" +
                "Angles are provided in degrees and a positive angle will result in a clockwise rotation. " +
                "Multiple rotations can be stacked. Interpolation is not performed so angles should be a multiple of 90 degrees.\n"
)
@CommandPermissions("worldedit.clipboard.rotate")
public void rotate(Player player, LocalSession session, Double yRotate, @Optional Double xRotate, @Optional Double zRotate) throws WorldEditException {
    ClipboardHolder holder = session.getClipboard();
    AffineTransform transform = new AffineTransform();
    transform = transform.rotateY(-(yRotate != null ? yRotate : 0));
    transform = transform.rotateX(-(xRotate != null ? xRotate : 0));
    transform = transform.rotateZ(-(zRotate != null ? zRotate : 0));
    holder.setTransform(transform.combine(holder.getTransform()));
    BBC.COMMAND_ROTATE.send(player);
    if (!FawePlayer.wrap(player).hasPermission("fawe.tips"))
        BBC.TIP_FLIP.or(BBC.TIP_DEFORM, BBC.TIP_TRANSFORM).send(player);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:21,代码来源:ClipboardCommands.java


示例4: removeLayers

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"removelayers"},
        usage = "<id>",
        desc = "Removes matching chunk layers",
        help = "Remove if all the selected layers in a chunk match the provided id"
)
@CommandPermissions("worldedit.anvil.removelayer")
public void removeLayers(Player player, EditSession editSession, @Selection Region selection, int id) throws WorldEditException {
    Vector min = selection.getMinimumPoint();
    Vector max = selection.getMaximumPoint();
    int minY = min.getBlockY();
    int maxY = max.getBlockY();
    RemoveLayerFilter filter = new RemoveLayerFilter(minY, maxY, id);
    MCAFilterCounter result = runWithSelection(player, editSession, selection, filter);
    if (result != null) {
        player.print(BBC.getPrefix() + BBC.VISITOR_BLOCK.format(result.getTotal()));
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:19,代码来源:AnvilCommands.java


示例5: replaceAll

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"replaceall", "rea", "repall"},
        usage = "<folder> [from-block] <to-block>",
        desc = "Replace all blocks in the selection with another",
        help = "Replace all blocks in the selection with another\n" +
                "The -d flag disabled wildcard data matching\n",
        flags = "df",
        min = 2,
        max = 4
)
@CommandPermissions("worldedit.anvil.replaceall")
public void replaceAll(Player player, String folder, @Optional String from, String to, @Switch('d') boolean useData) throws WorldEditException {
    final FaweBlockMatcher matchFrom;
    if (from == null) {
        matchFrom = FaweBlockMatcher.NOT_AIR;
    } else {
        if (from.contains(":")) {
            useData = true; //override d flag, if they specified data they want it
        }
        matchFrom = FaweBlockMatcher.fromBlocks(worldEdit.getBlocks(player, from, true), useData);
    }
    final FaweBlockMatcher matchTo = FaweBlockMatcher.setBlocks(worldEdit.getBlocks(player, to, true));
    ReplaceSimpleFilter filter = new ReplaceSimpleFilter(matchFrom, matchTo);
    ReplaceSimpleFilter result = runWithWorld(player, folder, filter, true);
    if (result != null) player.print(BBC.getPrefix() + BBC.VISITOR_BLOCK.format(result.getTotal()));
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:27,代码来源:AnvilCommands.java


示例6: splineBrush

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"spline", "spl", "curve"},
        usage = "<pattern>",
        desc = "Join multiple objects together in a curve",
        help = "Click to select some objects,click the same block twice to connect the objects.\n" +
                "Insufficient brush radius, or clicking the the wrong spot will result in undesired shapes. The shapes must be simple lines or loops.\n" +
                "Pic1: http://i.imgur.com/CeRYAoV.jpg -> http://i.imgur.com/jtM0jA4.png\n" +
                "Pic2: http://i.imgur.com/bUeyc72.png -> http://i.imgur.com/tg6MkcF.png",
        min = 0,
        max = 2
)
@CommandPermissions("worldedit.brush.spline")
public BrushSettings splineBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("25") double radius, CommandContext context) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    player.print(BBC.getPrefix() + BBC.BRUSH_SPLINE.f(radius));
    return get(context)
            .setBrush(new SplineBrush(player, session))
            .setSize(radius)
            .setFill(fill);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:21,代码来源:BrushCommands.java


示例7: green

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"/green", "green"},
        usage = "[radius]",
        desc = "Greens the area",
        flags = "f",
        min = 0,
        max = 1
)
@CommandPermissions("worldedit.green")
@Logging(PLACEMENT)
public void green(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {

    final double size = args.argsLength() > 0 ? Math.max(1, args.getDouble(0)) : 10;
    final boolean onlyNormalDirt = !args.hasFlag('f');

    final int affected = editSession.green(session.getPlacementPosition(player), size, onlyNormalDirt);
    player.print(BBC.getPrefix() + affected + " surfaces greened.");
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:19,代码来源:UtilityCommands.java


示例8: runOperation

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
private static Operation runOperation(Operation operation, RunContext context) {
  Operation next = operation;
  while (next != null && context.shouldContinue()) {
    try {
      next = next.resume(context);
    } catch (WorldEditException e) {
      e.printStackTrace();
      return null;
    }
  }

  if (next != null) {
    return next;
  } else {
    return null;
  }
}
 
开发者ID:Skelril,项目名称:Skree,代码行数:18,代码来源:RunManager.java


示例9: hpos1

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"/hpos1"},
        usage = "",
        desc = "Set position 1 to targeted block",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.selection.hpos")
public void hpos1(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    Vector pos = player.getBlockTrace(300);

    if (pos != null) {
        if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos, ActorSelectorLimits.forActor(player))) {
            BBC.SELECTOR_ALREADY_SET.send(player);
            return;
        }

        session.getRegionSelector(player.getWorld())
                .explainPrimarySelection(player, session, pos);
    } else {
        player.printError("No block in sight!");
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:24,代码来源:SelectionCommands.java


示例10: hsphere

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"/hsphere"},
        usage = "<pattern> <radius>[,<radius>,<radius>] [raised?]",
        desc = "Generates a hollow sphere.",
        help =
                "Generates a hollow sphere.\n" +
                        "By specifying 3 radii, separated by commas,\n" +
                        "you can generate an ellipsoid. The order of the ellipsoid radii\n" +
                        "is north/south, up/down, east/west.",
        min = 2,
        max = 3
)
@CommandPermissions("worldedit.generation.sphere")
@Logging(PLACEMENT)
public void hsphere(FawePlayer fp, Player player, LocalSession session, EditSession editSession, Pattern pattern, Vector radius, @Optional("false") boolean raised, CommandContext context) throws WorldEditException, ParameterException {
    sphere(fp, player, session, editSession, pattern, radius, raised, true, context);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:18,代码来源:GenerationCommands.java


示例11: hpos2

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"/hpos2"},
        usage = "",
        desc = "Set position 2 to targeted block",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.selection.hpos")
public void hpos2(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    Vector pos = player.getBlockTrace(300);

    if (pos != null) {
        if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos, ActorSelectorLimits.forActor(player))) {
            BBC.SELECTOR_ALREADY_SET.send(player);
            return;
        }

        session.getRegionSelector(player.getWorld())
                .explainSecondarySelection(player, session, pos);
    } else {
        player.printError("No block in sight!");
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:24,代码来源:SelectionCommands.java


示例12: replace

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"/replace", "/re", "/rep", "/r"},
        usage = "[from-mask] <to-pattern>",
        desc = "Replace all blocks in the selection with another",
        flags = "f",
        min = 1,
        max = 2
)
@CommandPermissions("worldedit.region.replace")
@Logging(REGION)
public void replace(FawePlayer player, EditSession editSession, @Selection Region region, @Optional Mask from, Pattern to, CommandContext context) throws WorldEditException {
    player.checkConfirmationRegion(getArguments(context), region);
    if (from == null) {
        from = new ExistingBlockMask(editSession);
    }
    int affected = editSession.replaceBlocks(region, from, to);
    BBC.VISITOR_BLOCK.send(player, affected);
    if (!player.hasPermission("fawe.tips"))
        BBC.TIP_REPLACE_ID.or(BBC.TIP_REPLACE_LIGHT, BBC.TIP_REPLACE_MARKER, BBC.TIP_TAB_COMPLETE).send(player);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:21,代码来源:RegionCommands.java


示例13: setBlock

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Override
public boolean setBlock(final Vector location, final BaseBlock block) throws WorldEditException {
    if (super.setBlock(location, block)) {
        if (MemUtil.isMemoryLimited()) {
            if (this.player != null) {
                player.sendMessage(BBC.WORLDEDIT_CANCEL_REASON.format(BBC.WORLDEDIT_CANCEL_REASON_LOW_MEMORY.s()));
                if (Perm.hasPermission(this.player, "worldedit.fast")) {
                    BBC.WORLDEDIT_OOM_ADMIN.send(this.player);
                }
            }
            WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_LOW_MEMORY);
            return false;
        }
        return true;
    }
    return false;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:18,代码来源:MemoryCheckingExtent.java


示例14: copy

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"copypaste", "copy", "paste", "cp", "copypasta"},
        usage = "[depth=5]",
        desc = "Copy Paste brush",
        help = "Left click the base of an object to copy.\n" +
                "Right click to paste\n" +
                "The -r flag Will apply random rotation on paste\n" +
                "The -a flag Will apply auto view based rotation on paste\n" +
                "Note: Works well with the clipboard scroll action\n" +
                "Video: https://www.youtube.com/watch?v=RPZIaTbqoZw",
        min = 0,
        max = 1
)
@CommandPermissions("worldedit.brush.copy")
public BrushSettings copy(Player player, LocalSession session, @Optional("5") double radius, @Switch('r') boolean randomRotate, @Switch('a') boolean autoRotate, CommandContext context) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    player.print(BBC.getPrefix() + BBC.BRUSH_COPY.f(radius));

    return get(context)
            .setBrush(new CopyPastaBrush(player, session, randomRotate, autoRotate))
            .setSize(radius);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:23,代码来源:BrushCommands.java


示例15: setBlock

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Override
public boolean setBlock(int x, int y, int z, BaseBlock block) throws WorldEditException {
    CompoundTag nbt = block.getNbtData();
    if (nbt != null) {
        if (!limit.MAX_BLOCKSTATES()) {
            WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_TILES);
            return false;
        } else {
            if (!limit.MAX_CHANGES()) {
                WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
                return false;
            }
            return extent.setBlock(x, y, z, block);
        }
    }
    if (!limit.MAX_CHANGES()) {
        WEManager.IMP.cancelEdit(this, BBC.WORLDEDIT_CANCEL_REASON_MAX_CHANGES);
        return false;
    } else {
        return extent.setBlock(x, y, z, block);
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:23,代码来源:ProcessedWEExtent.java


示例16: surfaceBrush

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"surface", "surf"},
        usage = "<pattern> [radius=5]",
        desc = "Use a height map to paint a surface",
        help =
                "Use a height map to paint any surface.\n" +
                        "The -w flag will only apply at maximum saturation\n" +
                        "The -r flag will apply random rotation",
        min = 1,
        max = -1
)
@CommandPermissions("worldedit.brush.surface")
public BrushSettings surfaceBrush(Player player, EditSession editSession, LocalSession session, Pattern fill, @Optional("5") double radius, CommandContext context) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    return get(context).setBrush(new SurfaceSphereBrush()).setFill(fill).setSize(radius);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:BrushCommands.java


示例17: targetOffset

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"targetoffset", "to"},
        usage = "[mask]",
        desc = "Set the targeting mask",
        min = 1,
        max = -1
)
public void targetOffset(Player player, EditSession editSession, LocalSession session, int offset) throws WorldEditException {
    BrushTool tool = session.getBrushTool(player, false);
    if (tool == null) {
        BBC.BRUSH_NONE.send(player);
        return;
    }
    tool.setTargetOffset(offset);
    BBC.BRUSH_TARGET_OFFSET_SET.send(player, offset);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:BrushOptionsCommands.java


示例18: threads

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"threads"},
        usage = "",
        desc = "Print all thread stacks",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.threads")
public void threads(Actor actor) throws WorldEditException {
    Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces();
    for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet()) {
        Thread thread = entry.getKey();
        actor.printDebug("--------------------------------------------------------------------------------------------");
        actor.printDebug("Thread: " + thread.getName() + " | Id: " + thread.getId() + " | Alive: " + thread.isAlive());
        for (StackTraceElement elem : entry.getValue()) {
            actor.printDebug(elem.toString());
        }
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:20,代码来源:WorldEditCommands.java


示例19: list

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
            aliases = {"/listbrush"},
            desc = "List saved brushes",
            usage = "[mine|<filter>] [page=1]",
            min = 0,
            max = -1,
            flags = "dnp",
            help = "List all brushes in the brush directory\n" +
                    " -p <page> prints the requested page\n"
    )
    @CommandPermissions("worldedit.brush.list")
    public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException {
        String baseCmd = Commands.getAlias(BrushCommands.class, "brush") + " " + Commands.getAlias(BrushOptionsCommands.class, "loadbrush");
        File dir = MainUtil.getFile(Fawe.imp().getDirectory(), "brushes");
        UtilityCommands.list(dir, actor, args, page, null, true, baseCmd);
//                new RunnableVal2<Message, String[]>() {
//            @Override
//            public void run(Message msg, String[] info) {
//
//            }
//        });
    }
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:23,代码来源:BrushOptionsCommands.java


示例20: chunkInfo

import com.sk89q.worldedit.WorldEditException; //导入依赖的package包/类
@Command(
        aliases = {"chunkinfo"},
        usage = "",
        desc = "Get information about the chunk that you are inside",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.chunkinfo")
public void chunkInfo(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    Vector pos = player.getBlockIn();
    int chunkX = (int) Math.floor(pos.getBlockX() / 16.0);
    int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0);

    String folder1 = Integer.toString(MathUtils.divisorMod(chunkX, 64), 36);
    String folder2 = Integer.toString(MathUtils.divisorMod(chunkZ, 64), 36);
    String filename = "c." + Integer.toString(chunkX, 36)
            + "." + Integer.toString(chunkZ, 36) + ".dat";

    player.print(BBC.getPrefix() + "Chunk: " + chunkX + ", " + chunkZ);
    player.print(BBC.getPrefix() + "Old format: " + folder1 + "/" + folder2 + "/" + filename);
    player.print(BBC.getPrefix() + "McRegion: region/" + McRegionChunkStore.getFilename(
            new Vector2D(chunkX, chunkZ)));
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:24,代码来源:ChunkCommands.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JsonBuilderFactory类代码示例发布时间:2022-05-21
下一篇:
Java Offer类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap