Package com.sk89q.worldedit

Examples of com.sk89q.worldedit.LocalPlayer


        if (event.useItemInHand() == Result.DENY) {
            return;
        }

        final LocalPlayer player = plugin.wrapPlayer(event.getPlayer());
        final World world = player.getWorld();
        final WorldEdit we = plugin.getWorldEdit();

        Action action = event.getAction();
        if (action == Action.LEFT_CLICK_BLOCK) {
            final Block clickedBlock = event.getClickedBlock();
View Full Code Here


     *
     * @param player a player
     * @return a session
     */
    public EditSession createEditSession(Player player) {
        LocalPlayer wePlayer = wrapPlayer(player);
        LocalSession session = WorldEdit.getInstance().getSession(wePlayer);
        BlockBag blockBag = session.getBlockBag(wePlayer);

        EditSession editSession = WorldEdit.getInstance().getEditSessionFactory()
                .getEditSession(wePlayer.getWorld(), session.getBlockChangeLimit(), blockBag, wePlayer);
        editSession.enableQueue();

        return editSession;
    }
View Full Code Here

     *
     * @param player a player
     * @param editSession an edit session
     */
    public void remember(Player player, EditSession editSession) {
        LocalPlayer wePlayer = wrapPlayer(player);
        LocalSession session = WorldEdit.getInstance().getSession(wePlayer);

        session.remember(editSession);
        editSession.flushQueue();

View Full Code Here

     * @throws Throwable on any error
     * @deprecated use the regular API
     */
    @Deprecated
    public void perform(Player player, WorldEditOperation op) throws Throwable {
        LocalPlayer wePlayer = wrapPlayer(player);
        LocalSession session = WorldEdit.getInstance().getSession(wePlayer);

        EditSession editSession = createEditSession(player);
        try {
            op.run(session, wePlayer, editSession);
View Full Code Here

    @Override
    public boolean equals(Object other) {
        if (!(other instanceof LocalPlayer)) {
            return false;
        }
        LocalPlayer other2 = (LocalPlayer) other;
        return other2.getName().equals(getName());
    }
View Full Code Here

    }

    //Check if the WorldEdit selection is complete
    Region region = null;
    try {
      LocalPlayer lp = new BukkitPlayer(HawkEye.worldEdit, HawkEye.worldEdit.getWorldEdit().getServer(), player);
      LocalWorld lw = lp.getWorld();
      region = HawkEye.worldEdit.getWorldEdit().getSession(lp).getSelection(lw);
    } catch (IncompleteRegionException e) {
      Util.sendMessage(sender, "&cPlease complete your selection before doing a &7WorldEdit&c rollback!");
      return true;
    }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.LocalPlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.