Skip to content

Commit

Permalink
Merge pull request #18 from RappyPlugins/feat/sentryFix
Browse files Browse the repository at this point in the history
Fix sentry dsn and move method into ILabyUtilsPlugin
  • Loading branch information
RappyTV authored Sep 3, 2024
2 parents 86007df + ac2fbab commit 8900130
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.rappytv.labyutils</groupId>
<artifactId>LabyUtils</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>

<name>LabyUtils</name>
Expand Down
11 changes: 1 addition & 10 deletions src/main/java/com/rappytv/labyutils/bukkit/LabyUtilsBukkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void onEnable() {
configManager = new BukkitConfigManager(this);
if(configManager.isSentryEnabled()) {
getLogger().info("Thanks for enabling Sentry! Loading...");
initializeSentry();
initializeSentry(getDescription().getVersion());
}
try {
LabyModProtocolService.initialize(this);
Expand Down Expand Up @@ -85,15 +85,6 @@ public BukkitConfigManager getConfigManager() {
return configManager;
}

private void initializeSentry() {
Sentry.init(options -> {
options.setDsn("https://[email protected]/3");
options.setTracesSampleRate(1.0);
options.setRelease(getDescription().getVersion());
getLogger().info("Sentry loaded!");
});
}

private boolean loadVaultEconomy() {
if(getServer().getPluginManager().getPlugin("Vault") == null) return false;
RegisteredServiceProvider<Economy> provider = getServer().getServicesManager().getRegistration(Economy.class);
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/com/rappytv/labyutils/bungee/LabyUtilsBungee.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.rappytv.labyutils.bungee.commands.ReloadCommand;
import com.rappytv.labyutils.bungee.listener.PlayerListener;
import com.rappytv.labyutils.common.ILabyUtilsPlugin;
import io.sentry.Sentry;
import net.labymod.serverapi.server.bungeecord.LabyModProtocolService;
import net.md_5.bungee.api.plugin.Plugin;

Expand All @@ -25,7 +24,7 @@ public void onEnable() {
}
if(configManager.isSentryEnabled()) {
getLogger().info("Thanks for enabling Sentry! Loading...");
initializeSentry();
initializeSentry(getDescription().getVersion());
}
getProxy().getPluginManager().registerCommand(this, new LabyInfoCommand(this));
getProxy().getPluginManager().registerCommand(this, new ReloadCommand(this));
Expand All @@ -39,13 +38,4 @@ public static String getPrefix() {
public BungeeConfigManager getConfigManager() {
return configManager;
}

private void initializeSentry() {
Sentry.init(options -> {
options.setDsn("https://[email protected]/3");
options.setTracesSampleRate(1.0);
options.setRelease(getDescription().getVersion());
getLogger().info("Sentry loaded!");
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public interface ILabyUtilsPlugin {
HttpClient client = HttpClient.newHttpClient();
Logger getLogger();

default void initializeSentry(String version) {
Sentry.init(options -> {
options.setDsn("https://[email protected]/4");
options.setTracesSampleRate(1.0);
options.setRelease(version);
getLogger().info("Sentry loaded!");
});
}

default String formatNumber(double number) {
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
Expand Down

0 comments on commit 8900130

Please sign in to comment.