Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcilore committed May 2, 2024
2 parents 0973266 + a5784ff commit 2e9213e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/.idea/
/EsTools.iml
/out
dependency-reduced-pom.xml
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
If you want to contribute to this project please feel free to fill out a pull request. I don't have a strict template or anything for the request
but just try be very clear about what you changed and why it is good for the project.
but just try to be very clear about what you changed and why it is good for the project.
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,19 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>net.serble.estools</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
<goal>shade</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -77,5 +85,11 @@
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
13 changes: 13 additions & 0 deletions src/main/java/net/serble/estools/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import net.serble.estools.Commands.Teleport.*;
import net.serble.estools.Commands.Warps.*;
import net.serble.estools.Signs.SignMain;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
Expand All @@ -22,6 +24,8 @@ public class Main extends JavaPlugin {
public static int majorVersion;
public static int minorVersion;
public static boolean tabCompleteEnabled = true;

private static final int bStatsId = 21760;

@Override
public void onEnable() {
Expand All @@ -39,6 +43,15 @@ public void onEnable() {
saveDefaultConfig();
}

// Metrics
if (getConfig().getBoolean("metrics", true)) {
Metrics metrics = new Metrics(this, bStatsId);
metrics.addCustomChart(new SimplePie("vault_enabled", () -> String.valueOf(Vault.economy != null)));
Bukkit.getLogger().info("Started bStat metrics");
} else {
Bukkit.getLogger().info("Metrics are disabled");
}

if (majorVersion <= 2) {
Bukkit.getLogger().info("Tab completion is not supported for versions 1.2 and below.");
tabCompleteEnabled = false;
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Stops players taking fall damage when they teleport
safetp: true

# Toggle bStats metrics
metrics: true

0 comments on commit 2e9213e

Please sign in to comment.