/**
 *
 */
package pw.yumc.Residence.selection;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

import com.bekvon.bukkit.residence.protection.ClaimedResidence;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
import com.sk89q.worldedit.bukkit.selections.Selection;

/**
 * @author Administrator
 *
 */
public class WECUI {
    public static void UPDATESELECT(final ClaimedResidence res, final Player player) {
        final WorldEditPlugin wep = (WorldEditPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
        final Selection selection = new CuboidSelection(Bukkit.getWorld(res.getWorld()), res.getAreaByLoc(player.getLocation()).getLowLoc(), res.getAreaByLoc(player.getLocation()).getHighLoc());
        wep.setSelection(player, selection);
    }
}