-
-
Save xDefcon/9a5d936568839254aa903b2688ee2805 to your computer and use it in GitHub Desktop.
Test plugin that hooks KnockbackMaster's API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.xdefcon.testplugin; | |
import com.xdefcon.knockbackmaster.api.KnockbackMasterAPI; | |
import com.xdefcon.knockbackmaster.api.events.APILoadedEvent; | |
import org.bukkit.Bukkit; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.Listener; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.bukkit.scheduler.BukkitRunnable; | |
public class Testplugin extends JavaPlugin implements Listener { | |
@Override | |
public void onEnable() { | |
this.getServer().getPluginManager().registerEvents(this, this); | |
new BukkitRunnable() { | |
@Override | |
public void run() { | |
for (Player p : Bukkit.getOnlinePlayers()) { | |
if (KnockbackMasterAPI.isInComboMode(p)) { | |
KnockbackMasterAPI.setComboMode(p, false); | |
} | |
} | |
} | |
}.runTaskTimerAsynchronously(this, 0L, 20L); | |
} | |
@EventHandler | |
public void onApiLoad(APILoadedEvent e) { | |
getServer().getLogger().info("KnockbackMaster API loaded."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment