3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00
Dieser Commit ist enthalten in:
Camotoy 2021-02-05 12:29:15 -05:00
Ursprung 2020881799
Commit 31a7b798f1
7 geänderte Dateien mit 42 neuen und 21 gelöschten Zeilen

Datei anzeigen

@ -29,9 +29,6 @@ dependencies {
implementation 'org.geysermc:connector:1.2.0-SNAPSHOT' implementation 'org.geysermc:connector:1.2.0-SNAPSHOT'
shadow 'org.geysermc:connector:1.2.0-SNAPSHOT' shadow 'org.geysermc:connector:1.2.0-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok:1.18.4'
} }
repositories { repositories {

Datei anzeigen

@ -25,7 +25,6 @@
package org.geysermc.platform.fabric; package org.geysermc.platform.fabric;
import lombok.Getter;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.ModContainer;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
@ -35,7 +34,6 @@ import org.geysermc.connector.dump.BootstrapDumpInfo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Getter
public class GeyserFabricDumpInfo extends BootstrapDumpInfo { public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
private String serverIP; private String serverIP;
@ -57,4 +55,15 @@ public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
} }
} }
public String getServerIP() {
return this.serverIP;
}
public int getServerPort() {
return this.serverPort;
}
public List<ModInfo> getMods() {
return this.mods;
}
} }

Datei anzeigen

@ -26,7 +26,6 @@
package org.geysermc.platform.fabric; package org.geysermc.platform.fabric;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import lombok.Setter;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
@ -48,20 +47,21 @@ import org.geysermc.connector.utils.FileUtils;
import org.geysermc.connector.utils.LanguageUtils; import org.geysermc.connector.utils.LanguageUtils;
import org.geysermc.platform.fabric.command.GeyserFabricCommandExecutor; import org.geysermc.platform.fabric.command.GeyserFabricCommandExecutor;
import org.geysermc.platform.fabric.command.GeyserFabricCommandManager; import org.geysermc.platform.fabric.command.GeyserFabricCommandManager;
import org.jetbrains.annotations.Nullable;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.*; import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class GeyserFabricMod implements ModInitializer, GeyserBootstrap { public class GeyserFabricMod implements ModInitializer, GeyserBootstrap {
private static GeyserFabricMod instance; private static GeyserFabricMod instance;
@Setter
private boolean reloading; private boolean reloading;
private GeyserConnector connector; private GeyserConnector connector;
@ -207,6 +207,10 @@ public class GeyserFabricMod implements ModInitializer, GeyserBootstrap {
return this.server.getVersion(); return this.server.getVersion();
} }
public void setReloading(boolean reloading) {
this.reloading = reloading;
}
private File fileOrCopiedFromResource(File file, String name) throws IOException { private File fileOrCopiedFromResource(File file, String name) throws IOException {
if (!file.exists()) { if (!file.exists()) {
//noinspection ResultOfMethodCallIgnored //noinspection ResultOfMethodCallIgnored

Datei anzeigen

@ -27,7 +27,6 @@ package org.geysermc.platform.fabric;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
/** /**
* A class outline of the permissions.yml file * A class outline of the permissions.yml file
@ -35,8 +34,10 @@ import lombok.Getter;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class GeyserFabricPermissions { public class GeyserFabricPermissions {
@Getter
@JsonProperty("commands") @JsonProperty("commands")
private String[] commands; private String[] commands;
public String[] getCommands() {
return this.commands;
}
} }

Datei anzeigen

@ -25,7 +25,6 @@
package org.geysermc.platform.fabric; package org.geysermc.platform.fabric;
import lombok.Getter;
import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.ModContainer;
import java.util.ArrayList; import java.util.ArrayList;
@ -34,13 +33,12 @@ import java.util.List;
/** /**
* A wrapper for Fabric mod information to be presented in a Geyser dump * A wrapper for Fabric mod information to be presented in a Geyser dump
*/ */
@Getter
public class ModInfo { public class ModInfo {
private String name; private final String name;
private String id; private final String id;
private String version; private final String version;
private List<String> authors; private final List<String> authors;
public ModInfo(ModContainer mod) { public ModInfo(ModContainer mod) {
this.name = mod.getMetadata().getName(); this.name = mod.getMetadata().getName();
@ -50,4 +48,19 @@ public class ModInfo {
this.version = mod.getMetadata().getVersion().getFriendlyString(); this.version = mod.getMetadata().getVersion().getFriendlyString();
} }
public String getName() {
return this.name;
}
public String getId() {
return this.id;
}
public String getVersion() {
return this.version;
}
public List<String> getAuthors() {
return this.authors;
}
} }

Datei anzeigen

@ -32,7 +32,6 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.text.LiteralText; import net.minecraft.text.LiteralText;
import net.minecraft.world.GameMode; import net.minecraft.world.GameMode;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.utils.LanguageUtils; import org.geysermc.connector.utils.LanguageUtils;
import org.geysermc.platform.fabric.GeyserFabricMod; import org.geysermc.platform.fabric.GeyserFabricMod;
import org.geysermc.platform.fabric.GeyserServerPortGetter; import org.geysermc.platform.fabric.GeyserServerPortGetter;

Datei anzeigen

@ -32,7 +32,6 @@ import net.minecraft.resource.ResourcePackManager;
import net.minecraft.resource.ServerResourceManager; import net.minecraft.resource.ServerResourceManager;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.WorldGenerationProgressListenerFactory; import net.minecraft.server.WorldGenerationProgressListenerFactory;
import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraft.server.dedicated.MinecraftDedicatedServer; import net.minecraft.server.dedicated.MinecraftDedicatedServer;
import net.minecraft.util.UserCache; import net.minecraft.util.UserCache;
import net.minecraft.util.registry.DynamicRegistryManager; import net.minecraft.util.registry.DynamicRegistryManager;
@ -44,8 +43,7 @@ import org.spongepowered.asm.mixin.Mixin;
import java.net.Proxy; import java.net.Proxy;
@Mixin(MinecraftDedicatedServer.class) @Mixin(MinecraftDedicatedServer.class)
public abstract class MinecraftDedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter public abstract class MinecraftDedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter {
{
// Constructor to compile // Constructor to compile
public MinecraftDedicatedServerMixin(Thread thread, DynamicRegistryManager.Impl impl, LevelStorage.Session session, SaveProperties saveProperties, ResourcePackManager resourcePackManager, Proxy proxy, DataFixer dataFixer, ServerResourceManager serverResourceManager, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) { public MinecraftDedicatedServerMixin(Thread thread, DynamicRegistryManager.Impl impl, LevelStorage.Session session, SaveProperties saveProperties, ResourcePackManager resourcePackManager, Proxy proxy, DataFixer dataFixer, ServerResourceManager serverResourceManager, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) {
super(thread, impl, session, saveProperties, resourcePackManager, proxy, dataFixer, serverResourceManager, minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory); super(thread, impl, session, saveProperties, resourcePackManager, proxy, dataFixer, serverResourceManager, minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory);