public static <T> T get(Player player, String key, Class<T> type) {
    if (!player.hasMetadata(key)) {
      return null;
    }

    for (MetadataValue value : player.getMetadata(key)) {
      if (value.getOwningPlugin().equals(LoginSecurity.getInstance())) {
        return type.cast(value.value());
      }
    }

    return null;
  }
 public static void set(Player player, String key, Object value) {
   player.setMetadata(key, new FixedMetadataValue(LoginSecurity.getInstance(), value));
 }
 public static void unset(Player player, String key) {
   player.removeMetadata(key, LoginSecurity.getInstance());
 }