Skip to content

Commit 3a8857f

Browse files
removed bStats for now
1 parent 3547812 commit 3a8857f

File tree

5 files changed

+91
-47
lines changed

5 files changed

+91
-47
lines changed

.idea/workspace.xml

Lines changed: 58 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java'
3+
id 'io.github.goooler.shadow' version '8.1.8'
34
id 'xyz.jpenilla.run-velocity' version '2.3.1'
45
id 'xyz.jpenilla.run-paper' version '2.3.1'
56
}
@@ -11,6 +12,12 @@ description = 'A Velocity plugin for the hover player list in the server list.'
1112
repositories {
1213
mavenCentral()
1314
maven { url 'https://repo.velocitypowered.com/snapshots/' }
15+
maven {
16+
url = 'https://repo.papermc.io/repository/maven-public/'
17+
content {
18+
includeGroup 'com.velocitypowered'
19+
}
20+
}
1421
}
1522

1623
dependencies {
@@ -37,15 +44,27 @@ processResources {
3744
}
3845
}
3946

40-
// put jar artifact in build/dist/
41-
jar.destinationDirectory.set(layout.buildDirectory.dir('dist'))
47+
// https://imperceptiblethoughts.com/shadow/
48+
shadowJar {
49+
configurations = [project.configurations.shadow]
50+
archiveFileName = "${project.name}-${project.version}-velocity.jar"
51+
destinationDirectory = layout.buildDirectory.dir('dist')
52+
53+
relocate 'org.bstats', 'org.zeroBzeroT.shaded.bstats'
54+
55+
// delete unshaded jar
56+
doLast {
57+
file(jar.archiveFile).delete()
58+
}
59+
}
60+
build.finalizedBy(shadowJar)
4261

4362
// test setup
4463
runPaper.disablePluginJarDetection()
4564
tasks {
4665
runVelocity {
4766
runDirectory = layout.projectDirectory.dir('run').dir('proxy')
48-
dependsOn('build')
67+
dependsOn('shadowJar')
4968
velocityVersion("${project.velocity_api_version}")
5069
downloadPlugins {
5170
url("https://github.com/ViaVersion/ViaBackwards/releases/download/5.3.2/ViaBackwards-5.3.2.jar")
@@ -59,7 +78,7 @@ tasks {
5978
systemProperty('com.mojang.eula.agree', 'true')
6079
systemProperty('Paper.skipServerPropertiesComments', 'true')
6180
runDirectory = layout.projectDirectory.dir('run').dir('main')
62-
dependsOn('build')
81+
dependsOn('shadowJar')
6382
}
6483

6584
tasks.register('runServerQueue', runServer.getClass() as Class<Task>) {
@@ -71,6 +90,6 @@ tasks {
7190
github("zeroBzeroT", "QueueServerPlugin", "3.0.0-SNAPSHOT", "queueplugin-3.0.0-SNAPSHOT+1.20.6-paper.jar")
7291
url("https://ci.dmulloy2.net/job/ProtocolLib/723/artifact/build/libs/ProtocolLib.jar")
7392
}
74-
dependsOn('build')
93+
dependsOn('shadowJar')
7594
}
7695
}

src/main/java/org/zeroBzeroT/serverPingPlayerList/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private void createDefaultConfig() {
5050
writer.write("setHoverInfo: true\n");
5151
writer.write("messageOfTheDayOverride: false\n");
5252
writer.write("messageOfTheDay: \"A Minecraft Server\"\n");
53-
writer.write("bStats: true\n");
53+
writer.write("bStats: false\n");
5454
writer.write("useMainServer: false\n");
5555
writer.write("mainServer: \"main\"\n");
5656
}

src/main/java/org/zeroBzeroT/serverPingPlayerList/Main.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class Main {
2121
private final ProxyServer server;
2222
private final Logger logger;
2323
private final Path dataDirectory;
24+
//private final Factory factory;
2425

2526
private Config config;
2627
private ServerListListener serverListListener;
@@ -29,10 +30,11 @@ public class Main {
2930
private volatile ServerPing mainPing;
3031

3132
@Inject
32-
public Main(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory) {
33+
public Main(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory /*, Factory factory*/) {
3334
this.server = server;
3435
this.logger = logger;
3536
this.dataDirectory = dataDirectory;
37+
//this.factory = factory;
3638
}
3739

3840
@Subscribe
@@ -54,10 +56,10 @@ public void onProxyInitialize(ProxyInitializeEvent event) {
5456
// Some output to the console ;)
5557
config.logConfig();
5658

57-
// TODO Load Plugin Metrics
59+
// Load Plugin Metrics
5860
if (config.getBoolean("bStats")) {
59-
// bStats is Velocity Metrics v2, so you would prolly need to set up differently if you want to support it.
60-
// so this is js a placeholder for your metrics setup if needed.
61+
// TODO implement bStats
62+
// factory.make(this, 16229);
6163
}
6264
}
6365

src/main/resources/velocity-plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"version": "@VERSION@",
55
"description": "@DESCRIPTION@",
66
"authors": [
7-
"bierdosenhalter", "A4P5"
7+
"bierdosenhalter",
8+
"A4P5"
89
],
910
"main": "org.zeroBzeroT.serverPingPlayerList.Main"
1011
}

0 commit comments

Comments
 (0)