File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/main/java/me/datatags/ultracosmeticsguiaddon Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import org.apache.tools.ant.filters.ReplaceTokens
22
33plugins {
44 id ' java-library'
5+ id(" com.github.johnrengelman.shadow" ) version " 8.1.1"
56}
67
78group ' me.datatags'
8- version ' 1.1'
9+ version ' 1.1.1 '
910
1011repositories {
1112 mavenLocal()
@@ -25,7 +26,8 @@ repositories {
2526dependencies {
2627 compileOnly ' org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT'
2728 // TODO: change this to a tag that works
28- implementation ' com.github.UltraCosmetics:UltraCosmetics:master-SNAPSHOT'
29+ compileOnly ' com.github.UltraCosmetics:UltraCosmetics:master-SNAPSHOT'
30+ implementation ' org.bstats:bstats-bukkit:3.0.2'
2931}
3032
3133processResources {
@@ -35,3 +37,9 @@ processResources {
3537 ' VERSION' : project. version,
3638 ]
3739}
40+
41+ shadowJar {
42+ minimize()
43+ def path = ' me.datatags.ultracosmeticsguiaddon.shaded'
44+ relocate(' org.bstats' , path + ' .bstats' )
45+ }
Original file line number Diff line number Diff line change 22
33import be .isach .ultracosmetics .UltraCosmetics ;
44import be .isach .ultracosmetics .UltraCosmeticsData ;
5+ import org .bstats .bukkit .Metrics ;
56import org .bukkit .plugin .java .JavaPlugin ;
67
78public class UltraCosmeticsGUIAddon extends JavaPlugin {
89 @ Override
910 public void onEnable () {
1011 UltraCosmetics ultraCosmetics = UltraCosmeticsData .get ().getPlugin ();
1112 String version = ultraCosmetics .getDescription ().getVersion ().split ("-" )[0 ];
13+ String minor = version .substring (2 );
14+ // If there's more than two components to the version, strip it down to 2 so we can parse it as a number
15+ if (minor .contains ("." )) {
16+ version = version .substring (0 , 2 ) + minor .substring (0 , minor .indexOf ('.' ));
17+ }
1218 if (Double .parseDouble (version ) < 3.4 ) {
1319 throw new IllegalStateException ("This addon requires UltraCosmetics 3.4 or higher!" );
1420 }
1521 // Registers itself in order to avoid assuming the existence of UCAddon at runtime
1622 new GUIAddon (ultraCosmetics , this );
23+ new Metrics (this , 20962 );
1724 }
1825}
You can’t perform that action at this time.
0 commit comments