How to check a players weather.

Discussion in 'Plugin Development' started by TaiSmoove, Jun 21, 2013.

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

    TaiSmoove

    Code:java
    1. package com.ismoovestudios.l;
    2.  
    3. import org.bukkit.ChatColor;
    4. import org.bukkit.World;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandExecutor;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Player;
    9.  
    10. import com.ismoovestudios.ww.WW;
    11.  
    12. public class WWCommandExecutor implements CommandExecutor {
    13. // Making an instance
    14. public WW plugin;
    15.  
    16. // Constructor
    17. public WWCommandExecutor(WW ww) {
    18. ww = plugin;
    19. }
    20.  
    21. public boolean onCommand(CommandSender se, Command cmd, String cmdl,
    22. String[] args) {
    23. Player pl = (Player) se;
    24. if (cmd.getName().equalsIgnoreCase("cw")
    25. || cmd.getName().equalsIgnoreCase("checkweather")) {
    26. if (se.hasPermission(new Permissions().cw)) {
    27. if (args.length == 0) {
    28. if (se instanceof Player) {
    29. World w = pl.getWorld();
    30. } else {
    31. se.sendMessage(ChatColor.RED
    32. + "["
    33. + ChatColor.YELLOW
    34. + "WW"
    35. + ChatColor.RED
    36. + "]"
    37. + " "
    38. + ChatColor.BLUE
    39. + "Sorry, I cannot find your world/weather because you are not a HumanEntity.Player! Please get In-Game to perform this command!");
    40. }
    41. }else if(args.length == 1){
    42.  
    43. }
    44. }
    45. }
    46. return false;
    47. }
    48. }
    49.  


    I still can't figure out how to check the players weather!
     
  2. Offline

    ProtoTempus

    TaiSmoove
    Code:java
    1. se.getPlayerWeather()

    You can then compare it with:
    Code:java
    1. if(se.getPlayerWeather().equals(WeatherType.???)
     
    TaiSmoove likes this.
  3. Offline

    TaiSmoove

  4. Offline

    ProtoTempus

    TaiSmoove No problem!

    Remember:
     
    TaiSmoove likes this.
Thread Status:
Not open for further replies.

Share This Page