// Path: hook/manager/src/main/java/net/novucs/ftop/entity/ChunkPos.java
// public class ChunkPos {
// 
//     private final String world;
//     private final int x;
//     private final int z;
// 
//     public static ChunkPos of(Chunk chunk) {
//         return new ChunkPos(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
//     }
// 
//     public static ChunkPos of(ChunkSnapshot snapshot) {
//         return new ChunkPos(snapshot.getWorldName(), snapshot.getX(), snapshot.getZ());
//     }
// 
//     public static ChunkPos of(String world, int x, int z) {
//         return new ChunkPos(world, x, z);
//     }
// 
//     private ChunkPos(String world, int x, int z) {
//         this.world = world;
//         this.x = x;
//         this.z = z;
//     }
// 
//     public String getWorld() {
//         return world;
//     }
// 
//     public int getX() {
//         return x;
//     }
// 
//     public int getZ() {
//         return z;
//     }
// 
//     public Chunk getChunk(Server server) {
//         if (server.getWorld(world) == null) return null;
//         return server.getWorld(world).getChunkAt(x, z);
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         ChunkPos chunkPos = (ChunkPos) o;
//         return x == chunkPos.x &&
//                 z == chunkPos.z &&
//                 Objects.equals(world, chunkPos.world);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(world, x, z);
//     }
// 
//     @Override
//     public String toString() {
//         return "ChunkPos{" +
//                 "world='" + world + '\'' +
//                 ", x=" + x +
//                 ", z=" + z +
//                 '}';
//     }
// }
// 
// Path: hook/manager/src/main/java/net/novucs/ftop/hook/event/FactionDisbandEvent.java
// public class FactionDisbandEvent extends FactionEvent {
// 
//     private static final HandlerList handlers = new HandlerList();
//     private final String name;
// 
//     public FactionDisbandEvent(String factionId, String name) {
//         super(factionId);
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     @Override
//     public HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public static HandlerList getHandlerList() {
//         return handlers;
//     }
// }
// 
// Path: hook/manager/src/main/java/net/novucs/ftop/hook/event/FactionRenameEvent.java
// public class FactionRenameEvent extends FactionEvent {
// 
//     private static final HandlerList handlers = new HandlerList();
//     private final String oldName;
//     private final String newName;
// 
//     public FactionRenameEvent(String factionId, String oldName, String newName) {
//         super(factionId);
//         this.oldName = oldName;
//         this.newName = newName;
//     }
// 
//     public String getOldName() {
//         return oldName;
//     }
// 
//     public String getNewName() {
//         return newName;
//     }
// 
//     @Override
//     public HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public static HandlerList getHandlerList() {
//         return handlers;
//     }
// }


import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.massivecraft.factions.*;
import com.massivecraft.factions.event.*;
import net.novucs.ftop.entity.ChunkPos;
import net.novucs.ftop.hook.event.*;
import net.novucs.ftop.hook.event.FactionDisbandEvent;
import net.novucs.ftop.hook.event.FactionRenameEvent;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.plugin.Plugin;
import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;
    }

    @Override
    public Set<String> getFactionIds() {
        return factions.keySet();
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onDisband(com.massivecraft.factions.event.FactionDisbandEvent event) {
        String factionId = event.getFaction().getId();
        String factionName = event.getFaction().getTag();
        callEvent(new FactionDisbandEvent(factionId, factionName));
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onRename(com.massivecraft.factions.event.FactionRenameEvent event) {
        String factionId = event.getFaction().getId();
        String oldName = event.getfPlayer().getFaction().getTag();
        String newName = event.getFactionTag();
        callEvent(new FactionRenameEvent(factionId, oldName, newName));
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onClaim(LandClaimEvent event) {
        Faction faction = Board.getInstance().getFactionAt(event.getLocation());
        Multimap<String, ChunkPos> claims = HashMultimap.create();
        claims.put(faction.getId(), getChunkPos(event.getLocation()));
        callEvent(new FactionClaimEvent(event.getFaction().getId(), claims));
    }

// Path: hook/manager/src/main/java/net/novucs/ftop/entity/ChunkPos.java
// public class ChunkPos {
// 
//     private final String world;
//     private final int x;
//     private final int z;
// 
//     public static ChunkPos of(Chunk chunk) {
//         return new ChunkPos(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
//     }
// 
//     public static ChunkPos of(ChunkSnapshot snapshot) {
//         return new ChunkPos(snapshot.getWorldName(), snapshot.getX(), snapshot.getZ());
//     }
// 
//     public static ChunkPos of(String world, int x, int z) {
//         return new ChunkPos(world, x, z);
//     }
// 
//     private ChunkPos(String world, int x, int z) {
//         this.world = world;
//         this.x = x;
//         this.z = z;
//     }
// 
//     public String getWorld() {
//         return world;
//     }
// 
//     public int getX() {
//         return x;
//     }
// 
//     public int getZ() {
//         return z;
//     }
// 
//     public Chunk getChunk(Server server) {
//         if (server.getWorld(world) == null) return null;
//         return server.getWorld(world).getChunkAt(x, z);
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         ChunkPos chunkPos = (ChunkPos) o;
//         return x == chunkPos.x &&
//                 z == chunkPos.z &&
//                 Objects.equals(world, chunkPos.world);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(world, x, z);
//     }
// 
//     @Override
//     public String toString() {
//         return "ChunkPos{" +
//                 "world='" + world + '\'' +
//                 ", x=" + x +
//                 ", z=" + z +
//                 '}';
//     }
// }
// 
// Path: hook/manager/src/main/java/net/novucs/ftop/hook/event/FactionDisbandEvent.java
// public class FactionDisbandEvent extends FactionEvent {
// 
//     private static final HandlerList handlers = new HandlerList();
//     private final String name;
// 
//     public FactionDisbandEvent(String factionId, String name) {
//         super(factionId);
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     @Override
//     public HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public static HandlerList getHandlerList() {
//         return handlers;
//     }
// }
// 
// Path: hook/manager/src/main/java/net/novucs/ftop/hook/event/FactionRenameEvent.java
// public class FactionRenameEvent extends FactionEvent {
// 
//     private static final HandlerList handlers = new HandlerList();
//     private final String oldName;
//     private final String newName;
// 
//     public FactionRenameEvent(String factionId, String oldName, String newName) {
//         super(factionId);
//         this.oldName = oldName;
//         this.newName = newName;
//     }
// 
//     public String getOldName() {
//         return oldName;
//     }
// 
//     public String getNewName() {
//         return newName;
//     }
// 
//     @Override
//     public HandlerList getHandlers() {
//         return handlers;
//     }
// 
//     public static HandlerList getHandlerList() {
//         return handlers;
//     }
// }


// Path: hook/factions-1-6/src/main/java/net/novucs/ftop/hook/Factions0106.java
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.massivecraft.factions.*;
import com.massivecraft.factions.event.*;
import net.novucs.ftop.entity.ChunkPos;
import net.novucs.ftop.hook.event.*;
import net.novucs.ftop.hook.event.FactionDisbandEvent;
import net.novucs.ftop.hook.event.FactionRenameEvent;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.plugin.Plugin;
import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;

    }

    @Override
    public Set<String> getFactionIds() {
        return factions.keySet();
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onDisband(com.massivecraft.factions.event.FactionDisbandEvent event) {
        String factionId = event.getFaction().getId();
        String factionName = event.getFaction().getTag();
        callEvent(new FactionDisbandEvent(factionId, factionName));
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onRename(com.massivecraft.factions.event.FactionRenameEvent event) {
        String factionId = event.getFaction().getId();
        String oldName = event.getfPlayer().getFaction().getTag();
        String newName = event.getFactionTag();
        callEvent(new FactionRenameEvent(factionId, oldName, newName));
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onClaim(LandClaimEvent event) {
        Faction faction = Board.getInstance().getFactionAt(event.getLocation());
        Multimap<String, ChunkPos> claims = HashMultimap.create();
        claims.put(faction.getId(), getChunkPos(event.getLocation()));
        callEvent(new FactionClaimEvent(event.getFaction().getId(), claims));
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)