3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-29 09:30:10 +01:00

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

Dieser Commit ist enthalten in:
onebeastchris 2024-09-24 21:37:25 +08:00
Ursprung 2ee488d995
Commit a44edb3b62
7 geänderte Dateien mit 17 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -21,7 +21,7 @@ dependencies {
shadow(projects.core) { isTransitive = false } shadow(projects.core) { isTransitive = false }
includeTransitive(projects.core) 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 // Avoids fabric complaining about non-SemVer versioning
shadow(libs.protocol.connection) { isTransitive = false } shadow(libs.protocol.connection) { isTransitive = false }
shadow(libs.protocol.common) { isTransitive = false } shadow(libs.protocol.common) { isTransitive = false }
@ -46,8 +46,6 @@ tasks.withType<Jar> {
relocate("org.cloudburstmc.netty") relocate("org.cloudburstmc.netty")
relocate("org.cloudburstmc.protocol") relocate("org.cloudburstmc.protocol")
relocate("com.github.steveice10.mc.auth")
platformRelocate("org.bstats")
tasks { tasks {
remapJar { remapJar {

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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