Guest User

Untitled

a guest
Jan 26th, 2020
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.insprill.commands;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandSender;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.event.Listener;
  8. import net.insprill.cje.Main;
  9. import net.insprill.utils.Utils;
  10.  
  11. public class Version implements Listener{
  12.  
  13. private Main plugin;
  14.  
  15. public Version(Main plugin) {
  16. this.plugin = plugin;
  17.  
  18. Bukkit.getPluginManager().registerEvents(this, plugin);
  19. }
  20.  
  21. String version = plugin.getDescription().getVersion();
  22.  
  23. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  24. Player p = (Player) sender;
  25.  
  26. if (p.isOp() && p.hasPermission("cje.version") && p.hasPermission("cje.admin")) {
  27. if (cmd.getName().equalsIgnoreCase("cje")) {
  28. if (args[0].equalsIgnoreCase("version")) {
  29. sender.sendMessage(Utils.chat("&e&l==============================="));
  30. sender.sendMessage(Utils.chat("&2CJE: &a" + version));
  31. sender.sendMessage(Utils.chat("&2Server: &a" + Bukkit.getVersion()));
  32. sender.sendMessage(Utils.chat("&e&l==============================="));
  33. }
  34. }
  35. }
  36. return true;}}
RAW Paste Data