Skip to content

Commit c92f146

Browse files
committed
Update BukkitCustomFishingPluginImpl.java
1 parent 6bb51ce commit c92f146

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

core/src/main/java/net/momirealms/customfishing/bukkit/BukkitCustomFishingPluginImpl.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public class BukkitCustomFishingPluginImpl extends BukkitCustomFishingPlugin {
7272
private final PluginLogger logger;
7373
private BukkitCommandManager commandManager;
7474
private Consumer<Object> debugger;
75+
private String user = "%%__USER__%%";
76+
private String username = "%%__USERNAME__%%";
77+
private String buildByBit = "%%__BUILTBYBIT__%%";
78+
private String polymart = "%%__POLYMART__%%";
79+
private String time = "%%__TIMESTAMP__%%";
7580

7681
public BukkitCustomFishingPluginImpl(Plugin boostrap) {
7782
super(boostrap);
@@ -137,10 +142,30 @@ public void enable() {
137142

138143
this.reload();
139144
if (ConfigManager.metrics()) new Metrics((JavaPlugin) getBoostrap(), 16648);
145+
146+
boolean downloadFromPolymart = polymart.equals("1");
147+
boolean downloadFromBBB = buildByBit.equals("true");
148+
if (downloadFromPolymart || downloadFromBBB) {
149+
this.getPluginLogger().info("License holder: " + username + "." + user);
150+
} else {
151+
this.debug("You are using a compiled version from Github.");
152+
}
153+
140154
if (ConfigManager.checkUpdate()) {
141155
VersionHelper.UPDATE_CHECKER.apply(this).thenAccept(result -> {
142-
if (!result) this.getPluginLogger().info("You are using the latest version.");
143-
else this.getPluginLogger().warn("Update is available: https://polymart.org/resource/2723");
156+
String link;
157+
if (downloadFromPolymart) {
158+
link = "https://polymart.org/resource/2723/";
159+
} else if (downloadFromBBB) {
160+
link = "https://builtbybit.com/resources/36361/";
161+
} else {
162+
link = "https://github.com/Xiao-MoMi/Custom-Fishing/";
163+
}
164+
if (!result) {
165+
this.getPluginLogger().info("You are using the latest version.");
166+
} else {
167+
this.getPluginLogger().warn("Update is available: " + link);
168+
}
144169
});
145170
}
146171
}

0 commit comments

Comments
 (0)