Skip to content

Commit 1b6223f

Browse files
Merge pull request #26 from variananora/rc-27-update
Updated all namings to new the one
2 parents 31cd2ac + b01b591 commit 1b6223f

17 files changed

+51
-51
lines changed

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
<dependency>
2525
<groupId>org.spigotmc</groupId>
2626
<artifactId>spigot-api</artifactId>
27-
<version>1.16.4-R0.1-SNAPSHOT</version>
27+
<version>1.17.1-R0.1-SNAPSHOT</version>
2828
<scope>provided</scope>
2929
</dependency>
3030
<dependency>
31-
<groupId>com.github.TheBusyBiscuit</groupId>
31+
<groupId>com.github.thebusybiscuit</groupId>
3232
<artifactId>Slimefun4</artifactId>
33-
<version>326a431151</version>
33+
<version>RC-27</version>
3434
<scope>provided</scope>
3535
</dependency>
3636

src/main/java/dev/walshy/sfmetrics/MetricsModule.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import dev.walshy.sfmetrics.charts.SlimefunVersionChart;
2929
import dev.walshy.sfmetrics.charts.TickRateChart;
3030
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
31-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
31+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
3232

3333
public class MetricsModule {
3434

@@ -45,10 +45,10 @@ public class MetricsModule {
4545
private MetricsModule() {}
4646

4747
public static void start() {
48-
Metrics metrics = new Metrics(SlimefunPlugin.instance(), PLUGIN_ID);
49-
branch = SlimefunPlugin.getUpdater().getBranch();
50-
slimefunVersion = SlimefunPlugin.getUpdater().getBuildNumber();
51-
metricsAutoUpdates = SlimefunPlugin.getMetricsService().hasAutoUpdates();
48+
Metrics metrics = new Metrics(Slimefun.instance(), PLUGIN_ID);
49+
branch = Slimefun.getUpdater().getBranch();
50+
slimefunVersion = Slimefun.getUpdater().getBuildNumber();
51+
metricsAutoUpdates = Slimefun.getMetricsService().hasAutoUpdates();
5252

5353
addChart(metrics, AutoUpdaterChart::new);
5454
addChart(metrics, ResourcePackChart::new);
@@ -70,8 +70,8 @@ public static void start() {
7070
addChart(metrics, DisabledItemsChart::new);
7171
addChart(metrics, AverageTimingsChart::new);
7272

73-
SlimefunPlugin.instance().getLogger().log(Level.INFO, "Now running MetricsModule build #{0}", VERSION);
74-
SlimefunPlugin.instance().getLogger().log(Level.INFO, "with a total of {0}/{1} chart(s)!", new Object[] { enabledCharts, totalCharts });
73+
Slimefun.instance().getLogger().log(Level.INFO, "Now running MetricsModule build #{0}", VERSION);
74+
Slimefun.instance().getLogger().log(Level.INFO, "with a total of {0}/{1} chart(s)!", new Object[] { enabledCharts, totalCharts });
7575
}
7676

7777
@ParametersAreNonnullByDefault
@@ -100,9 +100,9 @@ private static <T extends CustomChart & SlimefunMetricsChart> void addChart(Metr
100100
@ParametersAreNonnullByDefault
101101
private static void warn(String chartName, Throwable x) {
102102
if (!metricsAutoUpdates) {
103-
SlimefunPlugin.instance().getLogger().log(Level.WARNING, "Turn on Auto-Updates for Slimefun-Metrics to avoid this issue!");
103+
Slimefun.instance().getLogger().log(Level.WARNING, "Turn on Auto-Updates for Slimefun-Metrics to avoid this issue!");
104104
}
105105

106-
SlimefunPlugin.instance().getLogger().log(Level.WARNING, x, () -> "Failed to load bStats Chart \"" + chartName + "\" for Metrics #" + VERSION);
106+
Slimefun.instance().getLogger().log(Level.WARNING, x, () -> "Failed to load bStats Chart \"" + chartName + "\" for Metrics #" + VERSION);
107107
}
108108
}

src/main/java/dev/walshy/sfmetrics/charts/AddonsChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import dev.walshy.sfmetrics.SlimefunMetricsChart;
1212
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
13-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
13+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1414

1515
import javax.annotation.Nonnull;
1616

@@ -29,7 +29,7 @@ public AddonsChart() {
2929
super("installed_addons", () -> {
3030
Map<String, Integer> addons = new HashMap<>();
3131

32-
for (Plugin plugin : SlimefunPlugin.getInstalledAddons()) {
32+
for (Plugin plugin : Slimefun.getInstalledAddons()) {
3333
if (plugin.isEnabled()) {
3434
addons.put(plugin.getName(), 1);
3535
}

src/main/java/dev/walshy/sfmetrics/charts/AutoUpdaterChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import dev.walshy.sfmetrics.VersionDependentChart;
1010
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
11-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
11+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1212

1313
/**
1414
* This {@link SimplePie} shows us how many {@link Server Servers} have enabled or disabled
@@ -23,7 +23,7 @@ public class AutoUpdaterChart extends SimplePie implements VersionDependentChart
2323

2424
public AutoUpdaterChart() {
2525
super("auto_updates", () -> {
26-
boolean enabled = SlimefunPlugin.getUpdater().isEnabled();
26+
boolean enabled = Slimefun.getUpdater().isEnabled();
2727
return enabled ? "enabled" : "disabled";
2828
});
2929
}

src/main/java/dev/walshy/sfmetrics/charts/AverageTimingsChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import dev.walshy.sfmetrics.VersionDependentChart;
44
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
5-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
5+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
66
import org.bstats.charts.SimplePie;
77
import org.bstats.json.JsonObjectBuilder;
88

@@ -16,7 +16,7 @@ public AverageTimingsChart() {
1616
super("average_timings", () -> {
1717
long averageMsTiming = 0;
1818
try {
19-
averageMsTiming = SlimefunPlugin.getProfiler().getAndResetAverageTimings();
19+
averageMsTiming = Slimefun.getProfiler().getAndResetAverageTimings();
2020
} catch (ArithmeticException e) {
2121
// I forgot we test this on startup when the timing would be 0.
2222
// This is a quick and dirty fix - thank god for easy module stuff

src/main/java/dev/walshy/sfmetrics/charts/CommandChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import dev.walshy.sfmetrics.SlimefunMetricsChart;
77
import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand;
8-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
8+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
99
import org.bstats.charts.AdvancedPie;
1010
import org.bstats.json.JsonObjectBuilder;
1111

@@ -25,7 +25,7 @@ public CommandChart() {
2525
super("commands_ran", () -> {
2626
Map<String, Integer> commands = new HashMap<>();
2727

28-
for (Map.Entry<SubCommand, Integer> entry : SlimefunPlugin.getCommand().getCommandUsage().entrySet()) {
28+
for (Map.Entry<SubCommand, Integer> entry : Slimefun.getCommand().getCommandUsage().entrySet()) {
2929
commands.put("/sf " + entry.getKey().getName(), entry.getValue());
3030
}
3131

src/main/java/dev/walshy/sfmetrics/charts/CompatibilityModeChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.walshy.sfmetrics.charts;
22

33
import dev.walshy.sfmetrics.SlimefunMetricsChart;
4-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
4+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
55
import org.bstats.charts.SimplePie;
66
import org.bstats.json.JsonObjectBuilder;
77
import org.bukkit.Server;
@@ -18,7 +18,7 @@ public class CompatibilityModeChart extends SimplePie implements SlimefunMetrics
1818

1919
public CompatibilityModeChart() {
2020
super("compatibility_mode", () -> {
21-
boolean enabled = SlimefunPlugin.getRegistry().isBackwardsCompatible();
21+
boolean enabled = Slimefun.getRegistry().isBackwardsCompatible();
2222
return enabled ? "enabled" : "disabled";
2323
});
2424
}

src/main/java/dev/walshy/sfmetrics/charts/DisabledItemsChart.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package dev.walshy.sfmetrics.charts;
22

33
import dev.walshy.sfmetrics.SlimefunMetricsChart;
4-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
5-
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
4+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
5+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
66
import org.bstats.charts.AdvancedPie;
77
import org.bstats.json.JsonObjectBuilder;
88
import org.bukkit.Server;
@@ -50,8 +50,8 @@ public JsonObjectBuilder.JsonObject getDataSample() throws Exception {
5050
private static void fetchItems() {
5151
new Thread(() -> {
5252
disabledItems = new HashMap<>();
53-
for (SlimefunItem item : SlimefunPlugin.getRegistry().getAllSlimefunItems()) {
54-
if (item.getAddon().equals(SlimefunPlugin.instance()) && item.isDisabled()) {
53+
for (SlimefunItem item : Slimefun.getRegistry().getAllSlimefunItems()) {
54+
if (item.getAddon().equals(Slimefun.instance()) && item.isDisabled()) {
5555
disabledItems.put(item.getId(), 1);
5656
}
5757
}

src/main/java/dev/walshy/sfmetrics/charts/IntegrationsChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.bukkit.plugin.PluginManager;
1414

1515
import dev.walshy.sfmetrics.SlimefunMetricsChart;
16-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
16+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1717

1818
/**
1919
* This {@link AdvancedPie} shows us which {@link Plugin Plugins} the current
@@ -26,7 +26,7 @@ public class IntegrationsChart extends AdvancedPie implements SlimefunMetricsCha
2626

2727
public IntegrationsChart() {
2828
super("integrations", () -> {
29-
SlimefunPlugin slimefun = SlimefunPlugin.instance();
29+
Slimefun slimefun = Slimefun.instance();
3030
Map<String, Integer> plugins = new HashMap<>();
3131

3232
// Hard dependencies

src/main/java/dev/walshy/sfmetrics/charts/MetricsAutoUpdatesChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import dev.walshy.sfmetrics.MetricsModule;
1010
import dev.walshy.sfmetrics.VersionDependentChart;
1111
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
12-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
12+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1313

1414
/**
1515
* This {@link SimplePie} shows us whether a {@link Server} has enabled or disabled
@@ -22,7 +22,7 @@ public class MetricsAutoUpdatesChart extends SimplePie implements VersionDepende
2222

2323
public MetricsAutoUpdatesChart() {
2424
super("metrics_auto_updates", () -> {
25-
boolean enabled = SlimefunPlugin.getMetricsService().hasAutoUpdates();
25+
boolean enabled = Slimefun.getMetricsService().hasAutoUpdates();
2626
return enabled ? "enabled" : "disabled";
2727
});
2828
}

src/main/java/dev/walshy/sfmetrics/charts/NewServersChart.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import dev.walshy.sfmetrics.VersionDependentChart;
1111
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
12-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
12+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1313

1414
/**
1515
* This single line graph shows the amount of {@link Server Servers} that installed
@@ -28,7 +28,7 @@ public class NewServersChart extends SingleLineChart implements VersionDependent
2828

2929
public NewServersChart() {
3030
super("new_servers", () -> {
31-
boolean newServer = SlimefunPlugin.isNewlyInstalled();
31+
boolean newServer = Slimefun.isNewlyInstalled();
3232
return newServer ? 1 : 0;
3333
});
3434
}

src/main/java/dev/walshy/sfmetrics/charts/PlayerLanguageChart.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import dev.walshy.sfmetrics.SlimefunMetricsChart;
1212
import io.github.thebusybiscuit.slimefun4.core.services.localization.Language;
13-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
13+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1414

1515
import javax.annotation.Nonnull;
1616

@@ -28,8 +28,8 @@ public PlayerLanguageChart() {
2828
Map<String, Integer> languages = new HashMap<>();
2929

3030
for (Player p : Bukkit.getOnlinePlayers()) {
31-
Language language = SlimefunPlugin.getLocalization().getLanguage(p);
32-
boolean supported = SlimefunPlugin.getLocalization().isLanguageLoaded(language.getId());
31+
Language language = Slimefun.getLocalization().getLanguage(p);
32+
boolean supported = Slimefun.getLocalization().isLanguageLoaded(language.getId());
3333

3434
String lang = supported ? language.getId() : "Unsupported Language";
3535
languages.merge(lang, 1, Integer::sum);

src/main/java/dev/walshy/sfmetrics/charts/ResearchesEnabledChart.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import org.bukkit.Server;
66

77
import dev.walshy.sfmetrics.SlimefunMetricsChart;
8-
import io.github.thebusybiscuit.slimefun4.core.researching.Research;
9-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
8+
import io.github.thebusybiscuit.slimefun4.api.researches.Research;
9+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1010

1111
import javax.annotation.Nonnull;
1212

@@ -21,7 +21,7 @@ public class ResearchesEnabledChart extends SimplePie implements SlimefunMetrics
2121

2222
public ResearchesEnabledChart() {
2323
super("servers_with_researches_enabled", () -> {
24-
boolean enabled = SlimefunPlugin.getRegistry().isFreeCreativeResearchingEnabled();
24+
boolean enabled = Slimefun.getRegistry().isFreeCreativeResearchingEnabled();
2525
return enabled ? "enabled" : "disabled";
2626
});
2727
}

src/main/java/dev/walshy/sfmetrics/charts/ResourcePackChart.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.bukkit.Server;
66

77
import dev.walshy.sfmetrics.SlimefunMetricsChart;
8-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
8+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
99

1010
import javax.annotation.Nonnull;
1111

@@ -20,11 +20,11 @@ public class ResourcePackChart extends SimplePie implements SlimefunMetricsChart
2020

2121
public ResourcePackChart() {
2222
super("resourcepack", () -> {
23-
String version = SlimefunPlugin.getItemTextureService().getVersion();
23+
String version = Slimefun.getItemTextureService().getVersion();
2424

2525
if (version != null && version.startsWith("v")) {
2626
return version + " (Official)";
27-
} else if (SlimefunPlugin.getItemTextureService().isActive()) {
27+
} else if (Slimefun.getItemTextureService().isActive()) {
2828
return "Custom / Modified";
2929
} else {
3030
return "None";

src/main/java/dev/walshy/sfmetrics/charts/ServerLanguageChart.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import dev.walshy.sfmetrics.SlimefunMetricsChart;
88
import io.github.thebusybiscuit.slimefun4.core.services.localization.Language;
9-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
9+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1010

1111
import javax.annotation.Nonnull;
1212

@@ -21,8 +21,8 @@ public class ServerLanguageChart extends SimplePie implements SlimefunMetricsCha
2121

2222
public ServerLanguageChart() {
2323
super("language", () -> {
24-
Language language = SlimefunPlugin.getLocalization().getDefaultLanguage();
25-
boolean supported = SlimefunPlugin.getLocalization().isLanguageLoaded(language.getId());
24+
Language language = Slimefun.getLocalization().getDefaultLanguage();
25+
boolean supported = Slimefun.getLocalization().isLanguageLoaded(language.getId());
2626
return supported ? language.getId() : "Unsupported Language";
2727
});
2828
}

src/main/java/dev/walshy/sfmetrics/charts/SlimefunVersionChart.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import dev.walshy.sfmetrics.SlimefunMetricsChart;
1111
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
12-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
12+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
1313

1414
import javax.annotation.Nonnull;
1515

@@ -28,8 +28,8 @@ public SlimefunVersionChart() {
2828
Map<String, Map<String, Integer>> outerMap = new HashMap<>();
2929
Map<String, Integer> innerMap = new HashMap<>();
3030

31-
innerMap.put(SlimefunPlugin.getVersion(), 1);
32-
outerMap.put(SlimefunPlugin.getUpdater().getBranch().getName(), innerMap);
31+
innerMap.put(Slimefun.getVersion(), 1);
32+
outerMap.put(Slimefun.getUpdater().getBranch().getName(), innerMap);
3333

3434
return outerMap;
3535
});

src/main/java/dev/walshy/sfmetrics/charts/TickRateChart.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.Map;
55

66
import dev.walshy.sfmetrics.SlimefunMetricsChart;
7-
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
7+
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
88
import org.bstats.charts.DrilldownPie;
99
import org.bstats.json.JsonObjectBuilder;
1010

@@ -22,9 +22,9 @@ public class TickRateChart extends DrilldownPie implements SlimefunMetricsChart
2222
public TickRateChart() {
2323
super("tick_rate", () -> {
2424
Map<String, Map<String, Integer>> map = new HashMap<>();
25-
int tickRate = SlimefunPlugin.getTickerTask().getTickRate();
26-
int armorTickRate = SlimefunPlugin.getCfg().getInt("options.armor-update-interval");
27-
int cargoDelay = SlimefunPlugin.getCfg().getInt("networks.cargo-ticker-delay");
25+
int tickRate = Slimefun.getTickerTask().getTickRate();
26+
int armorTickRate = Slimefun.getCfg().getInt("options.armor-update-interval");
27+
int cargoDelay = Slimefun.getCfg().getInt("networks.cargo-ticker-delay");
2828

2929
// For normal blocks the tick-rate will be taken literal
3030
Map<String, Integer> normal = new HashMap<>();

0 commit comments

Comments
 (0)