mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-06-28 10:45:02 +02:00
36 lines
838 B
Java
36 lines
838 B
Java
package com.plotsquared.core.util;
|
|
|
|
public class PremiumVerification {
|
|
private static Boolean usingPremium;
|
|
|
|
/**
|
|
* @return Account ID if downloaded through SpigotMC
|
|
*/
|
|
public static String getUserID() {
|
|
return "%%__USER__%%";
|
|
}
|
|
|
|
/**
|
|
* @return Download ID if downloaded through SpigotMC
|
|
*/
|
|
public static String getDownloadID() {
|
|
return "%%__NONCE__%%";
|
|
}
|
|
|
|
/**
|
|
* @param userID Spigot user ID
|
|
* @return true if userID does not contain __USER__
|
|
*/
|
|
private static Boolean isPremium(String userID) {
|
|
return !userID.contains("__USER__");
|
|
}
|
|
|
|
/**
|
|
* Returns true if this plugin is premium
|
|
*/
|
|
public static Boolean isPremium() {
|
|
return usingPremium == null ? (usingPremium = isPremium(getUserID())) : usingPremium;
|
|
}
|
|
|
|
}
|