diff --git a/lib/capi.jar b/lib/capi.jar index d85c4230..7659562e 100644 Binary files a/lib/capi.jar and b/lib/capi.jar differ diff --git a/src/com/massivecraft/factions/integration/capi/CapiFeatures.java b/src/com/massivecraft/factions/integration/capi/CapiFeatures.java index f50c09ad..c1dbc013 100644 --- a/src/com/massivecraft/factions/integration/capi/CapiFeatures.java +++ b/src/com/massivecraft/factions/integration/capi/CapiFeatures.java @@ -1,8 +1,6 @@ package com.massivecraft.factions.integration.capi; import org.bukkit.Bukkit; -import org.bukkit.event.Event; -import org.bukkit.event.Event.Priority; import org.bukkit.plugin.Plugin; import com.massivecraft.factions.P; @@ -15,7 +13,7 @@ public class CapiFeatures if (plug != null && plug.getClass().getName().equals("com.massivecraft.capi.P")) { P.p.log("Integration with the CAPI plugin was successful"); - P.p.registerEvent(Event.Type.CUSTOM_EVENT, new PluginCapiListener(P.p), Priority.Normal); + Bukkit.getPluginManager().registerEvents(new PluginCapiListener(P.p), P.p); } } } diff --git a/src/com/massivecraft/factions/integration/capi/PluginCapiListener.java b/src/com/massivecraft/factions/integration/capi/PluginCapiListener.java index d8c5f587..85d5e765 100644 --- a/src/com/massivecraft/factions/integration/capi/PluginCapiListener.java +++ b/src/com/massivecraft/factions/integration/capi/PluginCapiListener.java @@ -5,6 +5,9 @@ import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; import com.massivecraft.capi.Channel; import com.massivecraft.capi.Channels; @@ -12,14 +15,13 @@ import com.massivecraft.capi.events.CAPIListChannelsEvent; import com.massivecraft.capi.events.CAPIMessageToChannelEvent; import com.massivecraft.capi.events.CAPIMessageToPlayerEvent; import com.massivecraft.capi.events.CAPISelectChannelEvent; -import com.massivecraft.capi.listeners.CapiListener; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Faction; import com.massivecraft.factions.P; import com.massivecraft.factions.struct.Rel; -public class PluginCapiListener extends CapiListener +public class PluginCapiListener implements Listener { P p; @@ -50,7 +52,7 @@ public class PluginCapiListener extends CapiListener return format; } - @Override + @EventHandler(priority = EventPriority.NORMAL) public void onListChannelsEvent(CAPIListChannelsEvent event) { for (Channel c : Channels.i.getAll()) @@ -62,7 +64,7 @@ public class PluginCapiListener extends CapiListener } } - @Override + @EventHandler(priority = EventPriority.NORMAL) public void onMessageToChannel(CAPIMessageToChannelEvent event) { if (event.isCancelled()) return; @@ -89,14 +91,14 @@ public class PluginCapiListener extends CapiListener } } - @Override + @EventHandler(priority = EventPriority.NORMAL) public void onMessageToPlayer(CAPIMessageToPlayerEvent event) { if (event.isCancelled()) return; event.setFormat(this.replacePlayerTags(event.getFormat(), FPlayers.i.get(event.getMe()), FPlayers.i.get(event.getYou()))); } - @Override + @EventHandler(priority = EventPriority.NORMAL) public void onSelectChannel(CAPISelectChannelEvent event) { if (event.isCancelled()) return;