Skip to content

Commit

Permalink
Add UltimateCoreHook
Browse files Browse the repository at this point in the history
Signed-off-by: Staartvin <[email protected]>
  • Loading branch information
Staartvin committed Aug 14, 2015
1 parent e62a2f5 commit 303f556
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/me/staartvin/plugins/pluginlibrary/hooks/UltimateCoreHook.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package me.staartvin.plugins.pluginlibrary.hooks;

import me.staartvin.plugins.pluginlibrary.Library;
import bammerbom.ultimatecore.bukkit.UltimateCore;

/**
* UltimateCore library, <a
* href="http://dev.bukkit.org/bukkit-plugins/ultimatecore/">link</a>.
* <p>
* Date created: 17:30:19
* 14 aug. 2015
* @author Staartvin
*
*/
public class UltimateCoreHook extends LibraryHook {

private UltimateCore api;

/* (non-Javadoc)
* @see me.staartvin.plugins.pluginlibrary.hooks.LibraryHook#isAvailable()
*/
@Override
public boolean isAvailable() {
return this.getPlugin().getServer().getPluginManager()
.isPluginEnabled(Library.ULTIMATECORE.getPluginName());
}

/* (non-Javadoc)
* @see me.staartvin.plugins.pluginlibrary.hooks.LibraryHook#hook()
*/
@Override
public boolean hook() {
if (!isAvailable())
return false;

api = (UltimateCore) this.getPlugin().getServer().getPluginManager()
.getPlugin(Library.ULTIMATECORE.getPluginName());

return api != null;
}
}

0 comments on commit 303f556

Please sign in to comment.