Solved Please tell me how to Hide Plugin!!

Discussion in 'Plugin Development' started by Ishityu, Jan 22, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    timtower Administrator Administrator Moderator

    @Ishityu And that is why I wanted to see the full server log, because I expect that you have an error on startup of the plugin in the onEnable.
     
  2. Offline

    Ishityu

    I use a rental server. So, I can watch only a thing like a while ago...
    Perhaps, I may get a wrong meaning of log.
     
  3. Offline

    timtower Administrator Administrator Moderator

    You are looking in the console itself.
    Log is <server directory>/logs/latest.log
    And I would suggest a localhost server for developing, saves a lot of time uploading etc.
     
  4. Offline

    Ishityu

    https://pastebin.com/9kn2J1E5
    Is that right?
     
  5. Offline

    timtower Administrator Administrator Moderator

    @Ishityu Stop the server, delete the file, start the server, stop the server, post the new log.
    Never use reload.
    And also make sure that your plugin is only in the server once.
     
  6. Offline

    Ishityu

    The commands are usable, but files are not generated.
     
  7. Offline

    timtower Administrator Administrator Moderator

    I am out.
    Hope you figure it out.
     
  8. Offline

    Ishityu

    Sorry, thank you until now.
     
  9. Offline

    Colinus999

    Which file? The config file? I think you need to run createConfig() if it does not exist.
     
  10. Offline

    timtower Administrator Administrator Moderator

    That method doesn't exist.
     
  11. Offline

    Colinus999

  12. Offline

    timtower Administrator Administrator Moderator

  13. Offline

    Colinus999

    But it creates a config if it does not exist.
     
  14. Offline

    user_91277742

    You dont need to create a method to create a config, maybe a method to save and load the config..
     
  15. Offline

    d3v190

    I'll assume the reason why you get errors when running the command is because the section you are trying to get string from is null and the configuration file itself is not present.

    If you manually made a config.yml in your source, you can get it by writing this on your onEnable()
    Code:
    getConfig().options().copyDefaults(true);
    saveConfig();
    
    or
    Code:
    saveDefaultConfig();
    
    That case the plugin will load the config.yml

    And I noticed a thing. In,

    Code:
    for (Player allplayer : getServer().getOnlinePlayers()) {
        if (!allplayer.isOp()) {
            player.hidePlayer(allplayer);
        }
    }
    
    This actually hides all the online players except OPs from the sender. Are you sure this is what you are trying to achieve? If not, try reversing it. allplayer.hidePlayer(player); this will hide the sender from all players except OPs.
     
    user_91277742 likes this.
  16. Offline

    Ishityu

    Could you tell me more?

    Thank you very much!!
    Those problems were all resolved.
    By the way,
    Code:
    for (Player allplayer : getServer().getOnlinePlayers()) {
        if (!allplayer.isOp()) {
            player.hidePlayer(allplayer);
        }
    }
    
    It is all right as it is here.:)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 24, 2018
Thread Status:
Not open for further replies.

Share This Page