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
|
@ -33,6 +33,6 @@ import javax.lang.model.SourceVersion;
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
||||||
public class BlockEntityProcessor extends ClassProcessor {
|
public class BlockEntityProcessor extends ClassProcessor {
|
||||||
public BlockEntityProcessor() {
|
public BlockEntityProcessor() {
|
||||||
super("org.geysermc.geyser.network.translators.world.block.entity.BlockEntity");
|
super("org.geysermc.geyser.translator.level.block.entity.BlockEntity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,6 @@ import javax.lang.model.SourceVersion;
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
||||||
public class CollisionRemapperProcessor extends ClassProcessor {
|
public class CollisionRemapperProcessor extends ClassProcessor {
|
||||||
public CollisionRemapperProcessor() {
|
public CollisionRemapperProcessor() {
|
||||||
super("org.geysermc.geyser.network.translators.collision.CollisionRemapper");
|
super("org.geysermc.geyser.translator.collision.CollisionRemapper");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,6 @@ import javax.lang.model.SourceVersion;
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
||||||
public class ItemRemapperProcessor extends ClassProcessor {
|
public class ItemRemapperProcessor extends ClassProcessor {
|
||||||
public ItemRemapperProcessor() {
|
public ItemRemapperProcessor() {
|
||||||
super("org.geysermc.geyser.network.translators.ItemRemapper");
|
super("org.geysermc.geyser.translator.inventory.item.ItemRemapper");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,6 @@ import javax.lang.model.SourceVersion;
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
||||||
public class PacketTranslatorProcessor extends ClassProcessor {
|
public class PacketTranslatorProcessor extends ClassProcessor {
|
||||||
public PacketTranslatorProcessor() {
|
public PacketTranslatorProcessor() {
|
||||||
super("org.geysermc.geyser.network.translators.Translator");
|
super("org.geysermc.geyser.translator.protocol.Translator");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,6 @@ import javax.lang.model.SourceVersion;
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
@SupportedSourceVersion(SourceVersion.RELEASE_16)
|
||||||
public class SoundHandlerProcessor extends ClassProcessor {
|
public class SoundHandlerProcessor extends ClassProcessor {
|
||||||
public SoundHandlerProcessor() {
|
public SoundHandlerProcessor() {
|
||||||
super("org.geysermc.geyser.network.translators.sound.SoundHandler");
|
super("org.geysermc.geyser.translator.sound.SoundTranslator");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.bungeecord;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
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 org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
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.event.EventHandler;
|
||||||
import net.md_5.bungee.netty.PipelineUtils;
|
import net.md_5.bungee.netty.PipelineUtils;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
import org.geysermc.geyser.GeyserBootstrap;
|
||||||
import org.geysermc.geyser.common.connection.GeyserInjector;
|
import org.geysermc.geyser.network.netty.GeyserInjector;
|
||||||
import org.geysermc.geyser.common.connection.LocalServerChannelWrapper;
|
import org.geysermc.geyser.network.netty.LocalServerChannelWrapper;
|
||||||
import org.geysermc.geyser.common.connection.LocalSession;
|
import org.geysermc.geyser.network.netty.LocalSession;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.platform.bungeecord;
|
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) {
|
public static void main(String[] args) {
|
||||||
new GeyserBungeeMain().displayMessage();
|
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.event.ProxyPingEvent;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
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 org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
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 net.md_5.bungee.api.plugin.Plugin;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
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.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.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandExecutor;
|
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandExecutor;
|
||||||
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandManager;
|
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandManager;
|
||||||
import org.jetbrains.annotations.Nullable;
|
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()));
|
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);
|
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserBungeeConfiguration.class);
|
||||||
} catch (IOException ex) {
|
} 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();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,12 +101,12 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
||||||
|
|
||||||
// Remove this in like a year
|
// Remove this in like a year
|
||||||
if (getProxy().getPluginManager().getPlugin("floodgate-bungee") != null) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && getProxy().getPluginManager().getPlugin("floodgate") == null) {
|
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;
|
return;
|
||||||
} else if (geyserConfig.isAutoconfiguredRemote() && getProxy().getPluginManager().getPlugin("floodgate") != null) {
|
} else if (geyserConfig.isAutoconfiguredRemote() && getProxy().getPluginManager().getPlugin("floodgate") != null) {
|
||||||
// Floodgate installed means that the user wants Floodgate authentication
|
// 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.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
public class BungeeCommandSender implements CommandSender {
|
public class BungeeCommandSender implements CommandSender {
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public class BungeeCommandSender implements CommandSender {
|
||||||
public BungeeCommandSender(net.md_5.bungee.api.CommandSender handle) {
|
public BungeeCommandSender(net.md_5.bungee.api.CommandSender handle) {
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
// Ensure even Java players' languages are loaded
|
// Ensure even Java players' languages are loaded
|
||||||
LanguageUtils.loadGeyserLocale(getLocale());
|
GeyserLocale.loadGeyserLocale(getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,9 +59,9 @@ public class BungeeCommandSender implements CommandSender {
|
||||||
public String getLocale() {
|
public String getLocale() {
|
||||||
if (handle instanceof ProxiedPlayer player) {
|
if (handle instanceof ProxiedPlayer player) {
|
||||||
String locale = player.getLocale().getLanguage() + "_" + player.getLocale().getCountry();
|
String locale = player.getLocale().getLanguage() + "_" + player.getLocale().getCountry();
|
||||||
return LanguageUtils.formatLocale(locale);
|
return GeyserLocale.formatLocale(locale);
|
||||||
}
|
}
|
||||||
return LanguageUtils.getDefaultLocale();
|
return GeyserLocale.getDefaultLocale();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,8 +32,8 @@ import net.md_5.bungee.api.plugin.TabExecutor;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandExecutor;
|
import org.geysermc.geyser.command.CommandExecutor;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -56,13 +56,13 @@ public class GeyserBungeeCommandExecutor extends Command implements TabExecutor
|
||||||
GeyserCommand command = this.commandExecutor.getCommand(args[0]);
|
GeyserCommand command = this.commandExecutor.getCommand(args[0]);
|
||||||
if (command != null) {
|
if (command != null) {
|
||||||
if (!sender.hasPermission(command.getPermission())) {
|
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);
|
commandSender.sendMessage(ChatColor.RED + message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (command.isBedrockOnly() && session == null) {
|
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);
|
commandSender.sendMessage(ChatColor.RED + message);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.spigot;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.Plugin;
|
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 org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -31,9 +31,9 @@ import io.netty.channel.*;
|
||||||
import io.netty.channel.local.LocalAddress;
|
import io.netty.channel.local.LocalAddress;
|
||||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
import org.geysermc.geyser.GeyserBootstrap;
|
||||||
import org.geysermc.geyser.common.connection.GeyserInjector;
|
import org.geysermc.geyser.network.netty.GeyserInjector;
|
||||||
import org.geysermc.geyser.common.connection.LocalServerChannelWrapper;
|
import org.geysermc.geyser.network.netty.LocalServerChannelWrapper;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.platform.spigot;
|
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) {
|
public static void main(String[] args) {
|
||||||
new GeyserSpigotMain().displayMessage();
|
new GeyserSpigotMain().displayMessage();
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.server.ServerListPingEvent;
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
import org.bukkit.util.CachedServerIcon;
|
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.network.MinecraftProtocol;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,18 @@ import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
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.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.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
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.GeyserLegacyPingPassthrough;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
import org.geysermc.geyser.utils.Constants;
|
import org.geysermc.geyser.Constants;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
import org.geysermc.geyser.platform.spigot.command.GeyserSpigotCommandExecutor;
|
import org.geysermc.geyser.platform.spigot.command.GeyserSpigotCommandExecutor;
|
||||||
import org.geysermc.geyser.platform.spigot.command.GeyserSpigotCommandManager;
|
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()));
|
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);
|
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpigotConfiguration.class);
|
||||||
} catch (IOException ex) {
|
} 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();
|
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.
|
// 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("");
|
getLogger().severe("");
|
||||||
getLogger().severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.unsupported_server.header"));
|
getLogger().severe(GeyserLocale.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.message", "1.12.2"));
|
||||||
getLogger().severe("");
|
getLogger().severe("");
|
||||||
getLogger().severe("*********************************************");
|
getLogger().severe("*********************************************");
|
||||||
|
|
||||||
|
@ -127,13 +127,13 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
|
||||||
|
|
||||||
// Remove this in like a year
|
// Remove this in like a year
|
||||||
if (Bukkit.getPluginManager().getPlugin("floodgate-bukkit") != null) {
|
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);
|
this.getPluginLoader().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && Bukkit.getPluginManager().getPlugin("floodgate") == null) {
|
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);
|
this.getPluginLoader().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
} else if (geyserConfig.isAutoconfiguredRemote() && Bukkit.getPluginManager().getPlugin("floodgate") != null) {
|
} 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
|
// Ensure that we have the latest 4.0.0 changes and not an older ViaVersion version
|
||||||
Class.forName("com.viaversion.viaversion.api.ViaManager");
|
Class.forName("com.viaversion.viaversion.api.ViaManager");
|
||||||
} catch (ClassNotFoundException e) {
|
} 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/"));
|
"https://ci.viaversion.com/job/ViaVersion/"));
|
||||||
isViaVersion = false;
|
isViaVersion = false;
|
||||||
if (this.geyserConfig.isDebugMode()) {
|
if (this.geyserConfig.isDebugMode()) {
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.bukkit.command.TabExecutor;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandExecutor;
|
import org.geysermc.geyser.command.CommandExecutor;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -54,13 +54,13 @@ public class GeyserSpigotCommandExecutor extends CommandExecutor implements TabE
|
||||||
GeyserCommand geyserCommand = getCommand(args[0]);
|
GeyserCommand geyserCommand = getCommand(args[0]);
|
||||||
if (geyserCommand != null) {
|
if (geyserCommand != null) {
|
||||||
if (!sender.hasPermission(geyserCommand.getPermission())) {
|
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);
|
commandSender.sendMessage(ChatColor.RED + message);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (geyserCommand.isBedrockOnly() && session == null) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
geyserCommand.execute(session, commandSender, args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
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.bukkit.entity.Player;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
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.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
@ -50,7 +50,7 @@ public class SpigotCommandSender implements CommandSender {
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
this.locale = getSpigotLocale();
|
this.locale = getSpigotLocale();
|
||||||
// Ensure even Java players' languages are loaded
|
// Ensure even Java players' languages are loaded
|
||||||
LanguageUtils.loadGeyserLocale(locale);
|
GeyserLocale.loadGeyserLocale(locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -114,6 +114,6 @@ public class SpigotCommandSender implements CommandSender {
|
||||||
return player.getLocale();
|
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.BlockPistonExtendEvent;
|
||||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.session.cache.PistonCache;
|
import org.geysermc.geyser.session.cache.PistonCache;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
import org.geysermc.geyser.network.translators.world.block.entity.PistonBlockEntity;
|
import org.geysermc.geyser.translator.level.block.entity.PistonBlockEntity;
|
||||||
import org.geysermc.geyser.utils.Direction;
|
import org.geysermc.geyser.level.physics.Direction;
|
||||||
import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager;
|
import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -48,9 +48,9 @@ import org.bukkit.inventory.ShapedRecipe;
|
||||||
import org.bukkit.inventory.ShapelessRecipe;
|
import org.bukkit.inventory.ShapelessRecipe;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.item.ItemTranslator;
|
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
|
||||||
import org.geysermc.geyser.utils.InventoryUtils;
|
import org.geysermc.geyser.util.InventoryUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
import org.geysermc.geyser.registry.BlockRegistries;
|
import org.geysermc.geyser.registry.BlockRegistries;
|
||||||
import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager;
|
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.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ import org.bukkit.Bukkit;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
package org.geysermc.geyser.platform.spigot.world.manager;
|
package org.geysermc.geyser.platform.spigot.world.manager;
|
||||||
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should only be used when we know {@link GeyserSpigotWorldManager#getBlockAt(GeyserSession, int, int, int)}
|
* 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.Int2IntOpenHashMap;
|
||||||
import it.unimi.dsi.fastutil.ints.IntList;
|
import it.unimi.dsi.fastutil.ints.IntList;
|
||||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
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 org.geysermc.geyser.platform.spigot.GeyserSpigotPlugin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -28,8 +28,8 @@ package org.geysermc.geyser.platform.spigot.world.manager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
import org.geysermc.geyser.adapters.spigot.SpigotAdapters;
|
||||||
import org.geysermc.geyser.adapters.spigot.SpigotWorldAdapter;
|
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.inventory.meta.BookMeta;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.inventory.translators.LecternInventoryTranslator;
|
import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator;
|
||||||
import org.geysermc.geyser.network.translators.world.GeyserWorldManager;
|
import org.geysermc.geyser.level.GeyserWorldManager;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
import org.geysermc.geyser.registry.BlockRegistries;
|
import org.geysermc.geyser.registry.BlockRegistries;
|
||||||
import org.geysermc.geyser.utils.BlockEntityUtils;
|
import org.geysermc.geyser.util.BlockEntityUtils;
|
||||||
import org.geysermc.geyser.utils.GameRule;
|
import org.geysermc.geyser.level.GameRule;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.platform.sponge;
|
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) {
|
public static void main(String[] args) {
|
||||||
new GeyserSpongeMain().displayMessage();
|
new GeyserSpongeMain().displayMessage();
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.platform.sponge;
|
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.network.MinecraftProtocol;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
import org.spongepowered.api.MinecraftVersion;
|
import org.spongepowered.api.MinecraftVersion;
|
||||||
|
|
|
@ -28,14 +28,14 @@ package org.geysermc.geyser.platform.sponge;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
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.command.CommandManager;
|
||||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.platform.sponge.command.GeyserSpongeCommandExecutor;
|
import org.geysermc.geyser.platform.sponge.command.GeyserSpongeCommandExecutor;
|
||||||
import org.geysermc.geyser.platform.sponge.command.GeyserSpongeCommandManager;
|
import org.geysermc.geyser.platform.sponge.command.GeyserSpongeCommandManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -78,14 +78,14 @@ public class GeyserSpongePlugin implements GeyserBootstrap {
|
||||||
try {
|
try {
|
||||||
configFile = FileUtils.fileOrCopiedFromResource(new File(configDir, "config.yml"), "config.yml", (file) -> file.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
configFile = FileUtils.fileOrCopiedFromResource(new File(configDir, "config.yml"), "config.yml", (file) -> file.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.warn(LanguageUtils.getLocaleStringLog("geyser.config.failed"));
|
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"));
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpongeConfiguration.class);
|
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpongeConfiguration.class);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.warn(LanguageUtils.getLocaleStringLog("geyser.config.failed"));
|
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"));
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@ import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandExecutor;
|
import org.geysermc.geyser.command.CommandExecutor;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.spongepowered.api.command.CommandCallable;
|
import org.spongepowered.api.command.CommandCallable;
|
||||||
import org.spongepowered.api.command.CommandResult;
|
import org.spongepowered.api.command.CommandResult;
|
||||||
import org.spongepowered.api.command.CommandSource;
|
import org.spongepowered.api.command.CommandSource;
|
||||||
|
@ -62,11 +62,11 @@ public class GeyserSpongeCommandExecutor extends CommandExecutor implements Comm
|
||||||
if (command != null) {
|
if (command != null) {
|
||||||
if (!source.hasPermission(command.getPermission())) {
|
if (!source.hasPermission(command.getPermission())) {
|
||||||
// Not ideal to use log here but we dont get a session
|
// 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();
|
return CommandResult.success();
|
||||||
}
|
}
|
||||||
if (command.isBedrockOnly() && session == null) {
|
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();
|
return CommandResult.success();
|
||||||
}
|
}
|
||||||
getCommand(args[0]).execute(session, commandSender, args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
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.apache.logging.log4j.core.appender.ConsoleAppender;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
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.command.CommandManager;
|
||||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
|
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
|
import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
|
||||||
import org.geysermc.geyser.platform.standalone.gui.GeyserStandaloneGUI;
|
import org.geysermc.geyser.platform.standalone.gui.GeyserStandaloneGUI;
|
||||||
|
|
||||||
|
@ -102,19 +102,19 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
||||||
case "--nogui", "nogui" -> useGuiOpts = false;
|
case "--nogui", "nogui" -> useGuiOpts = false;
|
||||||
case "--config", "-c" -> {
|
case "--config", "-c" -> {
|
||||||
if (i >= args.length - 1) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
configFilenameOpt = args[i + 1];
|
configFilenameOpt = args[i + 1];
|
||||||
i++;
|
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" -> {
|
case "--help", "-h" -> {
|
||||||
System.out.println(MessageFormat.format(LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.usage"), "[java -jar] Geyser.jar [opts]"));
|
System.out.println(MessageFormat.format(GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.usage"), "[java -jar] Geyser.jar [opts]"));
|
||||||
System.out.println(" " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.options"));
|
System.out.println(" " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.options"));
|
||||||
System.out.println(" -c, --config [file] " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.config"));
|
System.out.println(" -c, --config [file] " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.config"));
|
||||||
System.out.println(" -h, --help " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.help"));
|
System.out.println(" -h, --help " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.help"));
|
||||||
System.out.println(" --gui, --nogui " + LanguageUtils.getLocaleStringLog("geyser.bootstrap.args.gui"));
|
System.out.println(" --gui, --nogui " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.args.gui"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default -> {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
||||||
geyserConfig.getRemote().setAddress("127.0.0.1");
|
geyserConfig.getRemote().setAddress("127.0.0.1");
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.config.failed"), ex);
|
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
|
||||||
if (gui == null) {
|
if (gui == null) {
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -345,7 +345,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
||||||
// Loop through the sub property if the first part matches
|
// Loop through the sub property if the first part matches
|
||||||
for (BeanPropertyDefinition subProperty : getPOJOForClass(property.getRawPrimaryType())) {
|
for (BeanPropertyDefinition subProperty : getPOJOForClass(property.getRawPrimaryType())) {
|
||||||
if (configKeyParts[1].equals(subProperty.getName())) {
|
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
|
// Set the sub property value on the config
|
||||||
try {
|
try {
|
||||||
|
@ -359,7 +359,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
// Set the property value on the config
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.logging.log4j.core.config.Configurator;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.api.logger.GeyserLogger;
|
import org.geysermc.geyser.api.logger.GeyserLogger;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class GeyserStandaloneLogger extends SimpleTerminalConsole implements GeyserLogger, CommandSender {
|
public class GeyserStandaloneLogger extends SimpleTerminalConsole implements GeyserLogger, CommandSender {
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.platform.standalone;
|
package org.geysermc.geyser.platform.standalone;
|
||||||
|
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
@ -56,12 +56,12 @@ public class LoopbackUtil {
|
||||||
Files.write(Paths.get(System.getenv("temp") + "/loopback_minecraft.bat"), loopbackCommand.getBytes());
|
Files.write(Paths.get(System.getenv("temp") + "/loopback_minecraft.bat"), loopbackCommand.getBytes());
|
||||||
Runtime.getRuntime().exec(startScript);
|
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
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.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.platform.standalone.GeyserStandaloneLogger;
|
import org.geysermc.geyser.platform.standalone.GeyserStandaloneLogger;
|
||||||
import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
|
import org.geysermc.geyser.platform.standalone.command.GeyserCommandManager;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class GeyserStandaloneGUI {
|
||||||
|
|
||||||
public GeyserStandaloneGUI() {
|
public GeyserStandaloneGUI() {
|
||||||
// Create the frame and setup basic settings
|
// 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.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
frame.setSize(800, 400);
|
frame.setSize(800, 400);
|
||||||
frame.setMinimumSize(frame.getSize());
|
frame.setMinimumSize(frame.getSize());
|
||||||
|
@ -82,8 +82,8 @@ public class GeyserStandaloneGUI {
|
||||||
@Override
|
@Override
|
||||||
public void windowClosing(WindowEvent we)
|
public void windowClosing(WindowEvent we)
|
||||||
{
|
{
|
||||||
String[] buttons = {LanguageUtils.getLocaleStringLog("geyser.gui.exit.confirm"), LanguageUtils.getLocaleStringLog("geyser.gui.exit.deny")};
|
String[] buttons = {GeyserLocale.getLocaleStringLog("geyser.gui.exit.confirm"), GeyserLocale.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]);
|
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) {
|
if (result == JOptionPane.YES_OPTION) {
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
@ -124,12 +124,12 @@ public class GeyserStandaloneGUI {
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
|
|
||||||
// Create 'File'
|
// 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);
|
fileMenu.setMnemonic(KeyEvent.VK_F);
|
||||||
menuBar.add(fileMenu);
|
menuBar.add(fileMenu);
|
||||||
|
|
||||||
// 'Open Geyser folder' button
|
// '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.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
|
||||||
openButton.addActionListener(e -> {
|
openButton.addActionListener(e -> {
|
||||||
try {
|
try {
|
||||||
|
@ -141,40 +141,40 @@ public class GeyserStandaloneGUI {
|
||||||
fileMenu.addSeparator();
|
fileMenu.addSeparator();
|
||||||
|
|
||||||
// 'Exit' button
|
// '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.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, InputEvent.ALT_MASK));
|
||||||
exitButton.addActionListener(e -> System.exit(0));
|
exitButton.addActionListener(e -> System.exit(0));
|
||||||
fileMenu.add(exitButton);
|
fileMenu.add(exitButton);
|
||||||
|
|
||||||
// Create 'Commands'
|
// 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);
|
commandsMenu.setMnemonic(KeyEvent.VK_C);
|
||||||
menuBar.add(commandsMenu);
|
menuBar.add(commandsMenu);
|
||||||
|
|
||||||
// Create 'View'
|
// 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);
|
viewMenu.setMnemonic(KeyEvent.VK_V);
|
||||||
menuBar.add(viewMenu);
|
menuBar.add(viewMenu);
|
||||||
|
|
||||||
// 'Zoom in' button
|
// '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.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)));
|
zoomInButton.addActionListener(e -> consolePane.setFont(new Font(consolePane.getFont().getName(), consolePane.getFont().getStyle(), consolePane.getFont().getSize() + 1)));
|
||||||
viewMenu.add(zoomInButton);
|
viewMenu.add(zoomInButton);
|
||||||
|
|
||||||
// 'Zoom in' button
|
// '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.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)));
|
zoomOutButton.addActionListener(e -> consolePane.setFont(new Font(consolePane.getFont().getName(), consolePane.getFont().getStyle(), consolePane.getFont().getSize() - 1)));
|
||||||
viewMenu.add(zoomOutButton);
|
viewMenu.add(zoomOutButton);
|
||||||
|
|
||||||
// 'Reset Zoom' button
|
// '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)));
|
resetZoomButton.addActionListener(e -> consolePane.setFont(new Font(consolePane.getFont().getName(), consolePane.getFont().getStyle(), originalFontSize)));
|
||||||
viewMenu.add(resetZoomButton);
|
viewMenu.add(resetZoomButton);
|
||||||
|
|
||||||
// create 'Options'
|
// 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);
|
viewMenu.setMnemonic(KeyEvent.VK_O);
|
||||||
menuBar.add(optionsMenu);
|
menuBar.add(optionsMenu);
|
||||||
|
|
||||||
|
@ -195,11 +195,11 @@ public class GeyserStandaloneGUI {
|
||||||
ramValues.add(0);
|
ramValues.add(0);
|
||||||
}
|
}
|
||||||
ramGraph.setValues(ramValues);
|
ramGraph.setValues(ramValues);
|
||||||
ramGraph.setXLabel(LanguageUtils.getLocaleStringLog("geyser.gui.graph.loading"));
|
ramGraph.setXLabel(GeyserLocale.getLocaleStringLog("geyser.gui.graph.loading"));
|
||||||
rightContentPane.add(ramGraph);
|
rightContentPane.add(ramGraph);
|
||||||
|
|
||||||
playerTableModel.addColumn(LanguageUtils.getLocaleStringLog("geyser.gui.table.ip"));
|
playerTableModel.addColumn(GeyserLocale.getLocaleStringLog("geyser.gui.table.ip"));
|
||||||
playerTableModel.addColumn(LanguageUtils.getLocaleStringLog("geyser.gui.table.username"));
|
playerTableModel.addColumn(GeyserLocale.getLocaleStringLog("geyser.gui.table.username"));
|
||||||
|
|
||||||
JScrollPane playerScrollPane = new JScrollPane(playerTable);
|
JScrollPane playerScrollPane = new JScrollPane(playerTable);
|
||||||
rightContentPane.add(playerScrollPane);
|
rightContentPane.add(playerScrollPane);
|
||||||
|
@ -289,7 +289,7 @@ public class GeyserStandaloneGUI {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'Debug Mode' toggle
|
// '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.setSelected(geyserStandaloneLogger.isDebug());
|
||||||
debugMode.addActionListener(e -> geyserStandaloneLogger.setDebug(!geyserStandaloneLogger.isDebug()));
|
debugMode.addActionListener(e -> geyserStandaloneLogger.setDebug(!geyserStandaloneLogger.isDebug()));
|
||||||
optionsMenu.add(debugMode);
|
optionsMenu.add(debugMode);
|
||||||
|
@ -323,7 +323,7 @@ public class GeyserStandaloneGUI {
|
||||||
final int freePercent = (int)(freeMemory * 100.0 / totalMemory + 0.5);
|
final int freePercent = (int)(freeMemory * 100.0 / totalMemory + 0.5);
|
||||||
ramValues.add(100 - freePercent);
|
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
|
// Trim the list
|
||||||
int k = ramValues.size();
|
int k = ramValues.size();
|
||||||
|
|
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.platform.velocity;
|
||||||
import com.velocitypowered.api.plugin.PluginContainer;
|
import com.velocitypowered.api.plugin.PluginContainer;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -29,9 +29,9 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.*;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.local.LocalAddress;
|
import io.netty.channel.local.LocalAddress;
|
||||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
import org.geysermc.geyser.GeyserBootstrap;
|
||||||
import org.geysermc.geyser.common.connection.GeyserInjector;
|
import org.geysermc.geyser.network.netty.GeyserInjector;
|
||||||
import org.geysermc.geyser.common.connection.LocalServerChannelWrapper;
|
import org.geysermc.geyser.network.netty.LocalServerChannelWrapper;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.platform.velocity;
|
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) {
|
public static void main(String[] args) {
|
||||||
new GeyserVelocityMain().displayMessage();
|
new GeyserVelocityMain().displayMessage();
|
||||||
|
|
|
@ -32,7 +32,7 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
import com.velocitypowered.api.proxy.server.ServerPing;
|
import com.velocitypowered.api.proxy.server.ServerPing;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
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 org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
|
@ -37,16 +37,16 @@ import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
import org.geysermc.geyser.GeyserBootstrap;
|
||||||
import org.geysermc.geyser.common.AuthType;
|
import org.geysermc.geyser.session.auth.AuthType;
|
||||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandExecutor;
|
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandExecutor;
|
||||||
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandManager;
|
import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandManager;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
||||||
"config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
"config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()));
|
||||||
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserVelocityConfiguration.class);
|
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserVelocityConfiguration.class);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.warn(LanguageUtils.getLocaleStringLog("geyser.config.failed"), ex);
|
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,15 +118,15 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
||||||
try {
|
try {
|
||||||
// Should only exist on 1.0
|
// Should only exist on 1.0
|
||||||
Class.forName("org.geysermc.floodgate.FloodgateAPI");
|
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/"));
|
"https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/master/"));
|
||||||
return;
|
return;
|
||||||
} catch (ClassNotFoundException ignored) {
|
} catch (ClassNotFoundException ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && proxyServer.getPluginManager().getPlugin("floodgate").isEmpty()) {
|
if (geyserConfig.getRemote().getAuthType() == AuthType.FLOODGATE && proxyServer.getPluginManager().getPlugin("floodgate").isEmpty()) {
|
||||||
geyserLogger.severe(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
|
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " "
|
||||||
+ LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
+ GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||||
return;
|
return;
|
||||||
} else if (geyserConfig.isAutoconfiguredRemote() && proxyServer.getPluginManager().getPlugin("floodgate").isPresent()) {
|
} else if (geyserConfig.isAutoconfiguredRemote() && proxyServer.getPluginManager().getPlugin("floodgate").isPresent()) {
|
||||||
// Floodgate installed means that the user wants Floodgate authentication
|
// 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.CommandExecutor;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -53,11 +53,11 @@ public class GeyserVelocityCommandExecutor extends CommandExecutor implements Si
|
||||||
GeyserCommand command = getCommand(invocation.arguments()[0]);
|
GeyserCommand command = getCommand(invocation.arguments()[0]);
|
||||||
if (command != null) {
|
if (command != null) {
|
||||||
if (!invocation.source().hasPermission(getCommand(invocation.arguments()[0]).getPermission())) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (command.isBedrockOnly() && session == null) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
command.execute(session, sender, invocation.arguments().length > 1 ? Arrays.copyOfRange(invocation.arguments(), 1, invocation.arguments().length) : new String[0]);
|
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 com.velocitypowered.api.proxy.Player;
|
||||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class VelocityCommandSender implements CommandSender {
|
||||||
public VelocityCommandSender(CommandSource handle) {
|
public VelocityCommandSender(CommandSource handle) {
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
// Ensure even Java players' languages are loaded
|
// Ensure even Java players' languages are loaded
|
||||||
LanguageUtils.loadGeyserLocale(getLocale());
|
GeyserLocale.loadGeyserLocale(getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,9 +68,9 @@ public class VelocityCommandSender implements CommandSender {
|
||||||
public String getLocale() {
|
public String getLocale() {
|
||||||
if (handle instanceof Player) {
|
if (handle instanceof Player) {
|
||||||
Locale locale = ((Player) handle).getPlayerSettings().getLocale();
|
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
|
@Override
|
||||||
|
|
|
@ -37,9 +37,9 @@ import org.geysermc.connector.network.session.auth.AuthData;
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class GeyserSession {
|
public class GeyserSession {
|
||||||
private final org.geysermc.geyser.network.session.GeyserSession handle;
|
private final org.geysermc.geyser.session.GeyserSession handle;
|
||||||
|
|
||||||
public GeyserSession(org.geysermc.geyser.network.session.GeyserSession handle) {
|
public GeyserSession(org.geysermc.geyser.session.GeyserSession handle) {
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,9 @@ import java.util.UUID;
|
||||||
* @deprecated legacy code
|
* @deprecated legacy code
|
||||||
*/
|
*/
|
||||||
public class AuthData {
|
public class AuthData {
|
||||||
private final org.geysermc.geyser.network.session.auth.AuthData handle;
|
private final org.geysermc.geyser.session.auth.AuthData handle;
|
||||||
|
|
||||||
public AuthData(org.geysermc.geyser.network.session.auth.AuthData handle) {
|
public AuthData(org.geysermc.geyser.session.auth.AuthData handle) {
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.utils;
|
package org.geysermc.geyser;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
|
@ -26,9 +26,9 @@
|
||||||
package org.geysermc.geyser;
|
package org.geysermc.geyser;
|
||||||
|
|
||||||
import org.geysermc.geyser.api.logger.GeyserLogger;
|
import org.geysermc.geyser.api.logger.GeyserLogger;
|
||||||
import org.geysermc.geyser.common.AuthType;
|
import org.geysermc.geyser.session.auth.AuthType;
|
||||||
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
|
import org.geysermc.geyser.configuration.GeyserJacksonConfiguration;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
@ -44,10 +44,10 @@ public class FloodgateKeyLoader {
|
||||||
if (floodgateDataFolder != null) {
|
if (floodgateDataFolder != null) {
|
||||||
Path autoKey = floodgateDataFolder.resolve("key.pem");
|
Path autoKey = floodgateDataFolder.resolve("key.pem");
|
||||||
if (Files.exists(autoKey)) {
|
if (Files.exists(autoKey)) {
|
||||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.auto_loaded"));
|
logger.info(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.auto_loaded"));
|
||||||
return autoKey;
|
return autoKey;
|
||||||
} else {
|
} else {
|
||||||
logger.error(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.missing_key"));
|
logger.error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.missing_key"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class FloodgateKeyLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Files.exists(floodgateKey)) {
|
if (!Files.exists(floodgateKey)) {
|
||||||
logger.error(LanguageUtils.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed"));
|
logger.error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return floodgateKey;
|
return floodgateKey;
|
||||||
|
|
|
@ -23,16 +23,15 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.bootstrap;
|
package org.geysermc.geyser;
|
||||||
|
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.api.logger.GeyserLogger;
|
import org.geysermc.geyser.api.logger.GeyserLogger;
|
||||||
import org.geysermc.geyser.command.CommandManager;
|
import org.geysermc.geyser.command.CommandManager;
|
||||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
|
||||||
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
import org.geysermc.geyser.dump.BootstrapDumpInfo;
|
||||||
import org.geysermc.geyser.network.translators.world.GeyserWorldManager;
|
import org.geysermc.geyser.level.GeyserWorldManager;
|
||||||
import org.geysermc.geyser.network.translators.world.WorldManager;
|
import org.geysermc.geyser.level.WorldManager;
|
||||||
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
import org.geysermc.geyser.ping.IGeyserPingPassthrough;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
|
@ -42,23 +42,25 @@ import lombok.Setter;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.api.Geyser;
|
import org.geysermc.geyser.api.Geyser;
|
||||||
import org.geysermc.geyser.api.logger.GeyserLogger;
|
import org.geysermc.geyser.api.logger.GeyserLogger;
|
||||||
import org.geysermc.geyser.bootstrap.GeyserBootstrap;
|
|
||||||
import org.geysermc.geyser.command.CommandManager;
|
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.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.entity.EntityDefinitions;
|
import org.geysermc.geyser.entity.EntityDefinitions;
|
||||||
import org.geysermc.geyser.metrics.Metrics;
|
import org.geysermc.geyser.pack.ResourcePack;
|
||||||
|
import org.geysermc.geyser.session.SessionManager;
|
||||||
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
import org.geysermc.geyser.text.MinecraftLocale;
|
||||||
|
import org.geysermc.geyser.util.Metrics;
|
||||||
import org.geysermc.geyser.network.ConnectorServerEventHandler;
|
import org.geysermc.geyser.network.ConnectorServerEventHandler;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.PacketTranslatorRegistry;
|
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||||
import org.geysermc.geyser.network.translators.chat.MessageTranslator;
|
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
|
||||||
import org.geysermc.geyser.network.translators.item.ItemTranslator;
|
import org.geysermc.geyser.level.WorldManager;
|
||||||
import org.geysermc.geyser.network.translators.world.WorldManager;
|
|
||||||
import org.geysermc.geyser.registry.BlockRegistries;
|
import org.geysermc.geyser.registry.BlockRegistries;
|
||||||
import org.geysermc.geyser.registry.Registries;
|
import org.geysermc.geyser.registry.Registries;
|
||||||
import org.geysermc.geyser.scoreboard.ScoreboardUpdater;
|
import org.geysermc.geyser.scoreboard.ScoreboardUpdater;
|
||||||
import org.geysermc.geyser.skin.FloodgateSkinUploader;
|
import org.geysermc.geyser.skin.FloodgateSkinUploader;
|
||||||
import org.geysermc.geyser.utils.*;
|
import org.geysermc.geyser.util.*;
|
||||||
import org.geysermc.floodgate.crypto.AesCipher;
|
import org.geysermc.floodgate.crypto.AesCipher;
|
||||||
import org.geysermc.floodgate.crypto.AesKeyProducer;
|
import org.geysermc.floodgate.crypto.AesKeyProducer;
|
||||||
import org.geysermc.floodgate.crypto.Base64Topping;
|
import org.geysermc.floodgate.crypto.Base64Topping;
|
||||||
|
@ -140,7 +142,7 @@ public class GeyserImpl extends Geyser {
|
||||||
|
|
||||||
logger.info("******************************************");
|
logger.info("******************************************");
|
||||||
logger.info("");
|
logger.info("");
|
||||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.core.load", NAME, VERSION));
|
logger.info(GeyserLocale.getLocaleStringLog("geyser.core.load", NAME, VERSION));
|
||||||
logger.info("");
|
logger.info("");
|
||||||
logger.info("******************************************");
|
logger.info("******************************************");
|
||||||
|
|
||||||
|
@ -148,8 +150,6 @@ public class GeyserImpl extends Geyser {
|
||||||
|
|
||||||
logger.setDebug(config.isDebugMode());
|
logger.setDebug(config.isDebugMode());
|
||||||
|
|
||||||
PacketTranslatorRegistry.init();
|
|
||||||
|
|
||||||
/* Initialize translators and registries */
|
/* Initialize translators and registries */
|
||||||
BlockRegistries.init();
|
BlockRegistries.init();
|
||||||
Registries.init();
|
Registries.init();
|
||||||
|
@ -157,7 +157,7 @@ public class GeyserImpl extends Geyser {
|
||||||
EntityDefinitions.init();
|
EntityDefinitions.init();
|
||||||
ItemTranslator.init();
|
ItemTranslator.init();
|
||||||
MessageTranslator.init();
|
MessageTranslator.init();
|
||||||
LocaleUtils.init();
|
MinecraftLocale.init();
|
||||||
ScoreboardUpdater.init();
|
ScoreboardUpdater.init();
|
||||||
|
|
||||||
ResourcePack.loadPacks();
|
ResourcePack.loadPacks();
|
||||||
|
@ -207,10 +207,10 @@ public class GeyserImpl extends Geyser {
|
||||||
Key key = new AesKeyProducer().produceFrom(config.getFloodgateKeyPath());
|
Key key = new AesKeyProducer().produceFrom(config.getFloodgateKeyPath());
|
||||||
cipher = new AesCipher(new Base64Topping());
|
cipher = new AesCipher(new Base64Topping());
|
||||||
cipher.init(key);
|
cipher.init(key);
|
||||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.auth.floodgate.loaded_key"));
|
logger.info(GeyserLocale.getLocaleStringLog("geyser.auth.floodgate.loaded_key"));
|
||||||
skinUploader = new FloodgateSkinUploader(this).start();
|
skinUploader = new FloodgateSkinUploader(this).start();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
logger.severe(LanguageUtils.getLocaleStringLog("geyser.auth.floodgate.bad_key"), exception);
|
logger.severe(GeyserLocale.getLocaleStringLog("geyser.auth.floodgate.bad_key"), exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.timeSyncer = timeSyncer;
|
this.timeSyncer = timeSyncer;
|
||||||
|
@ -272,9 +272,9 @@ public class GeyserImpl extends Geyser {
|
||||||
if (shouldStartListener) {
|
if (shouldStartListener) {
|
||||||
bedrockServer.bind().whenComplete((avoid, throwable) -> {
|
bedrockServer.bind().whenComplete((avoid, throwable) -> {
|
||||||
if (throwable == null) {
|
if (throwable == null) {
|
||||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
logger.info(GeyserLocale.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||||
} else {
|
} else {
|
||||||
logger.severe(LanguageUtils.getLocaleStringLog("geyser.core.fail", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
logger.severe(GeyserLocale.getLocaleStringLog("geyser.core.fail", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
}).join();
|
}).join();
|
||||||
|
@ -286,7 +286,7 @@ public class GeyserImpl extends Geyser {
|
||||||
// Prevent unwanted words best we can
|
// Prevent unwanted words best we can
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("authMode", () -> config.getRemote().getAuthType().toString().toLowerCase()));
|
metrics.addCustomChart(new Metrics.SimplePie("authMode", () -> config.getRemote().getAuthType().toString().toLowerCase()));
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("platform", platformType::getPlatformName));
|
metrics.addCustomChart(new Metrics.SimplePie("platform", platformType::getPlatformName));
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("defaultLocale", LanguageUtils::getDefaultLocale));
|
metrics.addCustomChart(new Metrics.SimplePie("defaultLocale", GeyserLocale::getDefaultLocale));
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("version", () -> GeyserImpl.VERSION));
|
metrics.addCustomChart(new Metrics.SimplePie("version", () -> GeyserImpl.VERSION));
|
||||||
metrics.addCustomChart(new Metrics.AdvancedPie("playerPlatform", () -> {
|
metrics.addCustomChart(new Metrics.AdvancedPie("playerPlatform", () -> {
|
||||||
Map<String, Integer> valueMap = new HashMap<>();
|
Map<String, Integer> valueMap = new HashMap<>();
|
||||||
|
@ -380,29 +380,29 @@ public class GeyserImpl extends Geyser {
|
||||||
}
|
}
|
||||||
|
|
||||||
double completeTime = (System.currentTimeMillis() - startupTime) / 1000D;
|
double completeTime = (System.currentTimeMillis() - startupTime) / 1000D;
|
||||||
String message = LanguageUtils.getLocaleStringLog("geyser.core.finish.done", new DecimalFormat("#.###").format(completeTime)) + " ";
|
String message = GeyserLocale.getLocaleStringLog("geyser.core.finish.done", new DecimalFormat("#.###").format(completeTime)) + " ";
|
||||||
if (isGui) {
|
if (isGui) {
|
||||||
message += LanguageUtils.getLocaleStringLog("geyser.core.finish.gui");
|
message += GeyserLocale.getLocaleStringLog("geyser.core.finish.gui");
|
||||||
} else {
|
} else {
|
||||||
message += LanguageUtils.getLocaleStringLog("geyser.core.finish.console");
|
message += GeyserLocale.getLocaleStringLog("geyser.core.finish.console");
|
||||||
}
|
}
|
||||||
logger.info(message);
|
logger.info(message);
|
||||||
|
|
||||||
if (platformType == PlatformType.STANDALONE) {
|
if (platformType == PlatformType.STANDALONE) {
|
||||||
logger.warning(LanguageUtils.getLocaleStringLog("geyser.core.movement_warn"));
|
logger.warning(GeyserLocale.getLocaleStringLog("geyser.core.movement_warn"));
|
||||||
}
|
}
|
||||||
|
|
||||||
newsHandler.handleNews(null, NewsItemAction.ON_SERVER_STARTED);
|
newsHandler.handleNews(null, NewsItemAction.ON_SERVER_STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown"));
|
bootstrap.getGeyserLogger().info(GeyserLocale.getLocaleStringLog("geyser.core.shutdown"));
|
||||||
shuttingDown = true;
|
shuttingDown = true;
|
||||||
|
|
||||||
if (sessionManager.size() >= 1) {
|
if (sessionManager.size() >= 1) {
|
||||||
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown.kick.log", sessionManager.size()));
|
bootstrap.getGeyserLogger().info(GeyserLocale.getLocaleStringLog("geyser.core.shutdown.kick.log", sessionManager.size()));
|
||||||
sessionManager.disconnectAll("geyser.core.shutdown.kick.message");
|
sessionManager.disconnectAll("geyser.core.shutdown.kick.message");
|
||||||
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown.kick.done"));
|
bootstrap.getGeyserLogger().info(GeyserLocale.getLocaleStringLog("geyser.core.shutdown.kick.done"));
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduledThread.shutdown();
|
scheduledThread.shutdown();
|
||||||
|
@ -416,7 +416,7 @@ public class GeyserImpl extends Geyser {
|
||||||
newsHandler.shutdown();
|
newsHandler.shutdown();
|
||||||
this.getCommandManager().getCommands().clear();
|
this.getCommandManager().getCommands().clear();
|
||||||
|
|
||||||
bootstrap.getGeyserLogger().info(LanguageUtils.getLocaleStringLog("geyser.core.shutdown.done"));
|
bootstrap.getGeyserLogger().info(GeyserLocale.getLocaleStringLog("geyser.core.shutdown.done"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -442,12 +442,7 @@ public class GeyserImpl extends Geyser {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused") // API usage
|
@SuppressWarnings("unused") // API usage
|
||||||
public GeyserSession getPlayerByXuid(String xuid) {
|
public GeyserSession getPlayerByXuid(String xuid) {
|
||||||
for (GeyserSession session : sessionManager.getPendingSessions()) {
|
for (GeyserSession session : sessionManager.getAllSessions()) {
|
||||||
if (session.getAuthData().getXuid().equals(xuid)) {
|
|
||||||
return session;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (GeyserSession session : sessionManager.getSessions().values()) {
|
|
||||||
if (session.getAuthData().getXuid().equals(xuid)) {
|
if (session.getAuthData().getXuid().equals(xuid)) {
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.common.main;
|
package org.geysermc.geyser;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -31,7 +31,7 @@ import java.lang.reflect.Method;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class IGeyserMain {
|
public class GeyserMain {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the run help message in the console and a message box if running with a gui
|
* Displays the run help message in the console and a message box if running with a gui
|
||||||
|
@ -54,10 +54,10 @@ public class IGeyserMain {
|
||||||
private String createMessage() {
|
private String createMessage() {
|
||||||
StringBuilder message = new StringBuilder();
|
StringBuilder message = new StringBuilder();
|
||||||
|
|
||||||
InputStream helpStream = IGeyserMain.class.getClassLoader().getResourceAsStream("languages/run-help/" + Locale.getDefault().toString() + ".txt");
|
InputStream helpStream = GeyserMain.class.getClassLoader().getResourceAsStream("languages/run-help/" + Locale.getDefault().toString() + ".txt");
|
||||||
|
|
||||||
if (helpStream == null) {
|
if (helpStream == null) {
|
||||||
helpStream = IGeyserMain.class.getClassLoader().getResourceAsStream("languages/run-help/en_US.txt");
|
helpStream = GeyserMain.class.getClassLoader().getResourceAsStream("languages/run-help/en_US.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
Scanner help = new Scanner(helpStream).useDelimiter("\\Z");
|
Scanner help = new Scanner(helpStream).useDelimiter("\\Z");
|
|
@ -27,7 +27,7 @@ package org.geysermc.geyser.command;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -30,8 +30,8 @@ import lombok.Getter;
|
||||||
import org.geysermc.common.PlatformType;
|
import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.defaults.*;
|
import org.geysermc.geyser.command.defaults.*;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public abstract class CommandManager {
|
||||||
|
|
||||||
public void registerCommand(GeyserCommand command) {
|
public void registerCommand(GeyserCommand command) {
|
||||||
commands.put(command.getName(), command);
|
commands.put(command.getName(), command);
|
||||||
geyser.getLogger().debug(LanguageUtils.getLocaleStringLog("geyser.commands.registered", command.getName()));
|
geyser.getLogger().debug(GeyserLocale.getLocaleStringLog("geyser.commands.registered", command.getName()));
|
||||||
|
|
||||||
if (command.getAliases().isEmpty())
|
if (command.getAliases().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
@ -89,7 +89,7 @@ public abstract class CommandManager {
|
||||||
|
|
||||||
GeyserCommand cmd = commands.get(label);
|
GeyserCommand cmd = commands.get(label);
|
||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
geyser.getLogger().error(LanguageUtils.getLocaleStringLog("geyser.commands.invalid"));
|
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.commands.invalid"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public abstract class CommandManager {
|
||||||
if (!cmd.isBedrockOnly()) {
|
if (!cmd.isBedrockOnly()) {
|
||||||
cmd.execute(null, sender, args);
|
cmd.execute(null, sender, args);
|
||||||
} else {
|
} else {
|
||||||
geyser.getLogger().error(LanguageUtils.getLocaleStringLog("geyser.bootstrap.command.bedrock_only"));
|
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.command.bedrock_only"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.command;
|
package org.geysermc.geyser.command;
|
||||||
|
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implemented on top of any class that can send a command.
|
* Implemented on top of any class that can send a command.
|
||||||
|
@ -49,12 +49,12 @@ public interface CommandSender {
|
||||||
boolean isConsole();
|
boolean isConsole();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the locale of the command sender. Defaults to the default locale at {@link LanguageUtils#getDefaultLocale()}.
|
* Returns the locale of the command sender. Defaults to the default locale at {@link GeyserLocale#getDefaultLocale()}.
|
||||||
*
|
*
|
||||||
* @return the locale of the command sender.
|
* @return the locale of the command sender.
|
||||||
*/
|
*/
|
||||||
default String getLocale() {
|
default String getLocale() {
|
||||||
return LanguageUtils.getDefaultLocale();
|
return GeyserLocale.getDefaultLocale();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,7 +28,7 @@ package org.geysermc.geyser.command;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -27,7 +27,7 @@ package org.geysermc.geyser.command.defaults;
|
||||||
|
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
public class AdvancementsCommand extends GeyserCommand {
|
public class AdvancementsCommand extends GeyserCommand {
|
||||||
public AdvancementsCommand(String name, String description, String permission) {
|
public AdvancementsCommand(String name, String description, String permission) {
|
||||||
|
|
|
@ -33,12 +33,12 @@ import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||||
import org.geysermc.geyser.dump.DumpInfo;
|
import org.geysermc.geyser.dump.DumpInfo;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.utils.WebUtils;
|
import org.geysermc.geyser.util.WebUtils;
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -61,7 +61,7 @@ public class DumpCommand extends GeyserCommand {
|
||||||
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
||||||
// Only allow the console to create dumps on Geyser Standalone
|
// Only allow the console to create dumps on Geyser Standalone
|
||||||
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
|
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class DumpCommand extends GeyserCommand {
|
||||||
|
|
||||||
AsteriskSerializer.showSensitive = showSensitive;
|
AsteriskSerializer.showSensitive = showSensitive;
|
||||||
|
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.dump.collecting", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.dump.collecting", sender.getLocale()));
|
||||||
String dumpData;
|
String dumpData;
|
||||||
try {
|
try {
|
||||||
if (offlineDump) {
|
if (offlineDump) {
|
||||||
|
@ -92,29 +92,29 @@ public class DumpCommand extends GeyserCommand {
|
||||||
dumpData = MAPPER.writeValueAsString(new DumpInfo(addLog));
|
dumpData = MAPPER.writeValueAsString(new DumpInfo(addLog));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.commands.dump.collect_error", sender.getLocale()));
|
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.commands.dump.collect_error", sender.getLocale()));
|
||||||
geyser.getLogger().error(LanguageUtils.getLocaleStringLog("geyser.commands.dump.collect_error_short"), e);
|
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.commands.dump.collect_error_short"), e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String uploadedDumpUrl = "";
|
String uploadedDumpUrl = "";
|
||||||
|
|
||||||
if (offlineDump) {
|
if (offlineDump) {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.dump.writing", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.dump.writing", sender.getLocale()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FileOutputStream outputStream = new FileOutputStream(GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("dump.json").toFile());
|
FileOutputStream outputStream = new FileOutputStream(GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("dump.json").toFile());
|
||||||
outputStream.write(dumpData.getBytes());
|
outputStream.write(dumpData.getBytes());
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.commands.dump.write_error", sender.getLocale()));
|
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.commands.dump.write_error", sender.getLocale()));
|
||||||
geyser.getLogger().error(LanguageUtils.getLocaleStringLog("geyser.commands.dump.write_error_short"), e);
|
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.commands.dump.write_error_short"), e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadedDumpUrl = "dump.json";
|
uploadedDumpUrl = "dump.json";
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.dump.uploading", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.dump.uploading", sender.getLocale()));
|
||||||
|
|
||||||
String response;
|
String response;
|
||||||
JsonNode responseNode;
|
JsonNode responseNode;
|
||||||
|
@ -122,22 +122,22 @@ public class DumpCommand extends GeyserCommand {
|
||||||
response = WebUtils.post(DUMP_URL + "documents", dumpData);
|
response = WebUtils.post(DUMP_URL + "documents", dumpData);
|
||||||
responseNode = MAPPER.readTree(response);
|
responseNode = MAPPER.readTree(response);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.commands.dump.upload_error", sender.getLocale()));
|
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.commands.dump.upload_error", sender.getLocale()));
|
||||||
geyser.getLogger().error(LanguageUtils.getLocaleStringLog("geyser.commands.dump.upload_error_short"), e);
|
geyser.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.commands.dump.upload_error_short"), e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!responseNode.has("key")) {
|
if (!responseNode.has("key")) {
|
||||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.commands.dump.upload_error_short", sender.getLocale()) + ": " + (responseNode.has("message") ? responseNode.get("message").asText() : response));
|
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.commands.dump.upload_error_short", sender.getLocale()) + ": " + (responseNode.has("message") ? responseNode.get("message").asText() : response));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadedDumpUrl = DUMP_URL + responseNode.get("key").asText();
|
uploadedDumpUrl = DUMP_URL + responseNode.get("key").asText();
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.dump.message", sender.getLocale()) + " " + ChatColor.DARK_AQUA + uploadedDumpUrl);
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.dump.message", sender.getLocale()) + " " + ChatColor.DARK_AQUA + uploadedDumpUrl);
|
||||||
if (!sender.isConsole()) {
|
if (!sender.isConsole()) {
|
||||||
geyser.getLogger().info(LanguageUtils.getLocaleStringLog("geyser.commands.dump.created", sender.getName(), uploadedDumpUrl));
|
geyser.getLogger().info(GeyserLocale.getLocaleStringLog("geyser.commands.dump.created", sender.getName(), uploadedDumpUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ package org.geysermc.geyser.command.defaults;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -56,7 +56,7 @@ public class HelpCommand extends GeyserCommand {
|
||||||
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
||||||
int page = 1;
|
int page = 1;
|
||||||
int maxPage = 1;
|
int maxPage = 1;
|
||||||
String header = LanguageUtils.getPlayerLocaleString("geyser.commands.help.header", sender.getLocale(), page, maxPage);
|
String header = GeyserLocale.getPlayerLocaleString("geyser.commands.help.header", sender.getLocale(), page, maxPage);
|
||||||
sender.sendMessage(header);
|
sender.sendMessage(header);
|
||||||
|
|
||||||
Map<String, GeyserCommand> cmds = geyser.getCommandManager().getCommands();
|
Map<String, GeyserCommand> cmds = geyser.getCommandManager().getCommands();
|
||||||
|
@ -70,7 +70,7 @@ public class HelpCommand extends GeyserCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.YELLOW + "/geyser " + cmdName + ChatColor.WHITE + ": " +
|
sender.sendMessage(ChatColor.YELLOW + "/geyser " + cmdName + ChatColor.WHITE + ": " +
|
||||||
LanguageUtils.getPlayerLocaleString(cmd.getDescription(), sender.getLocale()));
|
GeyserLocale.getPlayerLocaleString(cmd.getDescription(), sender.getLocale()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,8 @@ package org.geysermc.geyser.command.defaults;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class ListCommand extends GeyserCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
||||||
String message = LanguageUtils.getPlayerLocaleString("geyser.commands.list.message", sender.getLocale(),
|
String message = GeyserLocale.getPlayerLocaleString("geyser.commands.list.message", sender.getLocale(),
|
||||||
geyser.getSessionManager().size(),
|
geyser.getSessionManager().size(),
|
||||||
geyser.getSessionManager().getAllSessions().stream().map(GeyserSession::getName).collect(Collectors.joining(" ")));
|
geyser.getSessionManager().getAllSessions().stream().map(GeyserSession::getName).collect(Collectors.joining(" ")));
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.BlockUtils;
|
import org.geysermc.geyser.util.BlockUtils;
|
||||||
|
|
||||||
public class OffhandCommand extends GeyserCommand {
|
public class OffhandCommand extends GeyserCommand {
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
public class ReloadCommand extends GeyserCommand {
|
public class ReloadCommand extends GeyserCommand {
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class ReloadCommand extends GeyserCommand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String message = LanguageUtils.getPlayerLocaleString("geyser.commands.reload.message", sender.getLocale());
|
String message = GeyserLocale.getPlayerLocaleString("geyser.commands.reload.message", sender.getLocale());
|
||||||
|
|
||||||
sender.sendMessage(message);
|
sender.sendMessage(message);
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ package org.geysermc.geyser.command.defaults;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.SettingsUtils;
|
import org.geysermc.geyser.util.SettingsUtils;
|
||||||
|
|
||||||
public class SettingsCommand extends GeyserCommand {
|
public class SettingsCommand extends GeyserCommand {
|
||||||
public SettingsCommand(GeyserImpl geyser, String name, String description, String permission) {
|
public SettingsCommand(GeyserImpl geyser, String name, String description, String permission) {
|
||||||
|
|
|
@ -30,7 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundCl
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
public class StatisticsCommand extends GeyserCommand {
|
public class StatisticsCommand extends GeyserCommand {
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class StopCommand extends GeyserCommand {
|
||||||
@Override
|
@Override
|
||||||
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
public void execute(GeyserSession session, CommandSender sender, String[] args) {
|
||||||
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
|
if (!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE) {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.bootstrap.command.permission_fail", sender.getLocale()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,12 @@ import org.geysermc.common.PlatformType;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.command.CommandSender;
|
import org.geysermc.geyser.command.CommandSender;
|
||||||
import org.geysermc.geyser.command.GeyserCommand;
|
import org.geysermc.geyser.command.GeyserCommand;
|
||||||
import org.geysermc.geyser.common.ChatColor;
|
import org.geysermc.geyser.text.ChatColor;
|
||||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
import org.geysermc.geyser.utils.WebUtils;
|
import org.geysermc.geyser.util.WebUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
@ -63,12 +63,12 @@ public class VersionCommand extends GeyserCommand {
|
||||||
bedrockVersions = MinecraftProtocol.SUPPORTED_BEDROCK_CODECS.get(0).getMinecraftVersion();
|
bedrockVersions = MinecraftProtocol.SUPPORTED_BEDROCK_CODECS.get(0).getMinecraftVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.version.version", sender.getLocale(),
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.version", sender.getLocale(),
|
||||||
GeyserImpl.NAME, GeyserImpl.VERSION, MinecraftProtocol.getJavaVersion(), bedrockVersions));
|
GeyserImpl.NAME, GeyserImpl.VERSION, MinecraftProtocol.getJavaVersion(), bedrockVersions));
|
||||||
|
|
||||||
// Disable update checking in dev mode and for players in Geyser Standalone
|
// Disable update checking in dev mode and for players in Geyser Standalone
|
||||||
if (GeyserImpl.getInstance().isProductionEnvironment() && !(!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE)) {
|
if (GeyserImpl.getInstance().isProductionEnvironment() && !(!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE)) {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.version.checking", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.checking", sender.getLocale()));
|
||||||
try {
|
try {
|
||||||
Properties gitProp = new Properties();
|
Properties gitProp = new Properties();
|
||||||
gitProp.load(FileUtils.getResource("git.properties"));
|
gitProp.load(FileUtils.getResource("git.properties"));
|
||||||
|
@ -79,17 +79,17 @@ public class VersionCommand extends GeyserCommand {
|
||||||
int latestBuildNum = Integer.parseInt(buildXML.replaceAll("<(\\\\)?(/)?buildNumber>", "").trim());
|
int latestBuildNum = Integer.parseInt(buildXML.replaceAll("<(\\\\)?(/)?buildNumber>", "").trim());
|
||||||
int buildNum = Integer.parseInt(gitProp.getProperty("git.build.number"));
|
int buildNum = Integer.parseInt(gitProp.getProperty("git.build.number"));
|
||||||
if (latestBuildNum == buildNum) {
|
if (latestBuildNum == buildNum) {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.version.no_updates", sender.getLocale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.no_updates", sender.getLocale()));
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(LanguageUtils.getPlayerLocaleString("geyser.commands.version.outdated",
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.outdated",
|
||||||
sender.getLocale(), (latestBuildNum - buildNum), "https://ci.geysermc.org/"));
|
sender.getLocale(), (latestBuildNum - buildNum), "https://ci.geysermc.org/"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new AssertionError("buildNumber missing");
|
throw new AssertionError("buildNumber missing");
|
||||||
}
|
}
|
||||||
} catch (IOException | AssertionError | NumberFormatException e) {
|
} catch (IOException | AssertionError | NumberFormatException e) {
|
||||||
GeyserImpl.getInstance().getLogger().error(LanguageUtils.getLocaleStringLog("geyser.commands.version.failed"), e);
|
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.commands.version.failed"), e);
|
||||||
sender.sendMessage(ChatColor.RED + LanguageUtils.getPlayerLocaleString("geyser.commands.version.failed", sender.getLocale()));
|
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.commands.version.failed", sender.getLocale()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,10 +27,9 @@ package org.geysermc.geyser.configuration;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import org.geysermc.geyser.api.logger.GeyserLogger;
|
import org.geysermc.geyser.api.logger.GeyserLogger;
|
||||||
import org.geysermc.geyser.common.AuthType;
|
import org.geysermc.geyser.session.auth.AuthType;
|
||||||
import org.geysermc.geyser.configuration.EmoteOffhandWorkaroundOption;
|
|
||||||
import org.geysermc.geyser.network.CIDRMatcher;
|
import org.geysermc.geyser.network.CIDRMatcher;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -174,9 +173,9 @@ public interface GeyserConfiguration {
|
||||||
|
|
||||||
static void checkGeyserConfiguration(GeyserConfiguration geyserConfig, GeyserLogger geyserLogger) {
|
static void checkGeyserConfiguration(GeyserConfiguration geyserConfig, GeyserLogger geyserLogger) {
|
||||||
if (geyserConfig.getConfigVersion() < CURRENT_CONFIG_VERSION) {
|
if (geyserConfig.getConfigVersion() < CURRENT_CONFIG_VERSION) {
|
||||||
geyserLogger.warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.config.outdated"));
|
geyserLogger.warning(GeyserLocale.getLocaleStringLog("geyser.bootstrap.config.outdated"));
|
||||||
} else if (geyserConfig.getConfigVersion() > CURRENT_CONFIG_VERSION) {
|
} else if (geyserConfig.getConfigVersion() > CURRENT_CONFIG_VERSION) {
|
||||||
geyserLogger.warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.config.too_new"));
|
geyserLogger.warning(GeyserLocale.getLocaleStringLog("geyser.bootstrap.config.too_new"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,10 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.common.AuthType;
|
import org.geysermc.geyser.session.auth.AuthType;
|
||||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||||
import org.geysermc.geyser.network.CIDRMatcher;
|
import org.geysermc.geyser.network.CIDRMatcher;
|
||||||
import org.geysermc.geyser.utils.LanguageUtils;
|
import org.geysermc.geyser.text.GeyserLocale;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
@ -257,7 +257,7 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
|
||||||
try {
|
try {
|
||||||
return Integer.parseInt(value);
|
return Integer.parseInt(value);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
System.err.println(LanguageUtils.getLocaleStringLog("geyser.bootstrap.config.invalid_port"));
|
System.err.println(GeyserLocale.getLocaleStringLog("geyser.bootstrap.config.invalid_port"));
|
||||||
return 25565;
|
return 25565;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,12 @@ import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.common.serializer.AsteriskSerializer;
|
import org.geysermc.geyser.text.AsteriskSerializer;
|
||||||
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
import org.geysermc.geyser.configuration.GeyserConfiguration;
|
||||||
import org.geysermc.geyser.network.MinecraftProtocol;
|
import org.geysermc.geyser.network.MinecraftProtocol;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.DockerCheck;
|
import org.geysermc.geyser.util.FileUtils;
|
||||||
import org.geysermc.geyser.utils.FileUtils;
|
import org.geysermc.geyser.util.WebUtils;
|
||||||
import org.geysermc.geyser.utils.WebUtils;
|
|
||||||
import org.geysermc.floodgate.util.DeviceOs;
|
import org.geysermc.floodgate.util.DeviceOs;
|
||||||
import org.geysermc.floodgate.util.FloodgateInfoHolder;
|
import org.geysermc.floodgate.util.FloodgateInfoHolder;
|
||||||
|
|
||||||
|
@ -53,6 +52,7 @@ import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -177,7 +177,24 @@ public class DumpInfo {
|
||||||
this.internalIP = "***";
|
this.internalIP = "***";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dockerCheck = DockerCheck.checkBasic();
|
this.dockerCheck = checkDockerBasic();
|
||||||
|
}
|
||||||
|
|
||||||
|
// By default, Geyser now sets the IP to the local IP in all cases on plugin versions so we don't notify the user of anything
|
||||||
|
// However we still have this check for the potential future bug
|
||||||
|
private boolean checkDockerBasic() {
|
||||||
|
try {
|
||||||
|
String OS = System.getProperty("os.name").toLowerCase();
|
||||||
|
if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0) {
|
||||||
|
String output = new String(java.nio.file.Files.readAllBytes(Paths.get("/proc/1/cgroup")));
|
||||||
|
|
||||||
|
if (output.contains("docker")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) { } // Ignore any errors, inc ip failed to fetch, process could not run or access denied
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,9 @@ import lombok.experimental.Accessors;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.entity.factory.BaseEntityFactory;
|
import org.geysermc.geyser.entity.factory.BaseEntityFactory;
|
||||||
import org.geysermc.geyser.entity.factory.EntityFactory;
|
import org.geysermc.geyser.entity.factory.EntityFactory;
|
||||||
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
import org.geysermc.geyser.registry.Registries;
|
import org.geysermc.geyser.registry.Registries;
|
||||||
|
import org.geysermc.geyser.translator.entity.EntityMetadataTranslator;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -78,7 +80,7 @@ public record EntityDefinition<T extends Entity>(EntityFactory<T> factory, Entit
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
translator.translateFunction().accept(entity, metadata);
|
translator.translate(entity, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
@ -34,22 +34,23 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.entity.factory.BaseEntityFactory;
|
import org.geysermc.geyser.entity.factory.BaseEntityFactory;
|
||||||
import org.geysermc.geyser.entity.factory.ExperienceOrbEntityFactory;
|
import org.geysermc.geyser.entity.factory.ExperienceOrbEntityFactory;
|
||||||
import org.geysermc.geyser.entity.factory.PaintingEntityFactory;
|
import org.geysermc.geyser.entity.factory.PaintingEntityFactory;
|
||||||
import org.geysermc.geyser.entity.living.*;
|
import org.geysermc.geyser.entity.type.*;
|
||||||
import org.geysermc.geyser.entity.living.animal.*;
|
import org.geysermc.geyser.entity.type.living.*;
|
||||||
import org.geysermc.geyser.entity.living.animal.horse.*;
|
import org.geysermc.geyser.entity.type.living.animal.*;
|
||||||
import org.geysermc.geyser.entity.living.animal.tameable.CatEntity;
|
import org.geysermc.geyser.entity.type.living.animal.horse.*;
|
||||||
import org.geysermc.geyser.entity.living.animal.tameable.ParrotEntity;
|
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity;
|
||||||
import org.geysermc.geyser.entity.living.animal.tameable.TameableEntity;
|
import org.geysermc.geyser.entity.type.living.animal.tameable.ParrotEntity;
|
||||||
import org.geysermc.geyser.entity.living.animal.tameable.WolfEntity;
|
import org.geysermc.geyser.entity.type.living.animal.tameable.TameableEntity;
|
||||||
import org.geysermc.geyser.entity.living.merchant.AbstractMerchantEntity;
|
import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity;
|
||||||
import org.geysermc.geyser.entity.living.merchant.VillagerEntity;
|
import org.geysermc.geyser.entity.type.living.merchant.AbstractMerchantEntity;
|
||||||
import org.geysermc.geyser.entity.living.monster.*;
|
import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity;
|
||||||
import org.geysermc.geyser.entity.living.monster.raid.PillagerEntity;
|
import org.geysermc.geyser.entity.type.living.monster.*;
|
||||||
import org.geysermc.geyser.entity.living.monster.raid.RaidParticipantEntity;
|
import org.geysermc.geyser.entity.type.living.monster.raid.PillagerEntity;
|
||||||
import org.geysermc.geyser.entity.living.monster.raid.SpellcasterIllagerEntity;
|
import org.geysermc.geyser.entity.type.living.monster.raid.RaidParticipantEntity;
|
||||||
import org.geysermc.geyser.entity.living.monster.raid.VindicatorEntity;
|
import org.geysermc.geyser.entity.type.living.monster.raid.SpellcasterIllagerEntity;
|
||||||
import org.geysermc.geyser.entity.player.PlayerEntity;
|
import org.geysermc.geyser.entity.type.living.monster.raid.VindicatorEntity;
|
||||||
import org.geysermc.geyser.network.translators.chat.MessageTranslator;
|
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
||||||
|
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||||
import org.geysermc.geyser.registry.Registries;
|
import org.geysermc.geyser.registry.Registries;
|
||||||
|
|
||||||
public final class EntityDefinitions {
|
public final class EntityDefinitions {
|
||||||
|
|
|
@ -23,20 +23,20 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.utils;
|
package org.geysermc.geyser.entity;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.geyser.entity.Entity;
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
import org.geysermc.geyser.entity.living.MobEntity;
|
import org.geysermc.geyser.entity.type.living.MobEntity;
|
||||||
import org.geysermc.geyser.entity.living.animal.AnimalEntity;
|
import org.geysermc.geyser.entity.type.living.animal.AnimalEntity;
|
||||||
import org.geysermc.geyser.entity.living.animal.horse.HorseEntity;
|
import org.geysermc.geyser.entity.type.living.animal.horse.HorseEntity;
|
||||||
import org.geysermc.geyser.entity.living.animal.tameable.CatEntity;
|
import org.geysermc.geyser.entity.type.living.animal.tameable.CatEntity;
|
||||||
import org.geysermc.geyser.entity.living.animal.tameable.WolfEntity;
|
import org.geysermc.geyser.entity.type.living.animal.tameable.WolfEntity;
|
||||||
import org.geysermc.geyser.entity.living.merchant.VillagerEntity;
|
import org.geysermc.geyser.entity.type.living.merchant.VillagerEntity;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.registry.type.ItemMapping;
|
import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
|
@ -26,9 +26,9 @@
|
||||||
package org.geysermc.geyser.entity.factory;
|
package org.geysermc.geyser.entity.factory;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import org.geysermc.geyser.entity.Entity;
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
import org.geysermc.geyser.entity.EntityDefinition;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.entity.factory;
|
package org.geysermc.geyser.entity.factory;
|
||||||
|
|
||||||
import org.geysermc.geyser.entity.Entity;
|
import org.geysermc.geyser.entity.type.Entity;
|
||||||
|
|
||||||
public interface EntityFactory<T extends Entity> {
|
public interface EntityFactory<T extends Entity> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
package org.geysermc.geyser.entity.factory;
|
package org.geysermc.geyser.entity.factory;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import org.geysermc.geyser.entity.ExpOrbEntity;
|
import org.geysermc.geyser.entity.type.ExpOrbEntity;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ExperienceOrbEntityFactory extends EntityFactory<ExpOrbEntity> {
|
public interface ExperienceOrbEntityFactory extends EntityFactory<ExpOrbEntity> {
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
package org.geysermc.geyser.entity.factory;
|
package org.geysermc.geyser.entity.factory;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import org.geysermc.geyser.entity.PaintingEntity;
|
import org.geysermc.geyser.entity.type.PaintingEntity;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.PaintingType;
|
import org.geysermc.geyser.level.PaintingType;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,14 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.FloatEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.FloatEntityMetadata;
|
||||||
|
@ -31,8 +31,9 @@ import com.github.steveice10.mc.protocol.data.game.level.particle.Particle;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.utils.EffectUtils;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
import org.geysermc.geyser.registry.Registries;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ public class AreaEffectCloudEntity extends Entity {
|
||||||
|
|
||||||
public void setParticle(EntityMetadata<Particle, ?> entityMetadata) {
|
public void setParticle(EntityMetadata<Particle, ?> entityMetadata) {
|
||||||
Particle particle = entityMetadata.getValue();
|
Particle particle = entityMetadata.getValue();
|
||||||
int particleId = EffectUtils.getParticleId(session, particle.getType());
|
int particleId = Registries.PARTICLES.map(particle.getType(), mapping -> mapping.getParticleId(this.session)).orElse(-1);
|
||||||
if (particleId != -1) {
|
if (particleId != -1) {
|
||||||
dirtyMetadata.put(EntityData.AREA_EFFECT_CLOUD_PARTICLE_ID, particleId);
|
dirtyMetadata.put(EntityData.AREA_EFFECT_CLOUD_PARTICLE_ID, particleId);
|
||||||
}
|
}
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||||
|
@ -32,7 +32,9 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.packet.AnimatePacket;
|
import com.nukkitx.protocol.bedrock.packet.AnimatePacket;
|
||||||
import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket;
|
import com.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.entity.EntityDefinitions;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
|
@ -23,11 +23,12 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,13 +23,14 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
|
||||||
|
@ -31,7 +31,8 @@ import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.math.vector.Vector3i;
|
import com.nukkitx.math.vector.Vector3i;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose;
|
||||||
|
@ -43,9 +43,11 @@ import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.network.translators.chat.MessageTranslator;
|
import org.geysermc.geyser.entity.GeyserDirtyMetadata;
|
||||||
import org.geysermc.geyser.utils.MathUtils;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
import org.geysermc.geyser.translator.text.MessageTranslator;
|
||||||
|
import org.geysermc.geyser.util.MathUtils;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
|
@ -23,11 +23,12 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinitions;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
public class ExpOrbEntity extends Entity {
|
public class ExpOrbEntity extends Entity {
|
||||||
|
|
|
@ -23,13 +23,14 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinitions;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||||
|
@ -36,10 +36,11 @@ import com.nukkitx.nbt.NbtMapBuilder;
|
||||||
import com.nukkitx.nbt.NbtType;
|
import com.nukkitx.nbt.NbtType;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket;
|
import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket;
|
||||||
import org.geysermc.geyser.entity.player.PlayerEntity;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
||||||
import org.geysermc.geyser.utils.FireworkColor;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.utils.MathUtils;
|
import org.geysermc.geyser.level.FireworkColor;
|
||||||
|
import org.geysermc.geyser.util.MathUtils;
|
||||||
import org.geysermc.floodgate.util.DeviceOs;
|
import org.geysermc.floodgate.util.DeviceOs;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
|
@ -31,14 +31,15 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
|
import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.geyser.entity.player.PlayerEntity;
|
import org.geysermc.geyser.entity.EntityDefinitions;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.type.player.PlayerEntity;
|
||||||
import org.geysermc.geyser.network.translators.collision.BoundingBox;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.collision.translators.BlockCollision;
|
import org.geysermc.geyser.level.physics.BoundingBox;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.translator.collision.BlockCollision;
|
||||||
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
import org.geysermc.geyser.registry.BlockRegistries;
|
import org.geysermc.geyser.registry.BlockRegistries;
|
||||||
import org.geysermc.geyser.utils.BlockPositionIterator;
|
import org.geysermc.geyser.level.block.BlockPositionIterator;
|
||||||
import org.geysermc.geyser.utils.BlockUtils;
|
import org.geysermc.geyser.util.BlockUtils;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
|
@ -23,13 +23,14 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
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.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||||
|
@ -34,9 +34,10 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
|
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
|
||||||
import com.nukkitx.protocol.bedrock.packet.AddItemEntityPacket;
|
import com.nukkitx.protocol.bedrock.packet.AddItemEntityPacket;
|
||||||
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
|
import com.nukkitx.protocol.bedrock.packet.EntityEventPacket;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.network.translators.item.ItemTranslator;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.network.translators.world.block.BlockStateValues;
|
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
|
||||||
|
import org.geysermc.geyser.level.block.BlockStateValues;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||||
|
@ -39,8 +39,9 @@ import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket;
|
||||||
import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket;
|
import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket;
|
||||||
import com.nukkitx.protocol.bedrock.v465.Bedrock_v465;
|
import com.nukkitx.protocol.bedrock.v465.Bedrock_v465;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.network.translators.item.ItemTranslator;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
import org.geysermc.geyser.translator.inventory.item.ItemTranslator;
|
||||||
import org.geysermc.geyser.registry.type.ItemMapping;
|
import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
|
@ -23,10 +23,11 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,10 +23,11 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,11 +23,12 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
|
import com.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute;
|
import com.github.steveice10.mc.protocol.data.game.entity.attribute.Attribute;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
|
@ -45,11 +45,12 @@ import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
|
import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.registry.type.ItemMapping;
|
import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
import org.geysermc.geyser.utils.AttributeUtils;
|
import org.geysermc.geyser.util.AttributeUtils;
|
||||||
import org.geysermc.geyser.utils.ChunkUtils;
|
import org.geysermc.geyser.util.ChunkUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
|
@ -23,13 +23,14 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.BooleanEntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,12 +23,13 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.packet.AddPaintingPacket;
|
import com.nukkitx.protocol.bedrock.packet.AddPaintingPacket;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinitions;
|
||||||
import org.geysermc.geyser.utils.PaintingType;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
import org.geysermc.geyser.level.PaintingType;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,12 +23,13 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
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.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,15 +23,15 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.type.IntEntityMetadata;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket;
|
import com.nukkitx.protocol.bedrock.packet.SetEntityDataPacket;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
|
@ -31,8 +31,9 @@ import com.nukkitx.protocol.bedrock.data.LevelEventType;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import com.nukkitx.protocol.bedrock.packet.LevelEventPacket;
|
import com.nukkitx.protocol.bedrock.packet.LevelEventPacket;
|
||||||
import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket;
|
import com.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
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.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,11 +23,12 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.nukkitx.math.vector.Vector3f;
|
import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||||
|
@ -33,8 +33,9 @@ import com.nukkitx.math.vector.Vector3f;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityData;
|
||||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.network.session.GeyserSession;
|
import org.geysermc.geyser.entity.EntityDefinition;
|
||||||
import org.geysermc.geyser.network.translators.item.Potion;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
import org.geysermc.geyser.inventory.item.Potion;
|
||||||
import org.geysermc.geyser.registry.type.ItemMapping;
|
import org.geysermc.geyser.registry.type.ItemMapping;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
|
@ -23,7 +23,7 @@
|
||||||
* @link https://github.com/GeyserMC/Geyser
|
* @link https://github.com/GeyserMC/Geyser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geysermc.geyser.entity;
|
package org.geysermc.geyser.entity.type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implemented onto anything that should have code ran every Minecraft tick - 50 milliseconds.
|
* Implemented onto anything that should have code ran every Minecraft tick - 50 milliseconds.
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue