Filled PvP message disabler in certain worlds

Discussion in 'Archived: Plugin Requests' started by TNTUP, Jun 11, 2014.

  1. Offline

    TNTUP

    awww :C you did had the plugin you said earlier ._. Well, Thanks for your time, will try finding another dev

    BUMP

    I need a simple plugin that only disables PVP Death Messages in chat, not from player's chat or modifying other things, sorry

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  2. Online

    timtower Administrator Administrator Moderator

    Then you configure it to only get those messages.
     
  3. Offline

    TNTUP

    Yeah but what I want is to disable in one world, not everyworld or server... That not fullfill my request tho
     
  4. Online

    timtower Administrator Administrator Moderator

  5. Offline

    fromgate

    Thanks for idea. I think I will add world parameter to rules in MessageFilter :)
     
  6. Offline

    TNTUP


    BIG THANKS! It works, I had to unload plugin via PlugMan, then load it again to get it work =) Many big thanks

    Though I've checked from the decompiler, I can't find the command handler or permission thingy, possible to have them added? The npm.bypass and npm.reload perms, and /npm reload too.

    Also, a command "/npm add <world> and /npm remove <world>", each time a world is added/removed, the plugin reloads it automatically.

    Maybe :'), doing /npm will print plugin version, and developed by you ;3 (For TNTUP^^) heheh :)

    Sorry if I ask things =)

    no problem! I've seen the video, seems awesome :)
     
  7. Online

    timtower Administrator Administrator Moderator

    TNTUP I just set the death message to null, I don't catch it for every player.
    And commands seem a bit useless to me atm, if I add them then I would add them into a different plugin that pretty much contains multiple plugins that can be disabled.
     
  8. Offline

    TNTUP

    welp, guess I can take it as fullfilled request then, thanks for your time ^^
     
  9. Online

    timtower Administrator Administrator Moderator

    TNTUP https://www.dropbox.com/s/57w0zx4wh44wlgs/MiniLikeMe.jar
    Contains a plugin with sub plugins.
    Put this in the server, start the server, enable DeathMessage in the config, type /mlm reload, note that there will be a sub folder for DeathMessage with its own config.
    Go to a world, type /DeathMessage <enable/disable>, will disable / enable the death messages in that world. If no arguments are given then it will say if the messages are enabled or not
     
    KenoVincent likes this.
  10. Offline

    TNTUP


    Plugin is lagging the server idk why... When player dies, well I mean alot, the server starts to lag...
     
  11. Online

    timtower Administrator Administrator Moderator

    Assuming that you are talking to me: die a lot as in?
     
  12. Offline

    TNTUP

    I mean, my admin did a PVP arena without plugins, so players playing there gets killed, go warp to the arena, kill again over and over again, and suddenly it starts lagging, I can't recall if its really this plugin or chunk loading/respawn issues
     
  13. Online

    timtower Administrator Administrator Moderator

    Well, can't put less code in the plugin without breaking it. So not something I can change
     
  14. Offline

    Invisimine

    TNTUP I'm making my own version. It'll be done later today.
     
  15. Online

    timtower Administrator Administrator Moderator

    Invisimine Hardly able to get is smaller then this:
    code (open)
    Code:java
    1. @Override
    2. public void onEnable() {
    3. configFile = new CustomConfig(new File(this.getDataFolder()+File.separator+"config.yml"));
    4. configFile.saveDefaultConfig();
    5. config = configFile.getConfig();
    6. if(!config.contains("worlds")){
    7. config.set("worlds", new ArrayList<String>());
    8. }
    9. worlds = config.getStringList("worlds");
    10. getPlugin().getServer().getPluginManager().registerEvents(this, getPlugin());
    11. this.getDataFolder();
    12. }
    13.  
    14. @Override
    15. public void onDisable() {
    16. config.set("worlds", worlds);
    17. configFile.saveConfig();
    18. }
    19.  
    20. @EventHandler
    21. public void onDeath(PlayerDeathEvent event){
    22. if(worlds.contains(event.getEntity().getWorld().getName())){
    23. event.setDeathMessage(null);
    24. }
    25. }
    26.  
    27. @Override
    28. public boolean onCommand(CommandSender sender, Command cmd, String label,String[] args) {
    29. if(!(sender instanceof Player)){
    30. sender.sendMessage(this.getPlugin().getNoConsoleMessage());
    31. return true;
    32. }
    33. Player p = (Player)sender;
    34. String worldName = p.getWorld().getName();
    35. if(args.length==0){
    36. if(!worlds.contains(worldName)){
    37. p.sendMessage("Death messages are enabled in this world");
    38. }else{
    39. p.sendMessage("Death messages are disabled in this world");
    40. }
    41. return true;
    42. }
    43. if(args[0].equalsIgnoreCase("disable")){
    44. if(!worlds.contains(worldName)){
    45. worlds.add(worldName);
    46. }
    47. p.sendMessage("Death messages are now disabled");
    48. return true;
    49. }
    50. if(args[0].equals("enable")){
    51. worlds.remove(worldName);
    52. p.sendMessage("Death messages are now enabled");
    53. return true;
    54. }
    55. p.sendMessage("Unknown task");
    56. return true;
    57. }
     
  16. Offline

    Invisimine

    TNTUP
    Try my plugin. Download it here.
    Commands
    /ndm addworld - Add world to the no death messages worlds list. aka Disable death messages in current world.
    /ndm removeworld - Remove world from the no death messages worlds list. aka Enable death messages in current world.
    /ndm reload - Reload config
    Permissions
    nodeathmsg.add - Allows you to use /ndm addworld command.
    nodeathmsg.remove - Allows you to use /ndm removeworld command.
    nodeathmsg.reload - Allows you to reload the config using the /ndm reload command.
     

Share This Page