Package com.bekvon.bukkit.residence.protection

Examples of com.bekvon.bukkit.residence.protection.CuboidArea


                    }
                }
                if (smanager.hasPlacedBoth(player.getName())) {
                    ClaimedResidence res = rmanager.getByName(args[2]);
                    if (res != null) {
                        res.addArea(player, new CuboidArea(smanager.getPlayerLoc1(player.getName()), smanager.getPlayerLoc2(player.getName())), args[3], resadmin);
                    } else {
                        player.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
                    }
                } else {
                    player.sendMessage(ChatColor.RED + language.getPhrase("SelectPoints"));
                }
                return true;
            } else if (args[1].equals("replace")) {
                WorldEditPlugin wep = (WorldEditPlugin) server.getPluginManager().getPlugin("WorldEdit");
                if (wep != null) {
                    if (wep.getConfig().getInt("wand-item") == Residence.getConfigManager().selectionToolId) {
                        smanager.worldEdit(player);
                    }
                }
                if (smanager.hasPlacedBoth(player.getName())) {
                    ClaimedResidence res = rmanager.getByName(args[2]);
                    if (res != null) {
                        res.replaceArea(player, new CuboidArea(smanager.getPlayerLoc1(player.getName()), smanager.getPlayerLoc2(player.getName())), args[3], resadmin);
                    } else {
                        player.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
                    }
                } else {
                    player.sendMessage(ChatColor.RED + language.getPhrase("SelectPoints"));
View Full Code Here


    }

    public void showSelectionInfo(Player player) {
        String pname = player.getName();
        if (this.hasPlacedBoth(pname)) {
            CuboidArea cuboidArea = new CuboidArea(getPlayerLoc1(pname), getPlayerLoc2(pname));
            player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Selection.Total.Size")+":"+ChatColor.DARK_AQUA+" " + cuboidArea.getSize());
            PermissionGroup group = Residence.getPermissionManager().getGroup(player);
            if(Residence.getConfigManager().enableEconomy())
            player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Land.Cost")+":"+ChatColor.DARK_AQUA+" " + ((int)Math.ceil((double)cuboidArea.getSize()*group.getCostPerBlock())));
            player.sendMessage(ChatColor.YELLOW+"X"+Residence.getLanguage().getPhrase("Size")+":"+ChatColor.DARK_AQUA+" " + cuboidArea.getXSize());
            player.sendMessage(ChatColor.YELLOW+"Y"+Residence.getLanguage().getPhrase("Size")+":"+ChatColor.DARK_AQUA+" " + cuboidArea.getYSize());
            player.sendMessage(ChatColor.YELLOW+"Z"+Residence.getLanguage().getPhrase("Size")+":"+ChatColor.DARK_AQUA+" " + cuboidArea.getZSize());
        }
        else
            player.sendMessage(ChatColor.RED+Residence.getLanguage().getPhrase("SelectPoints"));
    }
View Full Code Here

        Direction d = this.getDirection(player);
        if(d==null)
        {
            player.sendMessage(ChatColor.RED+Residence.getLanguage().getPhrase("InvalidDirection"));
        }
        CuboidArea area = new CuboidArea (playerLoc1.get(player.getName()),playerLoc2.get(player.getName()));
        if(d == Direction.UP)
        {
            int oldy = area.getHighLoc().getBlockY();
            oldy = oldy + amount;
            if(oldy>MAX_HEIGHT)
            {
                player.sendMessage(ChatColor.RED+Residence.getLanguage().getPhrase("SelectTooHigh"));
                oldy = MAX_HEIGHT;
            }
            area.getHighLoc().setY(oldy);
            if(shift)
            {
                int oldy2 = area.getLowLoc().getBlockY();
                oldy2 = oldy2 + amount;
                area.getLowLoc().setY(oldy2);
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting.Up")+"...");
            }
            else
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding.Up")+"...");
        }
        if(d == Direction.DOWN)
        {
            int oldy = area.getLowLoc().getBlockY();
            oldy = oldy - amount;
            if(oldy<MIN_HEIGHT)
            {
                player.sendMessage(ChatColor.RED + Residence.getLanguage().getPhrase("SelectTooLow"));
                oldy = MIN_HEIGHT;
            }
            area.getLowLoc().setY(oldy);
            if(shift)
            {
                int oldy2 = area.getHighLoc().getBlockY();
                oldy2 = oldy2 - amount;
                area.getHighLoc().setY(oldy2);
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting.Down")+"...");
            }
            else
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding.Down")+"...");
        }
        if(d == Direction.MINUSX)
        {
            int oldx = area.getLowLoc().getBlockX();
            oldx = oldx - amount;
            area.getLowLoc().setX(oldx);
            if(shift)
            {
                int oldx2 = area.getHighLoc().getBlockX();
                oldx2 = oldx2 - amount;
                area.getHighLoc().setX(oldx2);
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" -X...");
            }
            else
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" -X...");
        }
        if(d == Direction.PLUSX)
        {
            int oldx = area.getHighLoc().getBlockX();
            oldx = oldx + amount;
            area.getHighLoc().setX(oldx);
            if(shift)
            {
                int oldx2 = area.getLowLoc().getBlockX();
                oldx2 = oldx2 + amount;
                area.getLowLoc().setX(oldx2);
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" +X...");
            }
            else
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" +X...");
        }
        if(d == Direction.MINUSZ)
        {
            int oldz = area.getLowLoc().getBlockZ();
            oldz = oldz - amount;
            area.getLowLoc().setZ(oldz);
            if(shift)
            {
                int oldz2 = area.getHighLoc().getBlockZ();
                oldz2 = oldz2 - amount;
                area.getHighLoc().setZ(oldz2);
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" -Z...");
            }
            else
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" -Z...");
        }
        if(d == Direction.PLUSZ)
        {
            int oldz = area.getHighLoc().getBlockZ();
            oldz = oldz + amount;
            area.getHighLoc().setZ(oldz);
            if(shift)
            {
                int oldz2 = area.getLowLoc().getBlockZ();
                oldz2 = oldz2 + amount;
                area.getLowLoc().setZ(oldz2);
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Shifting")+" +Z...");
            }
            else
                player.sendMessage(ChatColor.YELLOW+Residence.getLanguage().getPhrase("Expanding")+" +Z...");
        }
        playerLoc1.put(player.getName(), area.getHighLoc());
        playerLoc2.put(player.getName(), area.getLowLoc());
    }
View Full Code Here

            if (res == null) {
                player.sendMessage(ChatColor.RED + language.getPhrase("InvalidResidence"));
                return true;
            }
            resName = res.getName();
            CuboidArea area = null;
            if (args.length > 3) {
                area = res.getArea(args[3]);
                areaName = args[3];
            } else {
                areaName = res.getAreaIDbyLoc(player.getLocation());
                area = res.getArea(areaName);
            }
            if (area != null) {
                smanager.placeLoc1(player, area.getHighLoc());
                smanager.placeLoc2(player, area.getLowLoc());
                player.sendMessage(ChatColor.GREEN + language.getPhrase("SelectionArea", ChatColor.GOLD + areaName + ChatColor.GREEN + "." + ChatColor.GOLD + resName + ChatColor.GREEN));
            } else {
                player.sendMessage(ChatColor.RED + language.getPhrase("AreaNonExist"));
            }
            return true;
View Full Code Here

TOP

Related Classes of com.bekvon.bukkit.residence.protection.CuboidArea

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.