Skip to content

Commit

Permalink
Dependency Update, Check if essentials is actually enabled, Baltop ca…
Browse files Browse the repository at this point in the history
…che update
  • Loading branch information
BlitzOffline committed Mar 5, 2022
1 parent 3944cf9 commit 32d4bdb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Eclipse ###

.metadata
.idea/
bin/
tmp/
*.tmp
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.extendedclip.papi.expansion.essentials</groupId>
<artifactId>essentials-expansion</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
<name>PAPI-Expansion-Essentials</name>
<description>PlaceholderAPI expansion for Essentials placeholders</description>

Expand All @@ -17,27 +17,27 @@
</repository>
<repository>
<id>ess-repo</id>
<url>https://repo.essentialsx.net/snapshots/</url>
<url>https://repo.essentialsx.net/releases/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.9</version>
<version>2.11.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.essentialsx</groupId>
<artifactId>EssentialsX</artifactId>
<version>2.19.0-SNAPSHOT</version>
<version>2.19.3</version>
<exclusions>
<exclusion>
<groupId>org.bstats</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ public class EssentialsExpansion extends PlaceholderExpansion {
private final DecimalFormat format = new DecimalFormat("#,###");

private Essentials essentials;
private BalanceTop baltop;

private final String VERSION = getClass().getPackage().getImplementationVersion();

@Override
public boolean canRegister() {
return Bukkit.getPluginManager().getPlugin("Essentials") != null;
return Bukkit.getPluginManager().getPlugin("Essentials") != null && Bukkit.getPluginManager().getPlugin("Essentials").isEnabled();
}

@Override
Expand All @@ -73,7 +74,9 @@ public boolean register() {
q = getString("formatting.quadrillions", "q");

essentials = (Essentials) Bukkit.getPluginManager().getPlugin("Essentials");
if (essentials != null) {
if (essentials != null && essentials.isEnabled()) {
baltop = essentials.getBalanceTop();
baltop.calculateBalanceTopMapAsync();
return super.register();
}
return false;
Expand Down Expand Up @@ -188,7 +191,6 @@ public String onRequest(OfflinePlayer player, @NotNull String identifier) {
}

if (identifier.startsWith("baltop_")) {
BalanceTop baltop = essentials.getBalanceTop();
Map<UUID, BalanceTop.Entry> baltopCache = baltop.getBalanceTopCache();
identifier = identifier.substring(7);

Expand Down

0 comments on commit 32d4bdb

Please sign in to comment.