Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hyg.hydrosis.debug;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin{
- public int counter = 0;
- @Override
- public void onEnable()
- {
- new Listeners(this);
- }
- }
- ---------------------------------------------------------------------------------------------------------------------------------------
- package hyg.hydrosis.debug;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerLoginEvent;
- import org.bukkit.event.player.PlayerLoginEvent.Result;
- public class Listeners implements Listener{
- Main plugin;
- public Listeners(Main plugin)
- {
- this.plugin = plugin;
- plugin.getServer().getPluginManager().registerEvents(this, plugin);
- }
- @EventHandler
- public void onJoin(PlayerLoginEvent event)
- {
- if(plugin.counter%2==1)
- event.disallow(Result.KICK_BANNED, "Not an even login!");
- plugin.counter++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement