DUYSONGLOI

sida src

Jan 29th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.66 KB | None | 0 0
  1. package duy.doge.kiki;
  2.  
  3. import java.util.logging.Logger;
  4. import org.bukkit.Bukkit;
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.Location;
  7. import org.bukkit.Server;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.command.ConsoleCommandSender;
  11. import org.bukkit.entity.Player;
  12. import org.bukkit.event.Listener;
  13. import org.bukkit.plugin.PluginManager;
  14. import org.bukkit.plugin.java.JavaPlugin;
  15. import org.bukkit.scheduler.BukkitScheduler;
  16.  
  17. public class Main
  18.   extends JavaPlugin
  19.   implements Listener
  20. {
  21.   public void onEnable()
  22.   {
  23.     Bukkit.getConsoleSender().sendMessage("&7[&6PackMusic&7] &aPlugins has been enable".replace("&", "�"));
  24.    
  25.     getServer().getPluginManager().registerEvents(this, this);
  26.   }
  27.  
  28.   public void onDisable()
  29.   {
  30.     getLogger().info(ChatColor.DARK_RED + "Pai pai................................");
  31.   }
  32.  
  33.   public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  34.   {
  35.     if (!(sender instanceof Player))
  36.     {
  37.       sender.sendMessage("You must be a player to use commands");
  38.       return true;
  39.     }
  40.     final Player p = (Player)sender;
  41.     Location loc = p.getEyeLocation();
  42.     if ((cmd.getName().equalsIgnoreCase("packmusic")) ||
  43.    
  44.       (args.length == 0))
  45.     {
  46.       sender.sendMessage("�c�lPackMusic >>");
  47.       sender.sendMessage("�b/packmusic stop");
  48.       sender.sendMessage("�b/packmusic Night_17 - Taku");
  49.       sender.sendMessage("�b/packmusic Happy_New_Year - ABBA");
  50.       sender.sendMessage("�b/packmusic ROSES - Chainsmoker");
  51.       sender.sendMessage("�b/packmusic Tet_dong_day - Kay Tr?n");
  52.       sender.sendMessage("�b/packmusic Beo_dat_may_troi - Anh Th?ng");
  53.       sender.sendMessage("");
  54.       sender.sendMessage("�7V� m?t s? b�i nh?c kh�c");
  55.      
  56.       return true;
  57.     }
  58.     if (args[0].equalsIgnoreCase("stop"))
  59.     {
  60.       p.stopSound("Happy_New_Year");
  61.       p.stopSound("ROSES");
  62.       p.stopSound("Tet_dong_day");
  63.       p.stopSound("Beo_dat_may_troi");
  64.       p.stopSound("Night-17");
  65.      
  66.       p.sendMessage(ChatColor.GREEN + "�? t?t nh?c");
  67.     }
  68.     if (args[0].equalsIgnoreCase("Night_17"))
  69.     {
  70.       p.stopSound("Happy_New_Year");
  71.       p.stopSound("ROSES");
  72.       p.stopSound("Tet_dong_day");
  73.       p.stopSound("Beo_dat_may_troi");
  74.       p.sendMessage("�ang ch�i nh?c Night-17......");
  75.      
  76.       Bukkit.getScheduler().runTaskLater(this, new Runnable()
  77.       {
  78.         public void run()
  79.         {
  80.           p.playSound(p.getLocation(), "Night-17", 500.0F, 1.0F);
  81.         }
  82.       }, 20L);
  83.      
  84.       return true;
  85.     }
  86.     if (args[0].equalsIgnoreCase("Happy_New_Year"))
  87.     {
  88.       p.stopSound("Night-17");
  89.       p.stopSound("ROSES");
  90.       p.stopSound("Tet_dong_day");
  91.       p.stopSound("Beo_dat_may_troi");
  92.       p.sendMessage("�ang ch�i nh?c Happy New Year......");
  93.      
  94.       Bukkit.getScheduler().runTaskLater(this, new Runnable()
  95.       {
  96.         public void run()
  97.         {
  98.           p.playSound(p.getLocation(), "Happy_New_Year", 500.0F, 1.0F);
  99.         }
  100.       }, 20L);
  101.      
  102.       return true;
  103.     }
  104.     if (args[0].equalsIgnoreCase("ROSES"))
  105.     {
  106.       p.stopSound("Night-17");
  107.       p.stopSound("Happy_New_Year");
  108.       p.stopSound("Tet_dong_day");
  109.       p.stopSound("Beo_dat_may_troi");
  110.       p.sendMessage("�ang ch�i nh?c ROSES......");
  111.      
  112.       Bukkit.getScheduler().runTaskLater(this, new Runnable()
  113.       {
  114.         public void run()
  115.         {
  116.           p.playSound(p.getLocation(), "ROSES", 500.0F, 50.0F);
  117.         }
  118.       }, 20L);
  119.      
  120.       return true;
  121.     }
  122.     if (args[0].equalsIgnoreCase("Tet_dong_day"))
  123.     {
  124.       p.stopSound("Night-17");
  125.       p.stopSound("Happy_New_Year");
  126.       p.stopSound("ROSES");
  127.       p.stopSound("Beo_dat_may_troi");
  128.       p.sendMessage("�ang ch�i nh?c T?t �ong �?y......");
  129.      
  130.       Bukkit.getScheduler().runTaskLater(this, new Runnable()
  131.       {
  132.         public void run()
  133.         {
  134.           p.playSound(p.getLocation(), "Tet_dong_day", 500.0F, 1.0F);
  135.         }
  136.       }, 20L);
  137.      
  138.       return true;
  139.     }
  140.     if (args[0].equalsIgnoreCase("Beo_dat_may_troi"))
  141.     {
  142.       p.stopSound("Night-17");
  143.       p.stopSound("Happy_New_Year");
  144.       p.stopSound("ROSES");
  145.       p.stopSound("Tet_dong_day");
  146.       p.sendMessage("�ang ch�i nh?c B�o d?t m�y tr�i......");
  147.      
  148.       Bukkit.getScheduler().runTaskLater(this, new Runnable()
  149.       {
  150.         public void run()
  151.         {
  152.           p.playSound(p.getLocation(), "Beo_dat_may_troi", 500.0F, 1.0F);
  153.         }
  154.       }, 20L);
  155.      
  156.       return true;
  157.     }
  158.     return true;
  159.   }
  160. }
Advertisement
Add Comment
Please, Sign In to add comment