Advertisement
Guest User

Untitled

a guest
Mar 6th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. package test.thatautisticboy;
  2.  
  3. import java.io.File;
  4. import java.util.Random;
  5.  
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.Location;
  8. import org.bukkit.Material;
  9. import org.bukkit.command.Command;
  10. import org.bukkit.command.CommandSender;
  11. import org.bukkit.configuration.file.FileConfiguration;
  12. import org.bukkit.entity.Player;
  13. import org.bukkit.permissions.Permission;
  14. import org.bukkit.plugin.PluginManager;
  15. import org.bukkit.plugin.java.JavaPlugin;
  16.  
  17. public class test12848 extends JavaPlugin {
  18.  
  19. FileConfiguration config;
  20. File cfile;
  21. public Permission playerPermission = new Permission ("wild.use");
  22.  
  23.  
  24. public void onEnable() {
  25. getConfig().options().copyDefaults(true);
  26. saveConfig();
  27.  
  28. }
  29.  
  30. public void onDisable() {
  31.  
  32. }
  33.  
  34. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  35.  
  36. if (cmd.getName().equalsIgnoreCase("test") && sender instanceof Player) {
  37.  
  38. Player player = (Player) sender;
  39.  
  40. if(this.getConfig().getBoolean("teleportchatenable"))
  41.  
  42. player.sendMessage(this.getConfig().getString("test").replace("&0", ChatColor.BLACK + "")
  43. .replace("&1", ChatColor.DARK_BLUE + "").replace("&2", ChatColor.GREEN + "")
  44. .replace("&3", ChatColor.DARK_AQUA + "").replace("&4", ChatColor.DARK_RED + "")
  45. .replace("&5", ChatColor.DARK_PURPLE + "").replace("&6", ChatColor.GOLD + "")
  46. .replace("&7", ChatColor.GRAY+ "").replace("&8", ChatColor.DARK_GRAY + "")
  47. .replace("&1", ChatColor.BLUE + "").replace("&a", ChatColor.GREEN + "")
  48. .replace("&b", ChatColor.AQUA + "").replace("&c", ChatColor.RED + "")
  49. .replace("&e", ChatColor.YELLOW + "").replace("&f", ChatColor.WHITE + "")
  50. .replace("&k", ChatColor.MAGIC + "").replace("&d", ChatColor.LIGHT_PURPLE + "")
  51. .replace("&l", ChatColor.BOLD + "").replace("&m", ChatColor.STRIKETHROUGH + "")
  52. .replace("&n", ChatColor.UNDERLINE + "").replace("&o", ChatColor.ITALIC + "")
  53. .replace("&r", ChatColor.RESET + "") +
  54. (player.getName())); {
  55.  
  56.  
  57. }
  58.  
  59. return true;
  60. }
  61.  
  62. return false;
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement