mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Only check update if premium. Add bstats bars for premium vs not.
This commit is contained in:
parent
92ef0d723b
commit
336f27f078
2 changed files with 14 additions and 2 deletions
|
@ -190,7 +190,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
|||
return;
|
||||
}
|
||||
|
||||
if (Settings.Enabled_Components.UPDATE_NOTIFICATIONS) {
|
||||
if (PremiumVerification.isPremium() && Settings.Enabled_Components.UPDATE_NOTIFICATIONS) {
|
||||
new UpdateUtility(this).updateChecker();
|
||||
}
|
||||
|
||||
|
@ -717,6 +717,17 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
|||
}
|
||||
return map;
|
||||
}));
|
||||
metrics.addCustomChart(new Metrics.SimpleBarChart("premium", () -> {
|
||||
final Map<String, Integer> map = new HashMap<>();
|
||||
if(PremiumVerification.isPremium()) {
|
||||
map.put("Premium", 1);
|
||||
map.put("Non-Premium", 0);
|
||||
} else {
|
||||
map.put("Premium", 0);
|
||||
map.put("Non-Premium", 1);
|
||||
}
|
||||
return map;
|
||||
}));
|
||||
}
|
||||
|
||||
@Override public ChunkManager initChunkManager() {
|
||||
|
|
|
@ -98,6 +98,7 @@ import com.plotsquared.core.plot.PlotId;
|
|||
import com.plotsquared.core.plot.PlotInventory;
|
||||
import com.plotsquared.core.plot.message.PlotMessage;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.util.PremiumVerification;
|
||||
import com.plotsquared.core.util.StringWrapper;
|
||||
import com.plotsquared.core.util.EntityUtil;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
|
@ -660,7 +661,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
|||
}, 20);
|
||||
|
||||
if (pp.hasPermission(Captions.PERMISSION_ADMIN_UPDATE_NOTIFICATION.getTranslated())
|
||||
&& Settings.Enabled_Components.UPDATE_NOTIFICATIONS) {
|
||||
&& Settings.Enabled_Components.UPDATE_NOTIFICATIONS && PremiumVerification.isPremium()) {
|
||||
try {
|
||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(
|
||||
"https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506")
|
||||
|
|
Loading…
Reference in a new issue