Whats wrong with this placeholderapi expansion?

Discussion in 'Spigot Plugin Development' started by _DuB_, Jul 2, 2016.

  1. The title says it^
    http://prntscr.com/bnja9v

    Code (Text):
    package com.extendedclip.papi.expansion.onlinemessages;


    import me.clip.placeholderapi.PlaceholderAPI;
    import me.clip.placeholderapi.expansion.PlaceholderExpansion;
    import me.dubdesigns.om.Main;

    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;

    public class OnlineMessages extends PlaceholderExpansion {
      public Main plugin;
      @Override
      public boolean canRegister()
      {
        return Bukkit.getPluginManager().getPlugin(getPlugin()) != null;
      }
      @Override
      public boolean register() {
          if (!canRegister()) {
              return false;
          }
          plugin = (Main) Bukkit.getPluginManager().getPlugin(getPlugin());
          if (plugin == null) {
              return false;
          }
          return PlaceholderAPI.registerPlaceholderHook(getIdentifier(), this);
      }

      @Override
      public String getAuthor() {
        return "_DuB_";
      }

      @Override
      public String getIdentifier()
      {
        return "OnlineMessages";
      }

      @Override
      public String getPlugin()
      {
        return "OnlineMessages";
      }

      @Override
      public String getVersion()
      {
        return "1.0.0";
      }
      @Override
      public String onPlaceholderRequest(Player p, String identifier) {

          if (p == null) {
              return "";
          }
          if (identifier.equals("timer")) {
              //return TimeManager.nextmonday();
              return "test";
          }
          return null;
      }
    }