Search in sources :

Example 6 with TownBlock

use of com.palmergames.bukkit.towny.object.TownBlock in project Towny by ElgarL.

the class TownySQLSource method loadTownBlocks.

@Override
public boolean loadTownBlocks() {
    String line = "";
    Boolean result = false;
    // Load town blocks
    if (!getContext())
        return false;
    ResultSet rs;
    for (TownBlock townBlock : getAllTownBlocks()) {
        try {
            Statement s = cntx.createStatement();
            rs = s.executeQuery("SELECT * FROM " + tb_prefix + "TOWNBLOCKS" + " WHERE world='" + townBlock.getWorld().getName() + "' AND x='" + townBlock.getX() + "' AND z='" + townBlock.getZ() + "'");
            while (rs.next()) {
                line = rs.getString("name");
                if (line != null)
                    try {
                        townBlock.setName(line.trim());
                    } catch (Exception e) {
                    }
                line = rs.getString("price");
                if (line != null)
                    try {
                        townBlock.setPlotPrice(Float.parseFloat(line.trim()));
                    } catch (Exception e) {
                    }
                line = rs.getString("town");
                if (line != null)
                    try {
                        Town town = getTown(line.trim());
                        townBlock.setTown(town);
                    } catch (Exception e) {
                    }
                line = rs.getString("resident");
                if (line != null && !line.isEmpty())
                    try {
                        Resident res = getResident(line.trim());
                        townBlock.setResident(res);
                    } catch (Exception e) {
                    }
                line = rs.getString("type");
                if (line != null)
                    try {
                        townBlock.setType(Integer.parseInt(line));
                    } catch (Exception e) {
                    }
                line = rs.getString("outpost");
                if (line != null)
                    try {
                        townBlock.setOutpost(Boolean.parseBoolean(line));
                    } catch (Exception e) {
                    }
                line = rs.getString("permissions");
                if ((line != null) && !line.isEmpty())
                    try {
                        townBlock.setPermissions(line.trim().replaceAll("#", ","));
                    //set = true;
                    } catch (Exception e) {
                    }
                result = rs.getBoolean("changed");
                if (result != null)
                    try {
                        townBlock.setChanged(result);
                    } catch (Exception e) {
                    }
                result = rs.getBoolean("locked");
                if (result != null)
                    try {
                        townBlock.setLocked(result);
                    } catch (Exception e) {
                    }
            }
            //				if (!set) {
            //					// no permissions found so set in relation to it's
            //					// owners perms.
            //					try {
            //						if (townBlock.hasResident()) {
            //							townBlock.setPermissions(townBlock.getResident().getPermissions().toString());
            //						} else {
            //							townBlock.setPermissions(townBlock.getTown().getPermissions().toString());
            //						}
            //					} catch (NotRegisteredException e) {
            //						// Will never reach here
            //					}
            //				}
            s.close();
        } catch (SQLException e) {
            TownyMessaging.sendErrorMsg("Loading Error: Exception while reading TownBlocks ");
            e.printStackTrace();
            return false;
        }
    }
    return true;
}
Also used : Town(com.palmergames.bukkit.towny.object.Town) SQLException(java.sql.SQLException) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) ResultSet(java.sql.ResultSet) Resident(com.palmergames.bukkit.towny.object.Resident) TownBlock(com.palmergames.bukkit.towny.object.TownBlock) NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) SQLException(java.sql.SQLException) IOException(java.io.IOException) AlreadyRegisteredException(com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException) TownyException(com.palmergames.bukkit.towny.exceptions.TownyException)

Example 7 with TownBlock

use of com.palmergames.bukkit.towny.object.TownBlock in project Towny by ElgarL.

the class TownySQLSource method loadTown.

@SuppressWarnings("deprecation")
@Override
public boolean loadTown(Town town) {
    String line;
    String[] tokens;
    TownyMessaging.sendDebugMsg("Loading town " + town.getName());
    if (!getContext())
        return false;
    try {
        Statement s = cntx.createStatement();
        ResultSet rs = s.executeQuery("SELECT * FROM " + tb_prefix + "TOWNS " + " WHERE name='" + town.getName() + "'");
        String search;
        while (rs.next()) {
            line = rs.getString("residents");
            if (line != null) {
                search = (line.contains("#")) ? "#" : ",";
                tokens = line.split(search);
                for (String token : tokens) {
                    if (!token.isEmpty()) {
                        Resident resident = getResident(token);
                        if (resident != null)
                            town.addResident(resident);
                    }
                }
            }
            town.setMayor(getResident(rs.getString("mayor")));
            // line = rs.getString("assistants");
            // if (line != null) {
            // tokens = line.split(",");
            // for (String token : tokens) {
            // if (!token.isEmpty()) {
            // Resident assistant = getResident(token);
            // if ((assistant != null) && (town.hasResident(assistant)))
            // town.addAssistant(assistant);
            // }
            // }
            // }
            town.setTownBoard(rs.getString("townBoard"));
            line = rs.getString("tag");
            if (line != null)
                try {
                    town.setTag(line);
                } catch (TownyException e) {
                    town.setTag("");
                }
            town.setPermissions(rs.getString("protectionStatus").replaceAll("#", ","));
            town.setBonusBlocks(rs.getInt("bonus"));
            town.setTaxPercentage(rs.getBoolean("taxpercent"));
            town.setTaxes(rs.getFloat("taxes"));
            town.setHasUpkeep(rs.getBoolean("hasUpkeep"));
            town.setPlotPrice(rs.getFloat("plotPrice"));
            town.setPlotTax(rs.getFloat("plotTax"));
            town.setEmbassyPlotPrice(rs.getFloat("embassyPlotPrice"));
            town.setEmbassyPlotTax(rs.getFloat("embassyPlotTax"));
            town.setCommercialPlotPrice(rs.getFloat("commercialPlotPrice"));
            town.setCommercialPlotTax(rs.getFloat("commercialPlotTax"));
            town.setOpen(rs.getBoolean("open"));
            town.setPublic(rs.getBoolean("public"));
            town.setAdminDisabledPVP(rs.getBoolean("admindisabledpvp"));
            town.setPurchasedBlocks(rs.getInt("purchased"));
            line = rs.getString("homeBlock");
            if (line != null) {
                search = (line.contains("#")) ? "#" : ",";
                tokens = line.split(search);
                if (tokens.length == 3)
                    try {
                        TownyWorld world = getWorld(tokens[0]);
                        try {
                            int x = Integer.parseInt(tokens[1]);
                            int z = Integer.parseInt(tokens[2]);
                            TownBlock homeBlock = world.getTownBlock(x, z);
                            town.forceSetHomeBlock(homeBlock);
                        } catch (NumberFormatException e) {
                            TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " homeBlock tried to load invalid location.");
                        } catch (NotRegisteredException e) {
                            TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " homeBlock tried to load invalid TownBlock.");
                        } catch (TownyException e) {
                            TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " does not have a home block.");
                        }
                    } catch (NotRegisteredException e) {
                        TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " homeBlock tried to load invalid world.");
                    }
            }
            line = rs.getString("spawn");
            if (line != null) {
                search = (line.contains("#")) ? "#" : ",";
                tokens = line.split(search);
                if (tokens.length >= 4)
                    try {
                        World world = plugin.getServerWorld(tokens[0]);
                        double x = Double.parseDouble(tokens[1]);
                        double y = Double.parseDouble(tokens[2]);
                        double z = Double.parseDouble(tokens[3]);
                        Location loc = new Location(world, x, y, z);
                        if (tokens.length == 6) {
                            loc.setPitch(Float.parseFloat(tokens[4]));
                            loc.setYaw(Float.parseFloat(tokens[5]));
                        }
                        town.forceSetSpawn(loc);
                    } catch (NumberFormatException e) {
                    } catch (NotRegisteredException e) {
                    } catch (NullPointerException e) {
                    }
                // Load outpost spawns
                line = rs.getString("outpostSpawns");
                if (line != null) {
                    String[] outposts = line.split(";");
                    for (String spawn : outposts) {
                        search = (line.contains("#")) ? "#" : ",";
                        tokens = spawn.split(search);
                        if (tokens.length >= 4)
                            try {
                                World world = plugin.getServerWorld(tokens[0]);
                                double x = Double.parseDouble(tokens[1]);
                                double y = Double.parseDouble(tokens[2]);
                                double z = Double.parseDouble(tokens[3]);
                                Location loc = new Location(world, x, y, z);
                                if (tokens.length == 6) {
                                    loc.setPitch(Float.parseFloat(tokens[4]));
                                    loc.setYaw(Float.parseFloat(tokens[5]));
                                }
                                town.forceAddOutpostSpawn(loc);
                            } catch (NumberFormatException e) {
                            } catch (NotRegisteredException e) {
                            } catch (NullPointerException e) {
                            }
                    }
                }
            }
            /*
				 * Attempt these for older databases.
				 */
            try {
                line = rs.getString("townBlocks");
                if (line != null)
                    utilLoadTownBlocks(line, town, null);
            } catch (SQLException e) {
            }
            s.close();
            return true;
        }
        s.close();
        return false;
    } catch (SQLException e) {
        TownyMessaging.sendErrorMsg("SQL: Load Town sql Error - " + e.getMessage());
    } catch (Exception e) {
        TownyMessaging.sendErrorMsg("SQL: Load Town unknown Error - ");
        e.printStackTrace();
    }
    return false;
}
Also used : NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) SQLException(java.sql.SQLException) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) World(org.bukkit.World) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) SQLException(java.sql.SQLException) IOException(java.io.IOException) AlreadyRegisteredException(com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException) TownyException(com.palmergames.bukkit.towny.exceptions.TownyException) TownyException(com.palmergames.bukkit.towny.exceptions.TownyException) ResultSet(java.sql.ResultSet) Resident(com.palmergames.bukkit.towny.object.Resident) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) TownBlock(com.palmergames.bukkit.towny.object.TownBlock) Location(org.bukkit.Location)

Example 8 with TownBlock

use of com.palmergames.bukkit.towny.object.TownBlock in project Towny by ElgarL.

the class TownyFlatFileSource method loadTown.

@Override
public boolean loadTown(Town town) {
    String line;
    String[] tokens;
    String path = getTownFilename(town);
    File fileTown = new File(path);
    if (fileTown.exists() && fileTown.isFile()) {
        try {
            KeyValueFile kvFile = new KeyValueFile(path);
            line = kvFile.get("residents");
            if (line != null) {
                tokens = line.split(",");
                for (String token : tokens) {
                    if (!token.isEmpty()) {
                        TownyMessaging.sendDebugMsg("Town Fetching Resident: " + token);
                        Resident resident = getResident(token);
                        if (resident != null) {
                            try {
                                town.addResident(resident);
                            } catch (AlreadyRegisteredException e) {
                                TownyMessaging.sendErrorMsg("Loading Error: " + resident.getName() + " is already a member of a town (" + resident.getTown().getName() + ").");
                            }
                        }
                    }
                }
            }
            line = kvFile.get("mayor");
            if (line != null)
                town.setMayor(getResident(line));
            //				line = kvFile.get("assistants");
            //				if (line != null) {
            //					tokens = line.split(",");
            //					for (String token : tokens) {
            //						if (!token.isEmpty()) {
            //							Resident assistant = getResident(token);
            //							if ((assistant != null) && (town.hasResident(assistant)))
            //								town.addAssistant(assistant);
            //						}
            //					}
            //				}
            town.setTownBoard(kvFile.get("townBoard"));
            line = kvFile.get("tag");
            if (line != null)
                try {
                    town.setTag(line);
                } catch (TownyException e) {
                    town.setTag("");
                }
            line = kvFile.get("protectionStatus");
            if (line != null)
                town.setPermissions(line);
            line = kvFile.get("bonusBlocks");
            if (line != null)
                try {
                    town.setBonusBlocks(Integer.parseInt(line));
                } catch (Exception e) {
                    town.setBonusBlocks(0);
                }
            line = kvFile.get("purchasedBlocks");
            if (line != null)
                try {
                    town.setPurchasedBlocks(Integer.parseInt(line));
                } catch (Exception e) {
                    town.setPurchasedBlocks(0);
                }
            line = kvFile.get("plotPrice");
            if (line != null)
                try {
                    town.setPlotPrice(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setPlotPrice(0);
                }
            line = kvFile.get("hasUpkeep");
            if (line != null)
                try {
                    town.setHasUpkeep(Boolean.parseBoolean(line));
                } catch (NumberFormatException nfe) {
                } catch (Exception e) {
                }
            line = kvFile.get("taxpercent");
            if (line != null)
                try {
                    town.setTaxPercentage(Boolean.parseBoolean(line));
                } catch (NumberFormatException nfe) {
                } catch (Exception e) {
                }
            line = kvFile.get("taxes");
            if (line != null)
                try {
                    town.setTaxes(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setTaxes(0);
                }
            line = kvFile.get("plotTax");
            if (line != null)
                try {
                    town.setPlotTax(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setPlotTax(0);
                }
            line = kvFile.get("commercialPlotPrice");
            if (line != null)
                try {
                    town.setCommercialPlotPrice(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setCommercialPlotPrice(0);
                }
            line = kvFile.get("commercialPlotTax");
            if (line != null)
                try {
                    town.setCommercialPlotTax(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setCommercialPlotTax(0);
                }
            line = kvFile.get("embassyPlotPrice");
            if (line != null)
                try {
                    town.setEmbassyPlotPrice(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setEmbassyPlotPrice(0);
                }
            line = kvFile.get("embassyPlotTax");
            if (line != null)
                try {
                    town.setEmbassyPlotTax(Double.parseDouble(line));
                } catch (Exception e) {
                    town.setEmbassyPlotTax(0);
                }
            line = kvFile.get("adminDisabledPvP");
            if (line != null)
                try {
                    town.setAdminDisabledPVP(Boolean.parseBoolean(line));
                } catch (NumberFormatException nfe) {
                } catch (Exception e) {
                }
            /*
				 * line = kvFile.get("mobs");
				 * if (line != null)
				 * try {
				 * town.setHasMobs(Boolean.parseBoolean(line));
				 * } catch (NumberFormatException nfe) {
				 * } catch (Exception e) {
				 * }
				 */
            line = kvFile.get("open");
            if (line != null)
                try {
                    town.setOpen(Boolean.parseBoolean(line));
                } catch (NumberFormatException nfe) {
                } catch (Exception e) {
                }
            line = kvFile.get("public");
            if (line != null)
                try {
                    town.setPublic(Boolean.parseBoolean(line));
                } catch (NumberFormatException nfe) {
                } catch (Exception e) {
                }
            /*
				 * line = kvFile.get("explosion");
				 * if (line != null)
				 * try {
				 * town.setBANG(Boolean.parseBoolean(line));
				 * } catch (NumberFormatException nfe) {
				 * } catch (Exception e) {
				 * }
				 * 
				 * line = kvFile.get("fire");
				 * if (line != null)
				 * try {
				 * town.setFire(Boolean.parseBoolean(line));
				 * } catch (NumberFormatException nfe) {
				 * } catch (Exception e) {
				 * }
				 */
            line = kvFile.get("townBlocks");
            if (line != null)
                utilLoadTownBlocks(line, town, null);
            line = kvFile.get("homeBlock");
            if (line != null) {
                tokens = line.split(",");
                if (tokens.length == 3)
                    try {
                        TownyWorld world = getWorld(tokens[0]);
                        try {
                            int x = Integer.parseInt(tokens[1]);
                            int z = Integer.parseInt(tokens[2]);
                            TownBlock homeBlock = world.getTownBlock(x, z);
                            town.forceSetHomeBlock(homeBlock);
                        } catch (NumberFormatException e) {
                            TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " homeBlock tried to load invalid location.");
                        } catch (NotRegisteredException e) {
                            TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " homeBlock tried to load invalid TownBlock.");
                        } catch (TownyException e) {
                            TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " does not have a home block.");
                        }
                    } catch (NotRegisteredException e) {
                        TownyMessaging.sendErrorMsg("[Warning] " + town.getName() + " homeBlock tried to load invalid world.");
                    }
            }
            line = kvFile.get("spawn");
            if (line != null) {
                tokens = line.split(",");
                if (tokens.length >= 4)
                    try {
                        World world = plugin.getServerWorld(tokens[0]);
                        double x = Double.parseDouble(tokens[1]);
                        double y = Double.parseDouble(tokens[2]);
                        double z = Double.parseDouble(tokens[3]);
                        Location loc = new Location(world, x, y, z);
                        if (tokens.length == 6) {
                            loc.setPitch(Float.parseFloat(tokens[4]));
                            loc.setYaw(Float.parseFloat(tokens[5]));
                        }
                        town.forceSetSpawn(loc);
                    } catch (NumberFormatException e) {
                    } catch (NotRegisteredException e) {
                    } catch (NullPointerException e) {
                    }
            }
            // Load outpost spawns
            line = kvFile.get("outpostspawns");
            if (line != null) {
                String[] outposts = line.split(";");
                for (String spawn : outposts) {
                    tokens = spawn.split(",");
                    if (tokens.length >= 4)
                        try {
                            World world = plugin.getServerWorld(tokens[0]);
                            double x = Double.parseDouble(tokens[1]);
                            double y = Double.parseDouble(tokens[2]);
                            double z = Double.parseDouble(tokens[3]);
                            Location loc = new Location(world, x, y, z);
                            if (tokens.length == 6) {
                                loc.setPitch(Float.parseFloat(tokens[4]));
                                loc.setYaw(Float.parseFloat(tokens[5]));
                            }
                            town.forceAddOutpostSpawn(loc);
                        } catch (NumberFormatException e) {
                        } catch (NotRegisteredException e) {
                        } catch (NullPointerException e) {
                        }
                }
            }
        } catch (Exception e) {
            TownyMessaging.sendErrorMsg("Loading Error: Exception while reading town file " + town.getName());
            return false;
        }
        return true;
    } else
        return false;
}
Also used : NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) AlreadyRegisteredException(com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException) KeyValueFile(com.palmergames.util.KeyValueFile) World(org.bukkit.World) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) IOException(java.io.IOException) EOFException(java.io.EOFException) FileNotFoundException(java.io.FileNotFoundException) AlreadyRegisteredException(com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException) InvalidNameException(javax.naming.InvalidNameException) TownyException(com.palmergames.bukkit.towny.exceptions.TownyException) TownyException(com.palmergames.bukkit.towny.exceptions.TownyException) Resident(com.palmergames.bukkit.towny.object.Resident) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) File(java.io.File) KeyValueFile(com.palmergames.util.KeyValueFile) TownBlock(com.palmergames.bukkit.towny.object.TownBlock) Location(org.bukkit.Location)

Example 9 with TownBlock

use of com.palmergames.bukkit.towny.object.TownBlock in project Towny by ElgarL.

the class TownyBlockListener method testBlockMove.

private boolean testBlockMove(Block block, BlockFace direction) {
    Block blockTo = block.getRelative(direction);
    Location loc = block.getLocation();
    Location locTo = blockTo.getLocation();
    Coord coord = Coord.parseCoord(loc);
    Coord coordTo = Coord.parseCoord(locTo);
    TownyWorld townyWorld = null;
    TownBlock CurrentTownBlock = null, destinationTownBlock = null;
    try {
        townyWorld = TownyUniverse.getDataSource().getWorld(loc.getWorld().getName());
        CurrentTownBlock = townyWorld.getTownBlock(coord);
    } catch (NotRegisteredException e) {
    //System.out.print("Failed to fetch TownBlock");
    }
    try {
        destinationTownBlock = townyWorld.getTownBlock(coordTo);
    } catch (NotRegisteredException e1) {
    //System.out.print("Failed to fetch TownBlockTo");
    }
    if (CurrentTownBlock != destinationTownBlock) {
        // Cancel if either is not null, but other is (wild to town).
        if (((CurrentTownBlock == null) && (destinationTownBlock != null)) || ((CurrentTownBlock != null) && (destinationTownBlock == null))) {
            //event.setCancelled(true);
            return true;
        }
        // If both blocks are owned by the town.
        if (!CurrentTownBlock.hasResident() && !destinationTownBlock.hasResident())
            return false;
        try {
            if ((!CurrentTownBlock.hasResident() && destinationTownBlock.hasResident()) || (CurrentTownBlock.hasResident() && !destinationTownBlock.hasResident()) || (CurrentTownBlock.getResident() != destinationTownBlock.getResident()) || (CurrentTownBlock.getPlotPrice() != -1) || (destinationTownBlock.getPlotPrice() != -1)) {
                return true;
            }
        } catch (NotRegisteredException e) {
            // Failed to fetch a resident
            return true;
        }
    }
    return false;
}
Also used : WorldCoord(com.palmergames.bukkit.towny.object.WorldCoord) Coord(com.palmergames.bukkit.towny.object.Coord) NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) Block(org.bukkit.block.Block) TownBlock(com.palmergames.bukkit.towny.object.TownBlock) TownyWorld(com.palmergames.bukkit.towny.object.TownyWorld) TownBlock(com.palmergames.bukkit.towny.object.TownBlock) Location(org.bukkit.Location) BlockLocation(com.palmergames.bukkit.towny.regen.block.BlockLocation)

Example 10 with TownBlock

use of com.palmergames.bukkit.towny.object.TownBlock in project Towny by ElgarL.

the class PlotClaim method residentUnclaim.

private boolean residentUnclaim(WorldCoord worldCoord) throws TownyException {
    try {
        TownBlock townBlock = worldCoord.getTownBlock();
        townBlock.setResident(null);
        townBlock.setPlotPrice(townBlock.getTown().getPlotTypePrice(townBlock.getType()));
        // Set the plot permissions to mirror the towns.
        townBlock.setType(townBlock.getType());
        TownyUniverse.getDataSource().saveTownBlock(townBlock);
        plugin.updateCache(worldCoord);
    } catch (NotRegisteredException e) {
        throw new TownyException(TownySettings.getLangString("msg_not_own_place"));
    }
    return true;
}
Also used : NotRegisteredException(com.palmergames.bukkit.towny.exceptions.NotRegisteredException) TownBlock(com.palmergames.bukkit.towny.object.TownBlock) TownyException(com.palmergames.bukkit.towny.exceptions.TownyException)

Aggregations

TownBlock (com.palmergames.bukkit.towny.object.TownBlock)34 NotRegisteredException (com.palmergames.bukkit.towny.exceptions.NotRegisteredException)28 TownyException (com.palmergames.bukkit.towny.exceptions.TownyException)16 TownyWorld (com.palmergames.bukkit.towny.object.TownyWorld)12 Resident (com.palmergames.bukkit.towny.object.Resident)11 Town (com.palmergames.bukkit.towny.object.Town)8 AlreadyRegisteredException (com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException)7 Coord (com.palmergames.bukkit.towny.object.Coord)7 WorldCoord (com.palmergames.bukkit.towny.object.WorldCoord)7 ArrayList (java.util.ArrayList)7 IOException (java.io.IOException)5 Location (org.bukkit.Location)5 BlockLocation (com.palmergames.bukkit.towny.regen.block.BlockLocation)4 World (org.bukkit.World)4 Block (org.bukkit.block.Block)4 Nation (com.palmergames.bukkit.towny.object.Nation)3 EventHandler (org.bukkit.event.EventHandler)3 EconomyException (com.palmergames.bukkit.towny.exceptions.EconomyException)2 KeyValueFile (com.palmergames.util.KeyValueFile)2 EOFException (java.io.EOFException)2