Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 08:10:11 +01:00
Update for Floodgate 2.0
Dieser Commit ist enthalten in:
Ursprung
17e3895b82
Commit
5418b9e263
@ -27,8 +27,8 @@ dependencies {
|
||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||
// You may need to force-disable transitiveness on them.
|
||||
|
||||
implementation 'org.geysermc:connector:1.2.0-SNAPSHOT'
|
||||
shadow 'org.geysermc:connector:1.2.0-SNAPSHOT'
|
||||
implementation 'org.geysermc:connector:1.3.0-SNAPSHOT'
|
||||
shadow 'org.geysermc:connector:1.3.0-SNAPSHOT'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
@ -6,7 +6,7 @@ minecraft_version=1.16.3
|
||||
yarn_mappings=1.16.3+build.28
|
||||
loader_version=0.10.1+build.209
|
||||
# Mod Properties
|
||||
mod_version=1.0-SNAPSHOT
|
||||
mod_version=1.3.0-SNAPSHOT
|
||||
maven_group=org.geysermc.platform
|
||||
archives_base_name=Geyser-Fabric
|
||||
# Dependencies
|
||||
|
@ -25,13 +25,28 @@
|
||||
|
||||
package org.geysermc.platform.fabric;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import org.geysermc.connector.FloodgateKeyLoader;
|
||||
import org.geysermc.connector.configuration.GeyserJacksonConfiguration;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GeyserFabricConfiguration extends GeyserJacksonConfiguration {
|
||||
@JsonIgnore
|
||||
private Path floodgateKeyPath;
|
||||
|
||||
public void loadFloodgate(GeyserFabricMod geyser, ModContainer floodgate) {
|
||||
Path geyserDataFolder = geyser.getConfigFolder();
|
||||
Path floodgateDataFolder = FabricLoader.getInstance().getConfigDir().resolve("floodgate");
|
||||
|
||||
floodgateKeyPath = FloodgateKeyLoader.getKeyPath(this, floodgate, floodgateDataFolder, geyserDataFolder, geyser.getGeyserLogger());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path getFloodgateKeyPath() {
|
||||
return null;
|
||||
return floodgateKeyPath;
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@ -55,10 +56,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
public class GeyserFabricMod implements ModInitializer, GeyserBootstrap {
|
||||
|
||||
@ -144,6 +142,19 @@ public class GeyserFabricMod implements ModInitializer, GeyserBootstrap {
|
||||
geyserConfig.getBedrock().setPort(geyserConfig.getRemote().getPort());
|
||||
}
|
||||
|
||||
Optional<ModContainer> floodgate = FabricLoader.getInstance().getModContainer("floodgate");
|
||||
boolean floodgatePresent = floodgate.isPresent();
|
||||
if (geyserConfig.getRemote().getAuthType().equals("floodgate") && !floodgatePresent) {
|
||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
return;
|
||||
} else if (geyserConfig.isAutoconfiguredRemote() && floodgatePresent) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
geyserLogger.debug("Auto-setting to Floodgate authentication.");
|
||||
geyserConfig.getRemote().setAuthType("floodgate");
|
||||
}
|
||||
|
||||
geyserConfig.loadFloodgate(this, floodgate.orElse(null));
|
||||
|
||||
this.connector = GeyserConnector.start(PlatformType.FABRIC, this);
|
||||
|
||||
this.geyserPingPassthrough = GeyserLegacyPingPassthrough.init(connector);
|
||||
|
@ -12,7 +12,7 @@
|
||||
"repo": "https://github.com/GeyserMC/Geyser-Fabric"
|
||||
},
|
||||
"license": "MIT",
|
||||
"icon": "assets/fabric/icon.png",
|
||||
"icon": "assets/geyser-fabric/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren