Fix: disable bstats relocation on platforms where it is not needed

This commit is contained in:
onebeastchris 2024-09-24 21:37:25 +08:00
parent 2ee488d995
commit a44edb3b62
7 changed files with 17 additions and 9 deletions

View file

@ -21,7 +21,7 @@ dependencies {
shadow(projects.core) { isTransitive = false }
includeTransitive(projects.core)
// These are NOT transitively included, and instead shadowed + relocated.
// These are NOT transitively included, and instead shadowed (+ relocated, if not under the org.geyser namespace).
// Avoids fabric complaining about non-SemVer versioning
shadow(libs.protocol.connection) { isTransitive = false }
shadow(libs.protocol.common) { isTransitive = false }
@ -46,8 +46,6 @@ tasks.withType<Jar> {
relocate("org.cloudburstmc.netty")
relocate("org.cloudburstmc.protocol")
relocate("com.github.steveice10.mc.auth")
platformRelocate("org.bstats")
tasks {
remapJar {

View file

@ -199,7 +199,6 @@ public abstract class GeyserModBootstrap implements GeyserBootstrap {
@Override
public int getServerPort() {
// TODO test
return ((GeyserServerPortGetter) server).geyser$getServerPort();
}

View file

@ -61,8 +61,8 @@ public class IntegratedServerMixin implements GeyserServerPortGetter {
GeyserLocale.loadGeyserLocale(this.minecraft.options.languageCode);
// Give indication that Geyser is loaded
Objects.requireNonNull(this.minecraft.player);
this.minecraft.player.displayClientMessage(Component.literal(GeyserLocale.getPlayerLocaleString("geyser.core.start",
this.minecraft.options.languageCode, "localhost", String.valueOf(GeyserImpl.getInstance().bedrockListener().port()))), false);
this.minecraft.player.displayClientMessage(Component.literal(GeyserLocale.getPlayerLocaleString("geyser.core.start.ip_suppressed",
this.minecraft.options.languageCode, String.valueOf(GeyserImpl.getInstance().bedrockListener().port()))), false);
}
}

View file

@ -82,8 +82,6 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED); // Can eat performance
}
System.setProperty("bstats.relocatecheck", "false");
GeyserStandaloneBootstrap bootstrap = new GeyserStandaloneBootstrap();
// Set defaults
boolean useGuiOpts = bootstrap.useGui;

View file

@ -62,6 +62,9 @@ repositories {
name = "viaversion"
}
// MinecraftAuth
maven("https://maven.lenni0451.net/snapshots")
// Jitpack for e.g. MCPL
maven("https://jitpack.io") {
content { includeGroupByRegex("com\\.github\\..*") }

View file

@ -25,6 +25,9 @@
package org.geysermc.geyser.util.metrics;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.api.util.PlatformType;
public interface MetricsPlatform {
boolean enabled();
@ -35,4 +38,11 @@ public interface MetricsPlatform {
boolean logSentData();
boolean logResponseStatusText();
default boolean disableRelocateCheck() {
PlatformType platformType = GeyserImpl.getInstance().platformType();
return platformType == PlatformType.FABRIC ||
platformType == PlatformType.NEOFORGE ||
platformType == PlatformType.STANDALONE;
}
}

View file

@ -1,6 +1,6 @@
[versions]
base-api = "1.0.1"
bstats = "3.0.2"
bstats = "3.1.0"
cumulus = "1.1.2"
configurate = "4.2.0-GeyserMC-SNAPSHOT"
erosion = "1.1-20240521.000109-3"