mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
The Great Refactor Part 3 - Entire project restructure
This commit is contained in:
parent
3f5cb29ee0
commit
2c663e0ee5
561 changed files with 2468 additions and 2457 deletions
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.velocity;
|
|||
import com.velocitypowered.api.plugin.PluginContainer;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import lombok.Getter;
|
||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
||||
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -29,9 +29,9 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
|||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.*;
|
||||
import io.netty.channel.local.LocalAddress;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.common.connection.GeyserInjector;
|
||||
import org.geysermc.geyser.common.connection.LocalServerChannelWrapper;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.network.netty.GeyserInjector;
|
||||
import org.geysermc.geyser.network.netty.LocalServerChannelWrapper;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.function.Supplier;
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
package org.geysermc.geyser.platform.velocity;
|
||||
|
||||
import org.geysermc.geyser.common.main.IGeyserMain;
|
||||
import org.geysermc.geyser.GeyserMain;
|
||||
|
||||
public class GeyserVelocityMain extends IGeyserMain {
|
||||
public class GeyserVelocityMain extends GeyserMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new GeyserVelocityMain().displayMessage();
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
|||
import com.velocitypowered.api.proxy.server.ServerPing;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.geysermc.geyser.common.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
|
|
@ -37,16 +37,16 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
|||
import lombok.Getter;
|
||||
import org.geysermc.common.PlatformType;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.common.AuthType;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.session.auth.AuthType;
|
||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandExecutor;
|
||||
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandManager;
|
||||
import org.geysermc.geyser.utils.FileUtils;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.util.FileUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
|||
"config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
||||
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserVelocityConfiguration.class);
|
||||
} catch (IOException ex) {
|
||||
logger.warn(LanguageUtils.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -118,15 +118,15 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
|||
try {
|
||||
// Should only exist on 1.0
|
||||
Class.forName("org.geysermc.floodgate.FloodgateAPI");
|
||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.outdated",
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.outdated",
|
||||
"https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/master/"));
|
||||
return;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && proxyServer.getPluginManager().getPlugin("floodgate").isEmpty()) {
|
||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
|
||||
+ LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
|
||||
+ GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||
return;
|
||||
} else if (geyserConfig.isAutoconfiguredRemote() && proxyServer.getPluginManager().getPlugin("floodgate").isPresent()) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
|
|
|
@ -30,9 +30,9 @@ import org.geysermc.geyser.GeyserImpl;
|
|||
import org.geysermc.geyser.command.CommandExecutor;
|
||||
import org.geysermc.geyser.command.CommandSender;
|
||||
import org.geysermc.geyser.command.GeyserCommand;
|
||||
import org.geysermc.geyser.common.ChatColor;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.text.ChatColor;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -53,11 +53,11 @@ public class GeyserVelocityCommandExecutor extends CommandExecutor implements Si
|
|||
GeyserCommand command = getCommand(invocation.arguments()[0]);
|
||||
if (command != null) {
|
||||
if (!invocation.source().hasPermission(getCommand(invocation.arguments()[0]).getPermission())) {
|
||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
|
||||
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
|
||||
return;
|
||||
}
|
||||
if (command.isBedrockOnly() && session == null) {
|
||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.bedrock_only", sender.getLocale()));
|
||||
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.bedrock_only", sender.getLocale()));
|
||||
return;
|
||||
}
|
||||
command.execute(session, sender, invocation.arguments().length > 1 ? Arrays.copyOfRange(invocation.arguments(), 1, invocation.arguments().length) : new String[0]);
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.velocitypowered.api.proxy.ConsoleCommandSource;
|
|||
import com.velocitypowered.api.proxy.Player;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.geysermc.geyser.command.CommandSender;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class VelocityCommandSender implements CommandSender {
|
|||
public VelocityCommandSender(CommandSource handle) {
|
||||
this.handle = handle;
|
||||
// Ensure even Java players' languages are loaded
|
||||
LanguageUtils.loadGeyserLocale(getLocale());
|
||||
GeyserLocale.loadGeyserLocale(getLocale());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,9 +68,9 @@ public class VelocityCommandSender implements CommandSender {
|
|||
public String getLocale() {
|
||||
if (handle instanceof Player) {
|
||||
Locale locale = ((Player) handle).getPlayerSettings().getLocale();
|
||||
return LanguageUtils.formatLocale(locale.getLanguage() + "_" + locale.getCountry());
|
||||
return GeyserLocale.formatLocale(locale.getLanguage() + "_" + locale.getCountry());
|
||||
}
|
||||
return LanguageUtils.getDefaultLocale();
|
||||
return GeyserLocale.getDefaultLocale();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue