Disable a class

Discussion in 'Plugin Development' started by Giorgio, Dec 30, 2012.

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

    Giorgio

    `I was wondering how to disable a class, for instants when a player goes into the config.yml. I want to add a line saying something like this "Disablewarps: true ," and this will disable the whole class in order to stop all commands and events for it. Is it possible or a close way of doing so and if so can you provide an example since im more of a visual learner. Thank you :)
     
  2. Offline

    Sagacious_Zed Bukkit Docs

    You don't disable the class, you disable to commands and unregister the events.
     
  3. Offline

    Giorgio

  4. Offline

    Sagacious_Zed Bukkit Docs

    You unregister and event with a method call. You have to handle your own logic as to when a command has been disabled.
     
  5. Offline

    Giorgio

  6. Offline

    chasechocolate

    In your main class:
    Code:java
    1. public Boolean warpsEnabled = this.getConfig().getBoolean("warpsenabled");

    In your listener, check if the warpsEnabled is true, then allow the player to do whatever (commands, etc.)
     
  7. Offline

    Giorgio

Thread Status:
Not open for further replies.

Share This Page