Make sure the selection is a cuboid

This commit is contained in:
cmastudios 2013-06-11 23:11:25 -05:00
parent 21688ba4d0
commit 5c954a19b4

View File

@ -1,6 +1,7 @@
package com.tommytony.war.command;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
import com.sk89q.worldedit.bukkit.selections.Selection;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -32,7 +33,7 @@ public class SetZoneCommand extends AbstractZoneMakerCommand {
if (War.war.getServer().getPluginManager().isPluginEnabled("WorldEdit")) {
WorldEditPlugin worldEdit = (WorldEditPlugin) War.war.getServer().getPluginManager().getPlugin("WorldEdit");
Selection selection = worldEdit.getSelection(player);
if (selection != null) {
if (selection != null && selection instanceof CuboidSelection) {
Location min = selection.getMinimumPoint();
Location max = selection.getMaximumPoint();
ZoneSetter setter = new ZoneSetter(player, this.args[0]);