Allow plugin to be used as an API on free resource page
This commit is contained in:
parent
810a8f8e00
commit
6e112ea137
@ -111,7 +111,7 @@ public class LibsDisguises extends JavaPlugin {
|
||||
|
||||
registerCommand("libsdisguises", new LibsDisguisesCommand());
|
||||
|
||||
if (!DisguiseConfig.isDisableCommands()) {
|
||||
if (!DisguiseConfig.isDisableCommands() && !LibsPremium.isAPIPlugin()) {
|
||||
registerCommand("disguise", new DisguiseCommand());
|
||||
registerCommand("undisguise", new UndisguiseCommand());
|
||||
registerCommand("disguiseplayer", new DisguisePlayerCommand());
|
||||
@ -131,9 +131,13 @@ public class LibsDisguises extends JavaPlugin {
|
||||
registerCommand("copydisguise", new CopyDisguiseCommand());
|
||||
registerCommand("grabskin", new GrabSkinCommand());
|
||||
registerCommand("savedisguise", new SaveDisguiseCommand());
|
||||
} else {
|
||||
if (LibsPremium.isAPIPlugin()) {
|
||||
getLogger().info("Commands not enabled in API version of Lib's Disguises!");
|
||||
} else {
|
||||
getLogger().info("Commands has been disabled, as per config");
|
||||
}
|
||||
}
|
||||
|
||||
new MetricsInitalizer();
|
||||
}
|
||||
|
@ -64,7 +64,11 @@ public class LibsPremium {
|
||||
* @return true if userID does not contain __USER__
|
||||
*/
|
||||
private static Boolean isPremium(String userID) {
|
||||
return !userID.contains("__USER__");
|
||||
return !userID.contains("__USER__") && !getResourceID().equals("81");
|
||||
}
|
||||
|
||||
public static Boolean isAPIPlugin() {
|
||||
return !isPremium() && getResourceID().equals("81");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,7 +89,7 @@ public class LibsPremium {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (premiumVersion.startsWith("9.")){
|
||||
if (premiumVersion.startsWith("9.")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class PluginInformation {
|
||||
this.userID = userID;
|
||||
this.resourceID = resourceID;
|
||||
this.downloadID = downloadID;
|
||||
this.premium = premium;
|
||||
this.premium = premium && !"81".equals(resourceID);
|
||||
this.version = version;
|
||||
this.buildNumber = buildNumber;
|
||||
this.buildDate = buildDate;
|
||||
|
Loading…
Reference in New Issue
Block a user