Skip to content

Commit

Permalink
6.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
UnDeadlyDev committed Mar 29, 2023
1 parent fa25f36 commit f56acfa
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 898 deletions.
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.undeadlydev</groupId>
<artifactId>UTitleAuth</artifactId>
<version>6.7.0</version>
<version>6.9.0</version>

<properties>
<project.java.version>1.8</project.java.version>
Expand Down Expand Up @@ -36,6 +36,12 @@
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>shaded.org.bstats</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
Expand Down Expand Up @@ -110,6 +116,12 @@
<version>5.6.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
36 changes: 23 additions & 13 deletions src/main/java/com/undeadlydev/UTitleAuth/TitleAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import com.undeadlydev.UTitleAuth.config.Settings;
import com.undeadlydev.UTitleAuth.controllers.VersionController;
import com.undeadlydev.UTitleAuth.managers.AddonManager;
import com.undeadlydev.UTitleAuth.superclass.UpdateChecker;
import com.undeadlydev.UTitleAuth.superclass.SpigotUpdater;
import com.undeadlydev.UTitleAuth.utils.ChatUtils;
import com.undeadlydev.UTitleAuth.utils.Utils;
import net.md_5.bungee.api.ChatColor;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin;
Expand All @@ -15,7 +16,7 @@

import com.undeadlydev.UTitleAuth.cmds.utitleauthCMD;
import com.undeadlydev.UTitleAuth.listeners.GeneralListeners;
import com.undeadlydev.UTitleAuth.data.Metrics;
import org.bukkit.scheduler.BukkitRunnable;

public class TitleAuth extends JavaPlugin {

Expand Down Expand Up @@ -57,7 +58,7 @@ public void onEnable() {
adm.reload();
LoadHooks();
pm.registerEvents(new GeneralListeners(this), this);
EnableMetrics();
loadMetrics();
sendLogMessage(" ");
sendLogMessage("&7-----------------------------------");
sendLogMessage(" ");
Expand Down Expand Up @@ -105,19 +106,28 @@ public void sendLogMessage(String msg) {
Bukkit.getConsoleSender().sendMessage(ChatUtils.parseLegacy("&7[&e&lUTitleAuth&7] &8| " + msg));
}

private void EnableMetrics() {
public void loadMetrics() {
int pluginId = 14756;
Metrics metrics = new Metrics(this, pluginId);
metrics.addCustomChart(new Metrics.SimplePie("chart_id", () -> "My value"));
metrics.addCustomChart(new SimplePie("chart_id", () -> "My value"));
}

private void CheckUpdate() {
new UpdateChecker(this, 88058).getVersion(version -> {
if (this.getDescription().getVersion().equals(version)) {
sendLogMessage("&aThere is not a new update available.");
} else {
sendLogMessage("&cThere is a new update available.");
}
});
if(getCfg().getBoolean("update-check")) {
new BukkitRunnable() {
public void run() {
SpigotUpdater updater = new SpigotUpdater(instance, 88058);
try {
if (updater.checkForUpdates()) {
sendLogMessage("An update for UTitleAuth (v" + updater.getLatestVersion() + ") is available at:");
sendLogMessage(updater.getResourceURL());
}
} catch (Exception e) {
sendLogMessage("Failed to check for a update on spigot.");
}
}

}.runTask(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public boolean onCommand(CommandSender commandSender, Command command, String s,

private void sendHelp(CommandSender s) {
s.sendMessage(ChatUtils.colorCodes("&e[UTitleAuth] " + "&c&lAdmin Commands."));
s.sendMessage(ChatUtils.colorCodes("&e[UTitleAuth] " + "&e/utitleauth reload &7(Reload all Message and booleans)"));
s.sendMessage(ChatUtils.colorCodes("&e[UTitleAuth] " + "&e/utitleauth reload &7(Reload all configs)"));
}
}
Loading

0 comments on commit f56acfa

Please sign in to comment.