Search in sources :

Example 36 with TownBlock

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

the class TownyFlatFileSource method saveTownBlockList.

/*
	 * Save keys
	 */
@Override
public boolean saveTownBlockList() {
    List<String> list = new ArrayList<String>();
    for (TownBlock townBlock : getAllTownBlocks()) {
        list.add(townBlock.getWorld().getName() + "," + townBlock.getX() + "," + townBlock.getZ());
    }
    /*
		 *  Make sure we only save in async
		 */
    this.queryQueue.add(new FlatFile_Task(list, rootFolder + dataFolder + FileMgmt.fileSeparator() + "townblocks.txt"));
    return true;
}
Also used : ArrayList(java.util.ArrayList) TownBlock(com.palmergames.bukkit.towny.object.TownBlock)

Aggregations

TownBlock (com.palmergames.bukkit.towny.object.TownBlock)36 NotRegisteredException (com.palmergames.bukkit.towny.exceptions.NotRegisteredException)30 TownyException (com.palmergames.bukkit.towny.exceptions.TownyException)17 TownyWorld (com.palmergames.bukkit.towny.object.TownyWorld)13 Resident (com.palmergames.bukkit.towny.object.Resident)11 Town (com.palmergames.bukkit.towny.object.Town)9 WorldCoord (com.palmergames.bukkit.towny.object.WorldCoord)9 Coord (com.palmergames.bukkit.towny.object.Coord)8 AlreadyRegisteredException (com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException)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