kman2010

TDPlayerListener.java

May 6th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package me.kman2010.TD;
  2.  
  3.  
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.player.PlayerListener;
  6. import org.bukkit.event.player.PlayerLoginEvent;
  7.  
  8. public class TDPlayerListener extends PlayerListener {
  9.  
  10.     public static TD plugin;
  11.    
  12.     public TDPlayerListener(TD instance) {
  13.         plugin = instance;
  14.     }
  15.    
  16.     @Override
  17.     public void onPlayerLogin(PlayerLoginEvent event) {
  18.        
  19.         Player player = event.getPlayer();
  20.        
  21.         // Only toggle if it is not already enabled
  22.         if(!plugin.enabled(player)) {
  23.             plugin.toggleTD(player);
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment