Solved Problem with EASY code

Discussion in 'Plugin Development' started by foldagerdk, Jan 11, 2013.

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

    foldagerdk

    Solved - See bottom post for more info.



    Hey!
    I need some help on my OreNotifier plugin.
    It broke a few updates ago, and I am unsure on what to update.

    It would be of great help if someone could tell me where I need an update!

    Orelis class
    http://pastebin.com/yHdQbLRY

    Notif class
    http://pastebin.com/5vYCzyf5
     
  2. Offline

    Deckerz

    It looks like there's nothing wrong to me at a glance
     
  3. Offline

    skipperguy12

    Looks fine with a quick glance. Try debugging it, how far does it get? For your listener, why not just use else if?

    Are there any console errors? We need to know how far the code gets. Does the server even see the plugin? Try typing /pl in game or console.
     
  4. Offline

    foldagerdk

  5. Offline

    Retherz_

    i can send u a better way to check ores
     
  6. Offline

    Scipione

    try:
    in Notif.java change:
    Code:
    public final Orelis OreLis = new Orelis();
    to:
    Code:
    public final foldager.OreLis OreLis = new foldager.OreLis();
     
  7. Offline

    Retherz_

    Code:Java
    1.  
    2.  
    3. @EventHandler
    4. public void breakblock(BlockBreakEvent event) {
    5. Block broke = event.getBlock();
    6. Player player = event.getPlayer();
    7. Material block = event.getBlock().getType();
    8. boolean okay = true;
    9. Material mat = null;
    10. for(String strID : getConfig().getString("ores", "").split(",")) {
    11. try {
    12. mat = Material.getMaterial(Integer.parseInt(strID));
    13. if(mat != null && mat != block) {
    14. okay = false;
    15. break;
    16. }
    17. }
    18. catch (Exception ignore) {
    19. if (player.hasPermission("notify.orenotify") || player.isOp()){
    20. }if (getConfig().getString("creativenotify") == ("true")){
    21. if (player.getGameMode() == (GameMode.CREATIVE)){}
    22. }
    23. if(okay) {
    24. for (Player p : Bukkit.getServer().getOnlinePlayers()) {
    25. if (p.hasPermission("notify.orenotify")) {
    26. p.sendMessage(ChatColor.GOLD +"["+ player.getName()+"]" + ChatColor.DARK_AQUA + " has mined " + ChatColor.LIGHT_PURPLE + Material.getMaterial(block.getId())+ChatColor.DARK_AQUA + broke.getLocation().getBlockX() + ", " +
    27. broke.getLocation().getBlockY() + "," +
    28. broke.getLocation().getBlockZ() + "," );
    29. }
    30. }
    31. notifylog.info(player.getName()+ " has mined "+"X"+Material.getMaterial(block.getId())+ broke.getLocation().getBlockX() + ", "+"Y" +
    32. broke.getLocation().getBlockY() + "," + "Z"+ broke.getLocation().getBlockZ() + "," );
    33. }}
    34. }
    35. }
    36. }
     
  8. Offline

    foldagerdk

    Is that a whole other code? :O
     
  9. Offline

    Retherz_

    Just remove notify.log and change from config to ores like Material.GOLD_ORE || Material.IRON_ORE... it will send a message with cords
     
  10. Offline

    foldagerdk

    I might do that! Thanks!

    BTW, I SOLVED THIS!
    I HAD MY plugin.yml POINTING TO THE Orelis CLASS INSTEAD OF THE Notif CLASS.
    THANKS FOR THE HELP ANYWAYS, GUYS! :)
     
Thread Status:
Not open for further replies.

Share This Page