PlotSquared/Core/src/main/java/com/plotsquared/core/util/PremiumVerification.java
2020-04-15 15:26:54 -04:00

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;
}
}