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.bungeecord;
|
|||
import lombok.Getter;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
||||
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -40,10 +40,10 @@ import net.md_5.bungee.api.plugin.Plugin;
|
|||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.md_5.bungee.netty.PipelineUtils;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.common.connection.GeyserInjector;
|
||||
import org.geysermc.geyser.common.connection.LocalServerChannelWrapper;
|
||||
import org.geysermc.geyser.common.connection.LocalSession;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.network.netty.GeyserInjector;
|
||||
import org.geysermc.geyser.network.netty.LocalServerChannelWrapper;
|
||||
import org.geysermc.geyser.network.netty.LocalSession;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
package org.geysermc.geyser.platform.bungeecord;
|
||||
|
||||
import org.geysermc.geyser.common.main.IGeyserMain;
|
||||
import org.geysermc.geyser.GeyserMain;
|
||||
|
||||
public class GeyserBungeeMain extends IGeyserMain {
|
||||
public class GeyserBungeeMain extends GeyserMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new GeyserBungeeMain().displayMessage();
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.md_5.bungee.api.connection.PendingConnection;
|
|||
import net.md_5.bungee.api.event.ProxyPingEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
import org.geysermc.geyser.common.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
|
|
@ -29,15 +29,15 @@ import net.md_5.bungee.api.config.ListenerInfo;
|
|||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import org.geysermc.common.PlatformType;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.command.CommandManager;
|
||||
import org.geysermc.geyser.common.AuthType;
|
||||
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.utils.FileUtils;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.util.FileUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandExecutor;
|
||||
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandManager;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
@ -72,7 +72,7 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
File configFile = FileUtils.fileOrCopiedFromResource(new File(getDataFolder(), "config.yml"), "config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
||||
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserBungeeConfiguration.class);
|
||||
} catch (IOException ex) {
|
||||
getLogger().log(Level.WARNING, LanguageUtils.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
getLogger().log(Level.WARNING, GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -101,12 +101,12 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
|
||||
// Remove this in like a year
|
||||
if (getProxy().getPluginManager().getPlugin("floodgate-bungee") != null) {
|
||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.outdated", "https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/master/"));
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.outdated", "https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/master/"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && getProxy().getPluginManager().getPlugin("floodgate") == null) {
|
||||
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() && getProxy().getPluginManager().getPlugin("floodgate") != null) {
|
||||
// Floodgate installed means that the user wants Floodgate authentication
|
||||
|
|
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.bungeecord.command;
|
|||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import org.geysermc.geyser.command.CommandSender;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
public class BungeeCommandSender implements CommandSender {
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class BungeeCommandSender implements CommandSender {
|
|||
public BungeeCommandSender(net.md_5.bungee.api.CommandSender handle) {
|
||||
this.handle = handle;
|
||||
// Ensure even Java players' languages are loaded
|
||||
LanguageUtils.loadGeyserLocale(getLocale());
|
||||
GeyserLocale.loadGeyserLocale(getLocale());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,9 +59,9 @@ public class BungeeCommandSender implements CommandSender {
|
|||
public String getLocale() {
|
||||
if (handle instanceof ProxiedPlayer player) {
|
||||
String locale = player.getLocale().getLanguage() + "_" + player.getLocale().getCountry();
|
||||
return LanguageUtils.formatLocale(locale);
|
||||
return GeyserLocale.formatLocale(locale);
|
||||
}
|
||||
return LanguageUtils.getDefaultLocale();
|
||||
return GeyserLocale.getDefaultLocale();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,8 +32,8 @@ import net.md_5.bungee.api.plugin.TabExecutor;
|
|||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.command.CommandExecutor;
|
||||
import org.geysermc.geyser.command.GeyserCommand;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -56,13 +56,13 @@ public class GeyserBungeeCommandExecutor extends Command implements TabExecutor
|
|||
GeyserCommand command = this.commandExecutor.getCommand(args[0]);
|
||||
if (command != null) {
|
||||
if (!sender.hasPermission(command.getPermission())) {
|
||||
String message = LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", commandSender.getLocale());
|
||||
String message = GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", commandSender.getLocale());
|
||||
|
||||
commandSender.sendMessage(ChatColor.RED + message);
|
||||
return;
|
||||
}
|
||||
if (command.isBedrockOnly() && session == null) {
|
||||
String message = LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.bedrock_only", commandSender.getLocale());
|
||||
String message = GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.bedrock_only", commandSender.getLocale());
|
||||
|
||||
commandSender.sendMessage(ChatColor.RED + message);
|
||||
return;
|
||||
|
|
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.spigot;
|
|||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
||||
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
@ -31,9 +31,9 @@ import io.netty.channel.*;
|
|||
import io.netty.channel.local.LocalAddress;
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
import org.bukkit.Bukkit;
|
||||
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.lang.reflect.Method;
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
package org.geysermc.geyser.platform.spigot;
|
||||
|
||||
import org.geysermc.geyser.common.main.IGeyserMain;
|
||||
import org.geysermc.geyser.GeyserMain;
|
||||
|
||||
public class GeyserSpigotMain extends IGeyserMain {
|
||||
public class GeyserSpigotMain extends GeyserMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new GeyserSpigotMain().displayMessage();
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
import org.bukkit.util.CachedServerIcon;
|
||||
import org.geysermc.geyser.common.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
|
||||
|
|
|
@ -33,18 +33,18 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.geysermc.common.PlatformType;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.command.CommandManager;
|
||||
import org.geysermc.geyser.common.AuthType;
|
||||
import org.geysermc.geyser.session.auth.AuthType;
|
||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||
import org.geysermc.geyser.network.translators.world.WorldManager;
|
||||
import org.geysermc.geyser.level.WorldManager;
|
||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
import org.geysermc.geyser.utils.Constants;
|
||||
import org.geysermc.geyser.utils.FileUtils;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.Constants;
|
||||
import org.geysermc.geyser.util.FileUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||
import org.geysermc.geyser.platform.spigot.command.GeyserSpigotCommandExecutor;
|
||||
import org.geysermc.geyser.platform.spigot.command.GeyserSpigotCommandManager;
|
||||
|
@ -87,7 +87,7 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
File configFile = FileUtils.fileOrCopiedFromResource(new File(getDataFolder(), "config.yml"), "config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
||||
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpigotConfiguration.class);
|
||||
} catch (IOException ex) {
|
||||
getLogger().log(Level.WARNING, LanguageUtils.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
getLogger().log(Level.WARNING, GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,8 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
// And since there are alternative ways to get Geyser working for these aging platforms, it's not worth it.
|
||||
getLogger().severe("*********************************************");
|
||||
getLogger().severe("");
|
||||
getLogger().severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_server.header"));
|
||||
getLogger().severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_server.message", "1.12.2"));
|
||||
getLogger().severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.unsupported_server.header"));
|
||||
getLogger().severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.unsupported_server.message", "1.12.2"));
|
||||
getLogger().severe("");
|
||||
getLogger().severe("*********************************************");
|
||||
|
||||
|
@ -127,13 +127,13 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
|
||||
// Remove this in like a year
|
||||
if (Bukkit.getPluginManager().getPlugin("floodgate-bukkit") != null) {
|
||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.outdated", Constants.FLOODGATE_DOWNLOAD_LOCATION));
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.outdated", Constants.FLOODGATE_DOWNLOAD_LOCATION));
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && Bukkit.getPluginManager().getPlugin("floodgate") == null) {
|
||||
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"));
|
||||
this.getPluginLoader().disablePlugin(this);
|
||||
return;
|
||||
} else if (geyserConfig.isAutoconfiguredRemote() && Bukkit.getPluginManager().getPlugin("floodgate") != null) {
|
||||
|
@ -163,7 +163,7 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
|||
// Ensure that we have the latest 4.0.0 changes and not an older ViaVersion version
|
||||
Class.forName("com.viaversion.viaversion.api.ViaManager");
|
||||
} catch (ClassNotFoundException e) {
|
||||
geyserLogger.warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.viaversion.too_old",
|
||||
geyserLogger.warning(GeyserLocale.getLocaleStringLog("geyser.bootstrap.viaversion.too_old",
|
||||
"https://ci.viaversion.com/job/ViaVersion/"));
|
||||
isViaVersion = false;
|
||||
if (this.geyserConfig.isDebugMode()) {
|
||||
|
|
|
@ -32,8 +32,8 @@ import org.bukkit.command.TabExecutor;
|
|||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.command.CommandExecutor;
|
||||
import org.geysermc.geyser.command.GeyserCommand;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -54,13 +54,13 @@ public class GeyserSpigotCommandExecutor extends CommandExecutor implements TabE
|
|||
GeyserCommand geyserCommand = getCommand(args[0]);
|
||||
if (geyserCommand != null) {
|
||||
if (!sender.hasPermission(geyserCommand.getPermission())) {
|
||||
String message = LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", commandSender.getLocale());
|
||||
String message = GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", commandSender.getLocale());
|
||||
|
||||
commandSender.sendMessage(ChatColor.RED + message);
|
||||
return true;
|
||||
}
|
||||
if (geyserCommand.isBedrockOnly() && session == null) {
|
||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.bedrock_only", commandSender.getLocale()));
|
||||
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.bedrock_only", commandSender.getLocale()));
|
||||
return true;
|
||||
}
|
||||
geyserCommand.execute(session, commandSender, args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.bukkit.command.ConsoleCommandSender;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.command.CommandSender;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -50,7 +50,7 @@ public class SpigotCommandSender implements CommandSender {
|
|||
this.handle = handle;
|
||||
this.locale = getSpigotLocale();
|
||||
// Ensure even Java players' languages are loaded
|
||||
LanguageUtils.loadGeyserLocale(locale);
|
||||
GeyserLocale.loadGeyserLocale(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,6 +114,6 @@ public class SpigotCommandSender implements CommandSender {
|
|||
return player.getLocale();
|
||||
}
|
||||
}
|
||||
return LanguageUtils.getDefaultLocale();
|
||||
return GeyserLocale.getDefaultLocale();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,11 +41,11 @@ import org.bukkit.event.block.BlockPistonEvent;
|
|||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.session.cache.PistonCache;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.network.translators.world.block.entity.PistonBlockEntity;
|
||||
import org.geysermc.geyser.utils.Direction;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.cache.PistonCache;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.translator.level.block.entity.PistonBlockEntity;
|
||||
import org.geysermc.geyser.level.physics.Direction;
|
||||
import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -48,9 +48,9 @@ import org.bukkit.inventory.ShapedRecipe;
|
|||
import org.bukkit.inventory.ShapelessRecipe;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.item.ItemTranslator;
|
||||
import org.geysermc.geyser.utils.InventoryUtils;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
|
||||
import org.geysermc.geyser.util.InventoryUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ import org.bukkit.event.EventHandler;
|
|||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager;
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.storage.BlockSto
|
|||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
package org.geysermc.geyser.platform.spigot.world.manager;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
|
||||
/**
|
||||
* Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSession, int, int, int)}
|
||||
|
|
|
@ -33,7 +33,7 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
|||
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.platform.spigot.GeyserSpigotPlugin;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -28,8 +28,8 @@ package org.geysermc.geyser.platform.spigot.world.manager;
|
|||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
||||
|
||||
|
|
|
@ -39,13 +39,13 @@ import org.bukkit.inventory.ItemStack;
|
|||
import org.bukkit.inventory.meta.BookMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.network.translators.inventory.translators.LecternInventoryTranslator;
|
||||
import org.geysermc.geyser.network.translators.world.GeyserWorldManager;
|
||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator;
|
||||
import org.geysermc.geyser.level.GeyserWorldManager;
|
||||
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||
import org.geysermc.geyser.registry.BlockRegistries;
|
||||
import org.geysermc.geyser.utils.BlockEntityUtils;
|
||||
import org.geysermc.geyser.utils.GameRule;
|
||||
import org.geysermc.geyser.util.BlockEntityUtils;
|
||||
import org.geysermc.geyser.level.GameRule;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
package org.geysermc.geyser.platform.sponge;
|
||||
|
||||
import org.geysermc.geyser.common.main.IGeyserMain;
|
||||
import org.geysermc.geyser.GeyserMain;
|
||||
|
||||
public class GeyserSpongeMain extends IGeyserMain {
|
||||
public class GeyserSpongeMain extends GeyserMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new GeyserSpongeMain().displayMessage();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
package org.geysermc.geyser.platform.sponge;
|
||||
|
||||
import org.geysermc.geyser.common.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.ping.GeyserPingInfo;
|
||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
import org.spongepowered.api.MinecraftVersion;
|
||||
|
|
|
@ -28,14 +28,14 @@ package org.geysermc.geyser.platform.sponge;
|
|||
import com.google.inject.Inject;
|
||||
import org.geysermc.common.PlatformType;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.command.CommandManager;
|
||||
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.utils.FileUtils;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.util.FileUtils;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.geyser.platform.sponge.command.GeyserSpongeCommandExecutor;
|
||||
import org.geysermc.geyser.platform.sponge.command.GeyserSpongeCommandManager;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -78,14 +78,14 @@ public class GeyserSpongePlugin implements GeyserBootstrap {
|
|||
try {
|
||||
configFile = FileUtils.fileOrCopiedFromResource(new File(configDir, "config.yml"), "config.yml", (file) -> file.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
||||
} catch (IOException ex) {
|
||||
logger.warn(LanguageUtils.getLocaleStringLog("geyser.config.failed"));
|
||||
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"));
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpongeConfiguration.class);
|
||||
} catch (IOException ex) {
|
||||
logger.warn(LanguageUtils.getLocaleStringLog("geyser.config.failed"));
|
||||
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"));
|
||||
ex.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -29,9 +29,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 org.spongepowered.api.command.CommandCallable;
|
||||
import org.spongepowered.api.command.CommandResult;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
|
@ -62,11 +62,11 @@ public class GeyserSpongeCommandExecutor extends CommandExecutor implements Comm
|
|||
if (command != null) {
|
||||
if (!source.hasPermission(command.getPermission())) {
|
||||
// Not ideal to use log here but we dont get a session
|
||||
source.sendMessage(Text.of(ChatColor.RED + LanguageUtils.getLocaleStringLog("geyser.bootstrap.command.permission_fail")));
|
||||
source.sendMessage(Text.of(ChatColor.RED + GeyserLocale.getLocaleStringLog("geyser.bootstrap.command.permission_fail")));
|
||||
return CommandResult.success();
|
||||
}
|
||||
if (command.isBedrockOnly() && session == null) {
|
||||
source.sendMessage(Text.of(ChatColor.RED + LanguageUtils.getLocaleStringLog("geyser.bootstrap.command.bedrock_only")));
|
||||
source.sendMessage(Text.of(ChatColor.RED + GeyserLocale.getLocaleStringLog("geyser.bootstrap.command.bedrock_only")));
|
||||
return CommandResult.success();
|
||||
}
|
||||
getCommand(args[0]).execute(session, commandSender, args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
||||
|
|
|
@ -40,15 +40,15 @@ import org.apache.logging.log4j.core.Logger;
|
|||
import org.apache.logging.log4j.core.appender.ConsoleAppender;
|
||||
import org.geysermc.common.PlatformType;
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.geyser.GeyserBootstrap;
|
||||
import org.geysermc.geyser.command.CommandManager;
|
||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
|
||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||
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.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
|
||||
import org.geysermc.geyser.platform.standalone.gui.GeyserStandaloneGUI;
|
||||
|
||||
|
@ -102,19 +102,19 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
|||
case "--nogui", "nogui" -> useGuiOpts = false;
|
||||
case "--config", "-c" -> {
|
||||
if (i >= args.length - 1) {
|
||||
System.err.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config_not_specified"), "-c"));
|
||||
System.err.println(MessageFormat.format(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.config_not_specified"), "-c"));
|
||||
return;
|
||||
}
|
||||
configFilenameOpt = args[i + 1];
|
||||
i++;
|
||||
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config_specified"), configFilenameOpt));
|
||||
System.out.println(MessageFormat.format(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.config_specified"), configFilenameOpt));
|
||||
}
|
||||
case "--help", "-h" -> {
|
||||
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.usage"), "[java -jar] Geyser.jar [opts]"));
|
||||
System.out.println(" " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.options"));
|
||||
System.out.println(" -c, --config [file] " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config"));
|
||||
System.out.println(" -h, --help " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.help"));
|
||||
System.out.println(" --gui, --nogui " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.gui"));
|
||||
System.out.println(MessageFormat.format(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.usage"), "[java -jar] Geyser.jar [opts]"));
|
||||
System.out.println(" " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.options"));
|
||||
System.out.println(" -c, --config [file] " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.config"));
|
||||
System.out.println(" -h, --help " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.help"));
|
||||
System.out.println(" --gui, --nogui " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.gui"));
|
||||
return;
|
||||
}
|
||||
default -> {
|
||||
|
@ -153,7 +153,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
|||
}
|
||||
}
|
||||
}
|
||||
System.err.println(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.unrecognised", arg));
|
||||
System.err.println(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.unrecognised", arg));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
|||
geyserConfig.getRemote().setAddress("127.0.0.1");
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
|
||||
if (gui == null) {
|
||||
System.exit(1);
|
||||
} else {
|
||||
|
@ -345,7 +345,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
|||
// Loop through the sub property if the first part matches
|
||||
for (BeanPropertyDefinition subProperty : getPOJOForClass(property.getRawPrimaryType())) {
|
||||
if (configKeyParts[1].equals(subProperty.getName())) {
|
||||
geyserLogger.info(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.set_config_option", configKey.getKey(), configKey.getValue()));
|
||||
geyserLogger.info(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.set_config_option", configKey.getKey(), configKey.getValue()));
|
||||
|
||||
// Set the sub property value on the config
|
||||
try {
|
||||
|
@ -359,7 +359,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
geyserLogger.info(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.set_config_option", configKey.getKey(), configKey.getValue()));
|
||||
geyserLogger.info(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.set_config_option", configKey.getKey(), configKey.getValue()));
|
||||
|
||||
// Set the property value on the config
|
||||
try {
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.logging.log4j.core.config.Configurator;
|
|||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.api.logger.GeyserLogger;
|
||||
import org.geysermc.geyser.command.CommandSender;
|
||||
import org.geysermc.geyser.common.ChatColor;
|
||||
import org.geysermc.geyser.text.ChatColor;
|
||||
|
||||
@Log4j2
|
||||
public class GeyserStandaloneLogger extends SimpleTerminalConsole implements GeyserLogger, CommandSender {
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
package org.geysermc.geyser.platform.standalone;
|
||||
|
||||
import org.geysermc.geyser.common.ChatColor;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.text.ChatColor;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
|
@ -56,12 +56,12 @@ public class LoopbackUtil {
|
|||
Files.write(Paths.get(System.getenv("temp") + "/loopback_minecraft.bat"), loopbackCommand.getBytes());
|
||||
Runtime.getRuntime().exec(startScript);
|
||||
|
||||
geyserLogger.info(ChatColor.AQUA + LanguageUtils.getLocaleStringLog("geyser.bootstrap.loopback.added"));
|
||||
geyserLogger.info(ChatColor.AQUA + GeyserLocale.getLocaleStringLog("geyser.bootstrap.loopback.added"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
geyserLogger.error(LanguageUtils.getLocaleStringLog("geyser.bootstrap.loopback.failed"));
|
||||
geyserLogger.error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.loopback.failed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ package org.geysermc.geyser.platform.standalone.gui;
|
|||
|
||||
import org.geysermc.geyser.GeyserImpl;
|
||||
import org.geysermc.geyser.command.GeyserCommand;
|
||||
import org.geysermc.geyser.network.session.GeyserSession;
|
||||
import org.geysermc.geyser.utils.LanguageUtils;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.text.GeyserLocale;
|
||||
import org.geysermc.geyser.platform.standalone.GeyserStandaloneLogger;
|
||||
import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class GeyserStandaloneGUI {
|
|||
|
||||
public GeyserStandaloneGUI() {
|
||||
// Create the frame and setup basic settings
|
||||
JFrame frame = new JFrame(LanguageUtils.getLocaleStringLog("geyser.gui.title"));
|
||||
JFrame frame = new JFrame(GeyserLocale.getLocaleStringLog("geyser.gui.title"));
|
||||
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
frame.setSize(800, 400);
|
||||
frame.setMinimumSize(frame.getSize());
|
||||
|
@ -82,8 +82,8 @@ public class GeyserStandaloneGUI {
|
|||
@Override
|
||||
public void windowClosing(WindowEvent we)
|
||||
{
|
||||
String[] buttons = {LanguageUtils.getLocaleStringLog("geyser.gui.exit.confirm"), LanguageUtils.getLocaleStringLog("geyser.gui.exit.deny")};
|
||||
int result = JOptionPane.showOptionDialog(frame, LanguageUtils.getLocaleStringLog("geyser.gui.exit.message"), frame.getTitle(), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, buttons, buttons[1]);
|
||||
String[] buttons = {GeyserLocale.getLocaleStringLog("geyser.gui.exit.confirm"), GeyserLocale.getLocaleStringLog("geyser.gui.exit.deny")};
|
||||
int result = JOptionPane.showOptionDialog(frame, GeyserLocale.getLocaleStringLog("geyser.gui.exit.message"), frame.getTitle(), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, buttons, buttons[1]);
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
System.exit(0);
|
||||
}
|
||||
|
@ -124,12 +124,12 @@ public class GeyserStandaloneGUI {
|
|||
JMenuBar menuBar = new JMenuBar();
|
||||
|
||||
// Create 'File'
|
||||
JMenu fileMenu = new JMenu(LanguageUtils.getLocaleStringLog("geyser.gui.menu.file"));
|
||||
JMenu fileMenu = new JMenu(GeyserLocale.getLocaleStringLog("geyser.gui.menu.file"));
|
||||
fileMenu.setMnemonic(KeyEvent.VK_F);
|
||||
menuBar.add(fileMenu);
|
||||
|
||||
// 'Open Geyser folder' button
|
||||
JMenuItem openButton = new JMenuItem(LanguageUtils.getLocaleStringLog("geyser.gui.menu.file.open_folder"), KeyEvent.VK_O);
|
||||
JMenuItem openButton = new JMenuItem(GeyserLocale.getLocaleStringLog("geyser.gui.menu.file.open_folder"), KeyEvent.VK_O);
|
||||
openButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
|
||||
openButton.addActionListener(e -> {
|
||||
try {
|
||||
|
@ -141,40 +141,40 @@ public class GeyserStandaloneGUI {
|
|||
fileMenu.addSeparator();
|
||||
|
||||
// 'Exit' button
|
||||
JMenuItem exitButton = new JMenuItem(LanguageUtils.getLocaleStringLog("geyser.gui.menu.file.exit"), KeyEvent.VK_X);
|
||||
JMenuItem exitButton = new JMenuItem(GeyserLocale.getLocaleStringLog("geyser.gui.menu.file.exit"), KeyEvent.VK_X);
|
||||
exitButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.ALT_MASK));
|
||||
exitButton.addActionListener(e -> System.exit(0));
|
||||
fileMenu.add(exitButton);
|
||||
|
||||
// Create 'Commands'
|
||||
commandsMenu = new JMenu(LanguageUtils.getLocaleStringLog("geyser.gui.menu.commands"));
|
||||
commandsMenu = new JMenu(GeyserLocale.getLocaleStringLog("geyser.gui.menu.commands"));
|
||||
commandsMenu.setMnemonic(KeyEvent.VK_C);
|
||||
menuBar.add(commandsMenu);
|
||||
|
||||
// Create 'View'
|
||||
JMenu viewMenu = new JMenu(LanguageUtils.getLocaleStringLog("geyser.gui.menu.view"));
|
||||
JMenu viewMenu = new JMenu(GeyserLocale.getLocaleStringLog("geyser.gui.menu.view"));
|
||||
viewMenu.setMnemonic(KeyEvent.VK_V);
|
||||
menuBar.add(viewMenu);
|
||||
|
||||
// 'Zoom in' button
|
||||
JMenuItem zoomInButton = new JMenuItem(LanguageUtils.getLocaleStringLog("geyser.gui.menu.view.zoom_in"));
|
||||
JMenuItem zoomInButton = new JMenuItem(GeyserLocale.getLocaleStringLog("geyser.gui.menu.view.zoom_in"));
|
||||
zoomInButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_DOWN_MASK));
|
||||
zoomInButton.addActionListener(e -> consolePane.setFont(new Font(consolePane.getFont().getName(), consolePane.getFont().getStyle(), consolePane.getFont().getSize() + 1)));
|
||||
viewMenu.add(zoomInButton);
|
||||
|
||||
// 'Zoom in' button
|
||||
JMenuItem zoomOutButton = new JMenuItem(LanguageUtils.getLocaleStringLog("geyser.gui.menu.view.zoom_out"));
|
||||
JMenuItem zoomOutButton = new JMenuItem(GeyserLocale.getLocaleStringLog("geyser.gui.menu.view.zoom_out"));
|
||||
zoomOutButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_DOWN_MASK));
|
||||
zoomOutButton.addActionListener(e -> consolePane.setFont(new Font(consolePane.getFont().getName(), consolePane.getFont().getStyle(), consolePane.getFont().getSize() - 1)));
|
||||
viewMenu.add(zoomOutButton);
|
||||
|
||||
// 'Reset Zoom' button
|
||||
JMenuItem resetZoomButton = new JMenuItem(LanguageUtils.getLocaleStringLog("geyser.gui.menu.view.reset_zoom"));
|
||||
JMenuItem resetZoomButton = new JMenuItem(GeyserLocale.getLocaleStringLog("geyser.gui.menu.view.reset_zoom"));
|
||||
resetZoomButton.addActionListener(e -> consolePane.setFont(new Font(consolePane.getFont().getName(), consolePane.getFont().getStyle(), originalFontSize)));
|
||||
viewMenu.add(resetZoomButton);
|
||||
|
||||
// create 'Options'
|
||||
optionsMenu = new JMenu(LanguageUtils.getLocaleStringLog("geyser.gui.menu.options"));
|
||||
optionsMenu = new JMenu(GeyserLocale.getLocaleStringLog("geyser.gui.menu.options"));
|
||||
viewMenu.setMnemonic(KeyEvent.VK_O);
|
||||
menuBar.add(optionsMenu);
|
||||
|
||||
|
@ -195,11 +195,11 @@ public class GeyserStandaloneGUI {
|
|||
ramValues.add(0);
|
||||
}
|
||||
ramGraph.setValues(ramValues);
|
||||
ramGraph.setXLabel(LanguageUtils.getLocaleStringLog("geyser.gui.graph.loading"));
|
||||
ramGraph.setXLabel(GeyserLocale.getLocaleStringLog("geyser.gui.graph.loading"));
|
||||
rightContentPane.add(ramGraph);
|
||||
|
||||
playerTableModel.addColumn(LanguageUtils.getLocaleStringLog("geyser.gui.table.ip"));
|
||||
playerTableModel.addColumn(LanguageUtils.getLocaleStringLog("geyser.gui.table.username"));
|
||||
playerTableModel.addColumn(GeyserLocale.getLocaleStringLog("geyser.gui.table.ip"));
|
||||
playerTableModel.addColumn(GeyserLocale.getLocaleStringLog("geyser.gui.table.username"));
|
||||
|
||||
JScrollPane playerScrollPane = new JScrollPane(playerTable);
|
||||
rightContentPane.add(playerScrollPane);
|
||||
|
@ -289,7 +289,7 @@ public class GeyserStandaloneGUI {
|
|||
}
|
||||
|
||||
// 'Debug Mode' toggle
|
||||
JCheckBoxMenuItem debugMode = new JCheckBoxMenuItem(LanguageUtils.getLocaleStringLog("geyser.gui.menu.options.toggle_debug_mode"));
|
||||
JCheckBoxMenuItem debugMode = new JCheckBoxMenuItem(GeyserLocale.getLocaleStringLog("geyser.gui.menu.options.toggle_debug_mode"));
|
||||
debugMode.setSelected(geyserStandaloneLogger.isDebug());
|
||||
debugMode.addActionListener(e -> geyserStandaloneLogger.setDebug(!geyserStandaloneLogger.isDebug()));
|
||||
optionsMenu.add(debugMode);
|
||||
|
@ -323,7 +323,7 @@ public class GeyserStandaloneGUI {
|
|||
final int freePercent = (int)(freeMemory * 100.0 / totalMemory + 0.5);
|
||||
ramValues.add(100 - freePercent);
|
||||
|
||||
ramGraph.setXLabel(LanguageUtils.getLocaleStringLog("geyser.gui.graph.usage", String.format("%,d", (totalMemory - freeMemory) / MEGABYTE), freePercent));
|
||||
ramGraph.setXLabel(GeyserLocale.getLocaleStringLog("geyser.gui.graph.usage", String.format("%,d", (totalMemory - freeMemory) / MEGABYTE), freePercent));
|
||||
|
||||
// Trim the list
|
||||
int k = ramValues.size();
|
||||
|
|
|
@ -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