1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-29 11:49:16 +00:00

Merge remote-tracking branch 'upstream/master' into configurate

# Conflicts:
#	bootstrap/mod/neoforge/build.gradle.kts
#	bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/GeyserModBootstrap.java
#	core/src/main/java/org/geysermc/geyser/GeyserImpl.java
#	core/src/main/java/org/geysermc/geyser/skin/SkinManager.java
#	core/src/main/java/org/geysermc/geyser/skin/SkinProvider.java
This commit is contained in:
onebeastchris
2025-10-15 18:53:12 +02:00
230 changed files with 9750 additions and 46360 deletions

View File

@@ -8,7 +8,10 @@ dependencies {
implementation(libs.cloud.bungee)
implementation(libs.adventure.text.serializer.bungeecord)
compileOnlyApi(libs.bungeecord.proxy)
compileOnlyApi(libs.bungeecord.proxy) {
isTransitive = false
}
compileOnlyApi(libs.bungeecord.api)
}
platformRelocate("net.md_5.bungee.jni")

View File

@@ -273,6 +273,11 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
return Paths.get(getProxy().getName().equals("BungeeCord") ? "proxy.log.0" : "logs/latest.log");
}
@Override
public @NonNull String getServerPlatform() {
return getProxy().getName();
}
@Nullable
@Override
public SocketAddress getSocketAddress() {

View File

@@ -8,8 +8,6 @@ architectury {
fabric()
}
val includeTransitive: Configuration = configurations.getByName("includeTransitive")
dependencies {
modImplementation(libs.fabric.loader)
modApi(libs.fabric.api)

View File

@@ -23,8 +23,8 @@
"geyser.mixins.json"
],
"depends": {
"fabricloader": ">=0.16.7",
"fabricloader": ">=0.17.2",
"fabric-api": "*",
"minecraft": ">=1.21.6"
"minecraft": ">=1.21.9"
}
}

View File

@@ -13,8 +13,6 @@ architectury {
provided("org.cloudburstmc.math", "api")
provided("com.google.errorprone", "error_prone_annotations")
val includeTransitive: Configuration = configurations.getByName("includeTransitive")
dependencies {
// See https://github.com/google/guava/issues/6618
modules {

View File

@@ -111,7 +111,7 @@ public class GeyserNeoForgeBootstrap extends GeyserModBootstrap {
@Override
public boolean isServer() {
return FMLLoader.getDist().isDedicatedServer();
return FMLLoader.getCurrent().getDist().isDedicatedServer();
}
private void onPermissionGather(PermissionGatherEvent.Nodes event) {

View File

@@ -55,10 +55,10 @@ public class GeyserNeoForgeDumpInfo extends BootstrapDumpInfo {
private final List<ModInfo> mods;
public GeyserNeoForgeDumpInfo(MinecraftServer server) {
this.platformName = FMLLoader.launcherHandlerName();
this.platformVersion = FMLLoader.versionInfo().neoForgeVersion();
this.minecraftVersion = FMLLoader.versionInfo().mcVersion();
this.dist = FMLLoader.getDist();
this.platformName = server.getServerModName();
this.platformVersion = FMLLoader.getCurrent().getVersionInfo().neoForgeVersion();
this.minecraftVersion = FMLLoader.getCurrent().getVersionInfo().mcVersion();
this.dist = FMLLoader.getCurrent().getDist();
this.serverIP = server.getLocalIp() == null ? "unknown" : server.getLocalIp();
this.serverPort = server.getPort();
this.onlineMode = server.usesAuthentication();

View File

@@ -38,7 +38,6 @@ import org.geysermc.geyser.platform.mod.platform.GeyserModPlatform;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
public class GeyserNeoForgePlatform implements GeyserModPlatform {
@@ -82,8 +81,7 @@ public class GeyserNeoForgePlatform implements GeyserModPlatform {
@Override
public @Nullable InputStream resolveResource(@NonNull String resource) {
try {
Path path = container.getModInfo().getOwningFile().getFile().findResource(resource);
return Files.newInputStream(path);
return container.getModInfo().getOwningFile().getFile().getContents().openFile(resource);
} catch (IOException e) {
return null;
}

View File

@@ -71,7 +71,7 @@ public class PermissionUtils {
case FALSE -> false;
case NOT_SET -> {
if (player != null) {
yield player.createCommandSourceStack().hasPermission(Objects.requireNonNull(player.getServer()).getOperatorUserPermissionLevel());
yield player.createCommandSourceStack().hasPermission(Objects.requireNonNull(player.level()).getServer().operatorUserPermissionLevel());
}
yield false; // NeoForge javadocs say player is null in the case of an offline player.
}

View File

@@ -16,12 +16,12 @@ config = "geyser_neoforge.mixins.json"
[[dependencies.geyser_neoforge]]
modId="neoforge"
type="required"
versionRange="[21.6.0-beta,)"
versionRange="[21.9.14-beta,)"
ordering="NONE"
side="BOTH"
[[dependencies.geyser_neoforge]]
modId="minecraft"
type="required"
versionRange="[1.21.6,)"
versionRange="[1.21.9,)"
ordering="NONE"
side="BOTH"

View File

@@ -226,4 +226,9 @@ public abstract class GeyserModBootstrap implements GeyserBootstrap {
public InputStream getResourceOrNull(String resource) {
return this.platform.resolveResource(resource);
}
@Override
public @NonNull String getServerPlatform() {
return server.getServerModName();
}
}

View File

@@ -26,17 +26,21 @@
package org.geysermc.geyser.platform.mod;
import net.minecraft.server.level.ServerPlayer;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.Permissions;
import org.geysermc.geyser.platform.mod.command.ModCommandSource;
import org.geysermc.geyser.util.VersionCheckUtils;
public final class GeyserModUpdateListener {
public static void onPlayReady(ServerPlayer player) {
// Should be creating this in the supplier, but we need it for the permission check.
// Not a big deal currently because ModCommandSource doesn't load locale, so don't need to try to wait for it.
ModCommandSource source = new ModCommandSource(player.createCommandSourceStack());
if (source.hasPermission(Permissions.CHECK_UPDATE)) {
VersionCheckUtils.checkForGeyserUpdate(() -> source);
// We could just not register the listener, but, this allows config reloading
if (GeyserImpl.getInstance().config().notifyOnNewBedrockUpdate()) {
// Should be creating this in the supplier, but we need it for the permission check.
// Not a big deal currently because ModCommandSource doesn't load locale, so don't need to try to wait for it.
ModCommandSource source = new ModCommandSource(player.createCommandSourceStack());
if (source.hasPermission(Permissions.CHECK_UPDATE)) {
VersionCheckUtils.checkForGeyserUpdate(() -> source);
}
}
}

View File

@@ -30,7 +30,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.Services;
import net.minecraft.server.WorldStem;
import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraft.server.level.progress.ChunkProgressListenerFactory;
import net.minecraft.server.level.progress.LevelLoadListener;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.world.level.storage.LevelStorageSource;
import org.geysermc.geyser.platform.mod.GeyserServerPortGetter;
@@ -40,8 +40,9 @@ import java.net.Proxy;
@Mixin(DedicatedServer.class)
public abstract class DedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter {
public DedicatedServerMixin(Thread thread, LevelStorageSource.LevelStorageAccess levelStorageAccess, PackRepository packRepository, WorldStem worldStem, Proxy proxy, DataFixer dataFixer, Services services, ChunkProgressListenerFactory chunkProgressListenerFactory) {
super(thread, levelStorageAccess, packRepository, worldStem, proxy, dataFixer, services, chunkProgressListenerFactory);
public DedicatedServerMixin(Thread thread, LevelStorageSource.LevelStorageAccess levelStorageAccess, PackRepository packRepository, WorldStem worldStem, Proxy proxy, DataFixer dataFixer, Services services, LevelLoadListener levelLoadListener) {
super(thread, levelStorageAccess, packRepository, worldStem, proxy, dataFixer, services, levelLoadListener);
}
@Override

View File

@@ -80,7 +80,7 @@ modrinth {
uploadFile.set(tasks.getByPath("shadowJar"))
gameVersions.addAll("1.16.5", "1.17", "1.17.1", "1.18", "1.18.1", "1.18.2", "1.19",
"1.19.1", "1.19.2", "1.19.3", "1.19.4", "1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6",
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6")
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8")
loaders.addAll("spigot", "paper")
}

View File

@@ -96,19 +96,31 @@ public class GeyserSpigotCompressionDisabler extends ChannelOutboundHandlerAdapt
private static Class<?> findCompressionPacket() throws ClassNotFoundException {
try {
return Class.forName("net.minecraft.network.protocol.login.PacketLoginOutSetCompression");
// Mojmaps
return Class.forName("net.minecraft.network.protocol.login.ClientboundLoginCompressionPacket");
} catch (ClassNotFoundException e) {
String prefix = Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit", "net.minecraft.server");
return Class.forName(prefix + ".PacketLoginOutSetCompression");
try {
// Spigot mappings
return Class.forName("net.minecraft.network.protocol.login.PacketLoginOutSetCompression");
} catch (ClassNotFoundException ex) {
String prefix = Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit", "net.minecraft.server");
return Class.forName(prefix + ".PacketLoginOutSetCompression");
}
}
}
private static Class<?> findLoginSuccessPacket() throws ClassNotFoundException {
try {
return Class.forName("net.minecraft.network.protocol.login.PacketLoginOutSuccess");
// Mojmaps
return Class.forName("net.minecraft.network.protocol.login.ClientboundLoginFinishedPacket");
} catch (ClassNotFoundException e) {
String prefix = Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit", "net.minecraft.server");
return Class.forName(prefix + ".PacketLoginOutSuccess");
try {
// Spigot mappings
return Class.forName("net.minecraft.network.protocol.login.PacketLoginOutSuccess");
} catch (ClassNotFoundException ex) {
String prefix = Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit", "net.minecraft.server");
return Class.forName(prefix + ".PacketLoginOutSuccess");
}
}
}
}

View File

@@ -406,6 +406,11 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
return this.minecraftVersion;
}
@Override
public @NonNull String getServerPlatform() {
return Bukkit.getName();
}
@Override
public SocketAddress getSocketAddress() {
return this.geyserInjector.getServerSocketAddress();

View File

@@ -275,6 +275,11 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
return new GeyserStandaloneDumpInfo(this);
}
@Override
public @NonNull String getServerPlatform() {
return PlatformType.STANDALONE.platformName();
}
@NonNull
@Override
public String getServerBindAddress() {

View File

@@ -233,6 +233,11 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
return new GeyserVelocityDumpInfo(proxyServer);
}
@Override
public @NonNull String getServerPlatform() {
return proxyServer.getVersion().getName();
}
@Nullable
@Override
public SocketAddress getSocketAddress() {

View File

@@ -240,6 +240,11 @@ public class GeyserViaProxyPlugin extends ViaProxyPlugin implements GeyserBootst
return new GeyserViaProxyDumpInfo();
}
@Override
public @NonNull String getServerPlatform() {
return PlatformType.VIAPROXY.platformName();
}
@NonNull
@Override
public String getServerBindAddress() {