Update dependencies
This commit is contained in:
1 parent
360ea22f1a
commit
70dcfea2bc
7 files changed
+55
-60
No files matched your search
@@ -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.
|
||||
|
||||
+1
-1
Submodule libs/Chat-OG updated: 6d9e452c83...dfaea7622e.
+1
-1
Submodule libs/DiamondBank-OG updated: 7425337115...302e3840e4.
+1
-1
Submodule libs/GxUI-OG updated: 628c5a2752...de8b275143.
+1
-1
Submodule libs/Utilities-OG updated: fc93c2ed4f...0ba116b1ab.
@@ -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"));
|
||||
|
||||
|
||||
@@ -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();
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user