Update dependencies

This commit is contained in:
NotAlexNoyle committed 2025-08-12 21:19:58 -04:00
1 parent 360ea22f1a
commit 70dcfea2bc
7 files changed
+55 -60

No files matched your search

-1
View File
@@ -103,7 +103,6 @@ tasks.withType<JavaCompile>().configureEach {
/* ----------------------------- Auto Formatting ------------------------ */
spotless {
kotlin { ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) } }
java {
eclipse().configFile("config/formatter/eclipse-java-formatter.xml") // Eclipse java formatting.
leadingTabsToSpaces() // Convert leftover leading tabs to spaces.
+38 -41
View File
@@ -8,9 +8,6 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import net.trueog.diamondbankog.DiamondBankException;
import net.trueog.utilitiesog.UtilitiesOG;
public class Listeners implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
@@ -22,44 +19,44 @@ public class Listeners implements Listener {
// runTaskAsynchronously() is needed in this case since getTotalShards() calls a
// database which can be
// too slow to run on the main thread
Bukkit.getScheduler().runTaskAsynchronously(TemplateOG.getPlugin(), () -> {
final int totalShards;
try {
totalShards = TemplateOG.diamondBankAPI().getTotalShards(event.getPlayer().getUniqueId());
} catch (DiamondBankException.EconomyDisabledException e) {
UtilitiesOG.trueogMessage(event.getPlayer(), "<red>The economy is disabled.");
return;
} catch (DiamondBankException.TransactionsLockedException e) {
UtilitiesOG.trueogMessage(event.getPlayer(), "<red>Transactions are currently locked for you.");
return;
} catch (DiamondBankException.DatabaseException e) {
UtilitiesOG.trueogMessage(event.getPlayer(), "<red>Something went wrong with the database.");
return;
}
// If you don't care about the specific exceptions you can also do the
// following:
// try {
// totalShards =
// TemplateOG.diamondBankAPI().getTotalShards(event.getPlayer().getUniqueId());
// } catch (DiamondBankException e) {
// UtilitiesOG.trueogMessage(event.getPlayer(), "<red>Something went wrong.");
// }
// Send a message to the player with their balance.
UtilitiesOG.trueogMessage(event.getPlayer(), "&BYour balance is: &e" + totalShards + "&B Diamond Shards.");
UtilitiesOG.logToConsole("[Template-OG]", "The player: " + event.getPlayer()
+ "'s <aqua>balance</aqua> is: " + totalShards + "&B Diamond Shards");
});
/*
* Bukkit.getScheduler().runTaskAsynchronously(TemplateOG.getPlugin(), () -> {
*
* final int totalShards; try {
*
* totalShards =
* TemplateOG.diamondBankAPI().getTotalShards(event.getPlayer().getUniqueId());
*
* } catch (DiamondBankException.EconomyDisabledException e) {
*
* UtilitiesOG.trueogMessage(event.getPlayer(),
* "<red>The economy is disabled."); return;
*
* } catch (DiamondBankException.TransactionsLockedException e) {
*
* UtilitiesOG.trueogMessage(event.getPlayer(),
* "<red>Transactions are currently locked for you."); return;
*
* } catch (DiamondBankException.DatabaseException e) {
*
* UtilitiesOG.trueogMessage(event.getPlayer(),
* "<red>Something went wrong with the database."); return;
*
* } // If you don't care about the specific exceptions you can also do the //
* following: // try { // totalShards = //
* TemplateOG.diamondBankAPI().getTotalShards(event.getPlayer().getUniqueId());
* // } catch (DiamondBankException e) { //
* UtilitiesOG.trueogMessage(event.getPlayer(), "<red>Something went wrong.");
* // }
*
* // Send a message to the player with their balance.
* UtilitiesOG.trueogMessage(event.getPlayer(), "&BYour balance is: &e" +
* totalShards + "&B Diamond Shards.");
* UtilitiesOG.logToConsole("[Template-OG]", "The player: " + event.getPlayer()
* + "'s <aqua>balance</aqua> is: " + totalShards + "&B Diamond Shards");
*
* });
*/
save(TemplateOG.config(), Bukkit.getOfflinePlayer("TheMonsterEric"));
+13 -14
View File
@@ -2,9 +2,7 @@
// Author: NotAlexNoyle.
package plugin;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import net.trueog.diamondbankog.DiamondBankAPIJava;
@@ -25,18 +23,19 @@ public class TemplateOG extends JavaPlugin {
getServer().getPluginManager().registerEvents(new Listeners(), this);
final RegisteredServiceProvider<DiamondBankAPIJava> provider = getServer().getServicesManager()
.getRegistration(DiamondBankAPIJava.class);
if (provider == null) {
getLogger().severe("DiamondBank-OG API is null – disabling plugin.");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
diamondBankAPI = provider.getProvider();
/*
* final RegisteredServiceProvider<DiamondBankAPIJava> provider =
* getServer().getServicesManager() .getRegistration(DiamondBankAPIJava.class);
*
* if (provider == null) {
*
* getLogger().severe("DiamondBank-OG API is null – disabling plugin.");
* Bukkit.getPluginManager().disablePlugin(this); return;
*
* }
*
* diamondBankAPI = provider.getProvider();
*/
}