Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.73 KB | None | 0 0
  1. package fr.herllox.hsessentials;
  2.  
  3. import org.bukkit.entity.Player;
  4. import org.bukkit.event.EventHandler;
  5. import org.bukkit.event.Listener;
  6. import org.bukkit.event.player.PlayerJoinEvent;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. import fr.herllox.commands.AdminCommands;
  10. import fr.herllox.commands.Commands;
  11.  
  12. public class Main extends JavaPlugin implements Listener{
  13.    
  14.     private Main main;
  15.  
  16.     @Override
  17.    
  18.     public void onEnable() {
  19.         getServer().getPluginManager().registerEvents(this, this);
  20.         saveDefaultConfig();
  21.        
  22.         System.out.println("========================");
  23.         System.out.println("Plugin HSEssentials Start");
  24.         System.out.println("========================");
  25.        
  26.         getCommand("vanish").setExecutor(new AdminCommands(this));
  27.         getCommand("setspawn").setExecutor(new AdminCommands(this));
  28.         getCommand("spawn").setExecutor(new AdminCommands(this));
  29.         getCommand("gamemode").setExecutor(new AdminCommands(this));
  30.        
  31.         getCommand("fly").setExecutor(new Commands(this));
  32.         getCommand("msg").setExecutor(new Commands(this));
  33.         getCommand("feed").setExecutor(new Commands(this));
  34.         getCommand("heal").setExecutor(new Commands(this));
  35.         getCommand("ping").setExecutor(new Commands(this));
  36.         getCommand("craft").setExecutor(new Commands(this));
  37.         getCommand("enderchest").setExecutor(new Commands(this));
  38.        
  39.        
  40.     }
  41.    
  42.     @EventHandler
  43.     public void OnPlayerJoin(PlayerJoinEvent event) {
  44.         Player player = event.getPlayer();
  45.         event.setJoinMessage(main.getConfig().getString("Messages.JoinMessage") +player.getName());
  46.     }
  47.        
  48.    
  49.  
  50.    
  51.     public void onDisable() {
  52.        
  53.         System.out.println("========================");
  54.         System.out.println("Plugin HSEssentials Stop");
  55.         System.out.println("========================");
  56.        
  57.     }
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement