Added Event System

This commit is contained in:
patrickfreed
2012-03-01 20:16:45 -05:00
parent 54b97651b6
commit 021bf52c62
14 changed files with 458 additions and 6 deletions

View File

@@ -9,11 +9,13 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.block.Block;
import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.event.LandUnclaimEvent;
import com.massivecraft.factions.integration.LWCFeatures;
import com.massivecraft.factions.iface.RelationParticipator;
import com.massivecraft.factions.util.AsciiCompass;
@@ -82,10 +84,15 @@ public class Board
Entry<FLocation, String> entry = iter.next();
if (entry.getValue().equals(factionId))
{
if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled())
LWCFeatures.clearAllChests(entry.getKey());
LandUnclaimEvent unclaimEvent = new LandUnclaimEvent(entry.getKey(), entry.getValue());
Bukkit.getServer().getPluginManager().callEvent(unclaimEvent);
if(!unclaimEvent.isCancelled())
{
if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled())
LWCFeatures.clearAllChests(entry.getKey());
iter.remove();
iter.remove();
}
}
}
}