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());
|
registerCommand("libsdisguises", new LibsDisguisesCommand());
|
||||||
|
|
||||||
if (!DisguiseConfig.isDisableCommands()) {
|
if (!DisguiseConfig.isDisableCommands() && !LibsPremium.isAPIPlugin()) {
|
||||||
registerCommand("disguise", new DisguiseCommand());
|
registerCommand("disguise", new DisguiseCommand());
|
||||||
registerCommand("undisguise", new UndisguiseCommand());
|
registerCommand("undisguise", new UndisguiseCommand());
|
||||||
registerCommand("disguiseplayer", new DisguisePlayerCommand());
|
registerCommand("disguiseplayer", new DisguisePlayerCommand());
|
||||||
@ -132,7 +132,11 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
registerCommand("grabskin", new GrabSkinCommand());
|
registerCommand("grabskin", new GrabSkinCommand());
|
||||||
registerCommand("savedisguise", new SaveDisguiseCommand());
|
registerCommand("savedisguise", new SaveDisguiseCommand());
|
||||||
} else {
|
} else {
|
||||||
getLogger().info("Commands has been disabled, as per config");
|
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();
|
new MetricsInitalizer();
|
||||||
|
@ -64,7 +64,11 @@ public class LibsPremium {
|
|||||||
* @return true if userID does not contain __USER__
|
* @return true if userID does not contain __USER__
|
||||||
*/
|
*/
|
||||||
private static Boolean isPremium(String userID) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (premiumVersion.startsWith("9.")){
|
if (premiumVersion.startsWith("9.")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public class PluginInformation {
|
|||||||
this.userID = userID;
|
this.userID = userID;
|
||||||
this.resourceID = resourceID;
|
this.resourceID = resourceID;
|
||||||
this.downloadID = downloadID;
|
this.downloadID = downloadID;
|
||||||
this.premium = premium;
|
this.premium = premium && !"81".equals(resourceID);
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.buildNumber = buildNumber;
|
this.buildNumber = buildNumber;
|
||||||
this.buildDate = buildDate;
|
this.buildDate = buildDate;
|
||||||
|
Loading…
Reference in New Issue
Block a user