3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-09-08 20:43:04 +02:00
Dieser Commit ist enthalten in:
ImDaBigBoss 2022-01-10 18:47:37 +01:00
Commit bfe4c09290
662 geänderte Dateien mit 2329 neuen und 1923 gelöschten Zeilen

2
Jenkinsfile vendored
Datei anzeigen

@ -92,7 +92,7 @@ pipeline {
success { success {
script { script {
if (env.BRANCH_NAME == 'master') { if (env.BRANCH_NAME == 'master') {
build propagate: false, wait: false, job: 'GeyserMC/Geyser-Fabric/java-1.17', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)] build propagate: false, wait: false, job: 'GeyserMC/Geyser-Fabric/java-1.18', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)]
build propagate: false, wait: false, job: 'GeyserMC/GeyserConnect/master', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)] build propagate: false, wait: false, job: 'GeyserMC/GeyserConnect/master', parameters: [booleanParam(name: 'SKIP_DISCORD', value: true)]
} }
} }

Datei anzeigen

@ -1,6 +1,6 @@
The MIT License The MIT License
Copyright (c) 2019-2021 GeyserMC. http://geysermc.org Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -17,7 +17,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here! Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here!
### Currently supporting Minecraft Bedrock 1.17.30 - 1.17.41 + 1.18 and Minecraft Java 1.18. ### Currently supporting Minecraft Bedrock 1.17.30 - 1.17.41 + 1.18.0 - 1.18.2 and Minecraft Java 1.18/1.18.1.
## Setting Up ## Setting Up
Take a look [here](https://github.com/GeyserMC/Geyser/wiki/Setup) for how to set up Geyser. Take a look [here](https://github.com/GeyserMC/Geyser/wiki/Setup) for how to set up Geyser.

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -29,6 +29,7 @@ import lombok.AllArgsConstructor;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.ServerPing; import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ListenerInfo; import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.connection.PendingConnection; import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.event.ProxyPingEvent; import net.md_5.bungee.api.event.ProxyPingEvent;
@ -52,8 +53,11 @@ public class GeyserBungeePingPassthrough implements IGeyserPingPassthrough, List
public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) { public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {
CompletableFuture<ProxyPingEvent> future = new CompletableFuture<>(); CompletableFuture<ProxyPingEvent> future = new CompletableFuture<>();
proxyServer.getPluginManager().callEvent(new ProxyPingEvent(new GeyserPendingConnection(inetSocketAddress), getPingInfo(), (event, throwable) -> { proxyServer.getPluginManager().callEvent(new ProxyPingEvent(new GeyserPendingConnection(inetSocketAddress), getPingInfo(), (event, throwable) -> {
if (throwable != null) future.completeExceptionally(throwable); if (throwable != null) {
else future.complete(event); future.completeExceptionally(throwable);
} else {
future.complete(event);
}
})); }));
ProxyPingEvent event = future.join(); ProxyPingEvent event = future.join();
ServerPing response = event.getResponse(); ServerPing response = event.getResponse();
@ -76,9 +80,12 @@ public class GeyserBungeePingPassthrough implements IGeyserPingPassthrough, List
private ServerPing getPingInfo() { private ServerPing getPingInfo() {
return new ServerPing( return new ServerPing(
new ServerPing.Protocol(proxyServer.getName() + " " + proxyServer.getGameVersion(), ProtocolConstants.SUPPORTED_VERSION_IDS.get(ProtocolConstants.SUPPORTED_VERSION_IDS.size() - 1)), new ServerPing.Protocol(
proxyServer.getName() + " " + ProtocolConstants.SUPPORTED_VERSIONS.get(0) + "-" + ProtocolConstants.SUPPORTED_VERSIONS.get(ProtocolConstants.SUPPORTED_VERSIONS.size() - 1),
ProtocolConstants.SUPPORTED_VERSION_IDS.get(ProtocolConstants.SUPPORTED_VERSION_IDS.size() - 1)),
new ServerPing.Players(getDefaultListener().getMaxPlayers(), proxyServer.getOnlineCount(), null), new ServerPing.Players(getDefaultListener().getMaxPlayers(), proxyServer.getOnlineCount(), null),
getDefaultListener().getMotd(), proxyServer.getConfig().getFaviconObject() TextComponent.fromLegacyText(getDefaultListener().getMotd())[0],
proxyServer.getConfig().getFaviconObject()
); );
} }

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -63,17 +63,21 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
@Override @Override
public void onEnable() { public void onEnable() {
GeyserLocale.init(this);
if (!getDataFolder().exists()) if (!getDataFolder().exists())
getDataFolder().mkdir(); getDataFolder().mkdir();
try { try {
if (!getDataFolder().exists()) if (!getDataFolder().exists())
getDataFolder().mkdir(); getDataFolder().mkdir();
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);
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserBungeeConfiguration.class); this.geyserConfig = FileUtils.loadConfig(configFile, GeyserBungeeConfiguration.class);
} catch (IOException ex) { } catch (IOException ex) {
getLogger().log(Level.WARNING, GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex); getLogger().log(Level.SEVERE, GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
ex.printStackTrace(); ex.printStackTrace();
return;
} }
if (getProxy().getConfig().getListeners().size() == 1) { if (getProxy().getConfig().getListeners().size() == 1) {

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -11,6 +11,10 @@
<artifactId>bootstrap-spigot</artifactId> <artifactId>bootstrap-spigot</artifactId>
<repositories> <repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository> <repository>
<id>viaversion-repo</id> <id>viaversion-repo</id>
<url>https://repo.viaversion.com</url> <url>https://repo.viaversion.com</url>
@ -25,9 +29,9 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>io.papermc.paper</groupId>
<artifactId>spigot-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version> <version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -39,7 +43,7 @@
<dependency> <dependency>
<groupId>org.geysermc.geyser.adapters</groupId> <groupId>org.geysermc.geyser.adapters</groupId>
<artifactId>spigot-all</artifactId> <artifactId>spigot-all</artifactId>
<version>1.2-SNAPSHOT</version> <version>1.3-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -25,6 +25,7 @@
package org.geysermc.geyser.platform.spigot; package org.geysermc.geyser.platform.spigot;
import com.github.steveice10.mc.protocol.MinecraftProtocol;
import com.viaversion.viaversion.bukkit.handlers.BukkitChannelInitializer; import com.viaversion.viaversion.bukkit.handlers.BukkitChannelInitializer;
import io.netty.bootstrap.ServerBootstrap; import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.*; import io.netty.channel.*;
@ -34,10 +35,12 @@ import org.bukkit.Bukkit;
import org.geysermc.geyser.GeyserBootstrap; import org.geysermc.geyser.GeyserBootstrap;
import org.geysermc.geyser.network.netty.GeyserInjector; import org.geysermc.geyser.network.netty.GeyserInjector;
import org.geysermc.geyser.network.netty.LocalServerChannelWrapper; import org.geysermc.geyser.network.netty.LocalServerChannelWrapper;
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;
import java.lang.reflect.ParameterizedType; import java.lang.reflect.ParameterizedType;
import java.net.InetAddress;
import java.util.List; import java.util.List;
public class GeyserSpigotInjector extends GeyserInjector { public class GeyserSpigotInjector extends GeyserInjector {
@ -128,6 +131,8 @@ public class GeyserSpigotInjector extends GeyserInjector {
allServerChannels.add(channelFuture); allServerChannels.add(channelFuture);
this.localChannel = channelFuture; this.localChannel = channelFuture;
this.serverSocketAddress = channelFuture.channel().localAddress(); this.serverSocketAddress = channelFuture.channel().localAddress();
workAroundWeirdBug(bootstrap);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -158,6 +163,18 @@ public class GeyserSpigotInjector extends GeyserInjector {
return childHandler; return childHandler;
} }
/**
* Work around an odd bug where the first connection might not initialize all channel handlers on the main pipeline -
* send a dummy status request down that acts as the first connection, then.
* For the future, if someone wants to properly fix this - as of December 28, 2021, it happens on 1.16.5/1.17.1/1.18.1 EXCEPT Spigot 1.16.5
*/
private void workAroundWeirdBug(GeyserBootstrap bootstrap) {
LocalSession session = new LocalSession(bootstrap.getGeyserConfig().getRemote().getAddress(),
bootstrap.getGeyserConfig().getRemote().getPort(), this.serverSocketAddress,
InetAddress.getLoopbackAddress().getHostAddress(), new MinecraftProtocol());
session.connect();
}
@Override @Override
public void shutdown() { public void shutdown() {
if (this.allServerChannels != null) { if (this.allServerChannels != null) {

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -57,8 +57,8 @@ public class GeyserSpigotPingPassthrough implements IGeyserPingPassthrough {
Bukkit.getOnlinePlayers().stream().map(Player::getName).forEach(geyserPingInfo.getPlayerList()::add); Bukkit.getOnlinePlayers().stream().map(Player::getName).forEach(geyserPingInfo.getPlayerList()::add);
return geyserPingInfo; return geyserPingInfo;
} catch (Exception e) { } catch (Exception e) {
logger.debug("Error while getting Bukkit ping passthrough: " + e.toString()); logger.debug("Error while getting Bukkit ping passthrough: " + e);
return new GeyserPingInfo(null, null, null); return null;
} }
} }
@ -79,5 +79,4 @@ public class GeyserSpigotPingPassthrough implements IGeyserPingPassthrough {
return Collections.emptyIterator(); return Collections.emptyIterator();
} }
} }
} }

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -79,16 +79,21 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
@Override @Override
public void onEnable() { public void onEnable() {
GeyserLocale.init(this);
// This is manually done instead of using Bukkit methods to save the config because otherwise comments get removed // This is manually done instead of using Bukkit methods to save the config because otherwise comments get removed
try { try {
if (!getDataFolder().exists()) { if (!getDataFolder().exists()) {
getDataFolder().mkdir(); getDataFolder().mkdir();
} }
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);
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpigotConfiguration.class); this.geyserConfig = FileUtils.loadConfig(configFile, GeyserSpigotConfiguration.class);
} catch (IOException ex) { } catch (IOException ex) {
getLogger().log(Level.WARNING, GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex); getLogger().log(Level.SEVERE, GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
ex.printStackTrace(); ex.printStackTrace();
Bukkit.getPluginManager().disablePlugin(this);
return;
} }
try { try {
@ -163,8 +168,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(GeyserLocale.getLocaleStringLog("geyser.bootstrap.viaversion.too_old", GeyserSpigotVersionChecker.sendOutdatedViaVersionMessage(geyserLogger);
"https://ci.viaversion.com/job/ViaVersion/"));
isViaVersion = false; isViaVersion = false;
if (this.geyserConfig.isDebugMode()) { if (this.geyserConfig.isDebugMode()) {
e.printStackTrace(); e.printStackTrace();
@ -237,6 +241,9 @@ public class GeyserSpigotPlugin extends JavaPlugin implements GeyserBootstrap {
} }
this.getCommand("geyser").setExecutor(new GeyserSpigotCommandExecutor(geyser)); this.getCommand("geyser").setExecutor(new GeyserSpigotCommandExecutor(geyser));
// Check to ensure the current setup can support the protocol version Geyser uses
GeyserSpigotVersionChecker.checkForSupportedProtocol(geyserLogger, isViaVersion);
} }
@Override @Override

Datei anzeigen

@ -0,0 +1,122 @@
/*
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.geyser.platform.spigot;
import com.viaversion.viaversion.api.Via;
import org.bukkit.Bukkit;
import org.bukkit.UnsafeValues;
import org.geysermc.geyser.GeyserLogger;
import org.geysermc.geyser.network.MinecraftProtocol;
import org.geysermc.geyser.text.GeyserLocale;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
public final class GeyserSpigotVersionChecker {
private static final String VIAVERSION_DOWNLOAD_URL = "https://ci.viaversion.com/job/ViaVersion/";
public static void checkForSupportedProtocol(GeyserLogger logger, boolean viaversion) {
if (viaversion) {
checkViaVersionSupportedVersions(logger);
return;
}
try {
// This method is only present on later versions of Paper
UnsafeValues.class.getMethod("getProtocolVersion");
if (Bukkit.getUnsafe().getProtocolVersion() != MinecraftProtocol.getJavaProtocolVersion()) {
sendOutdatedMessage(logger);
}
return;
} catch (NoSuchMethodException ignored) {
}
// Otherwise, we can just try to find the SharedConstants class
// It isn't present in all server versions, but if we can't find it, then we're probably not in the latest version
Class<?> sharedConstants;
try {
sharedConstants = Class.forName("net.minecraft.SharedConstants");
} catch (ClassNotFoundException e) {
// We're using pre-1.17
String prefix = Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit", "net.minecraft.server");
try {
sharedConstants = Class.forName(prefix + ".SharedConstants");
} catch (ClassNotFoundException e2) {
sendOutdatedMessage(logger);
return;
}
}
for (Method method : sharedConstants.getMethods()) {
if (method.getReturnType() == int.class && Modifier.isStatic(method.getModifiers())) {
int protocolVersion;
try {
protocolVersion = (int) method.invoke(null);
} catch (IllegalAccessException | InvocationTargetException e) {
logger.warning("Could not determine server version! This is safe to ignore, but please report to the developers: " + e.getMessage());
if (logger.isDebug()) {
e.printStackTrace();
}
return;
}
if (protocolVersion != MinecraftProtocol.getJavaProtocolVersion()) {
sendOutdatedMessage(logger);
}
return;
}
}
sendOutdatedMessage(logger);
}
private static void checkViaVersionSupportedVersions(GeyserLogger logger) {
// Run after ViaVersion has obtained the server protocol version
Via.getPlatform().runSync(() -> {
if (Via.getAPI().getSupportedVersions().contains(MinecraftProtocol.getJavaProtocolVersion())) {
// Via supports this protocol version; we will be able to connect.
return;
}
if (Via.getAPI().getFullSupportedVersions().contains(MinecraftProtocol.getJavaProtocolVersion())) {
// ViaVersion supports our protocol, but the user has blocked them from connecting.
logger.warning(GeyserLocale.getLocaleStringLog("geyser.bootstrap.viaversion.blocked", MinecraftProtocol.getAllSupportedJavaVersions()));
return;
}
// Else, presumably, ViaVersion is not updated.
sendOutdatedViaVersionMessage(logger);
});
}
public static void sendOutdatedViaVersionMessage(GeyserLogger logger) {
logger.warning(GeyserLocale.getLocaleStringLog("geyser.bootstrap.viaversion.too_old",
VIAVERSION_DOWNLOAD_URL));
}
private static void sendOutdatedMessage(GeyserLogger logger) {
logger.warning(GeyserLocale.getLocaleStringLog("geyser.bootstrap.no_supported_protocol", MinecraftProtocol.getAllSupportedJavaVersions(), VIAVERSION_DOWNLOAD_URL));
}
private GeyserSpigotVersionChecker() {
}
}

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -71,15 +71,19 @@ public class GeyserSpongePlugin implements GeyserBootstrap {
@Override @Override
public void onEnable() { public void onEnable() {
GeyserLocale.init(this);
if (!configDir.exists()) if (!configDir.exists())
configDir.mkdirs(); configDir.mkdirs();
File configFile = null; File configFile;
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()), this);
} catch (IOException ex) { } catch (IOException ex) {
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed")); logger.error(GeyserLocale.getLocaleStringLog("geyser.config.failed"));
ex.printStackTrace(); ex.printStackTrace();
return;
} }
try { try {

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -10,6 +10,10 @@
</parent> </parent>
<artifactId>bootstrap-standalone</artifactId> <artifactId>bootstrap-standalone</artifactId>
<properties>
<log4j.version>2.17.1</log4j.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
@ -58,17 +62,17 @@
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId> <artifactId>log4j-api</artifactId>
<version>2.13.1</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.13.2</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId> <artifactId>log4j-slf4j18-impl</artifactId>
<version>2.13.1</version> <version>${log4j.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -90,6 +90,8 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
boolean useGuiOpts = bootstrap.useGui; boolean useGuiOpts = bootstrap.useGui;
String configFilenameOpt = bootstrap.configFilename; String configFilenameOpt = bootstrap.configFilename;
GeyserLocale.init(bootstrap);
List<BeanPropertyDefinition> availableProperties = getPOJOForClass(GeyserJacksonConfiguration.class); List<BeanPropertyDefinition> availableProperties = getPOJOForClass(GeyserJacksonConfiguration.class);
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
@ -188,7 +190,8 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
LoopbackUtil.checkLoopback(geyserLogger); LoopbackUtil.checkLoopback(geyserLogger);
try { try {
File configFile = FileUtils.fileOrCopiedFromResource(new File(configFilename), "config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString())); File configFile = FileUtils.fileOrCopiedFromResource(new File(configFilename), "config.yml",
(x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()), this);
geyserConfig = FileUtils.loadConfig(configFile, GeyserStandaloneConfiguration.class); geyserConfig = FileUtils.loadConfig(configFile, GeyserStandaloneConfiguration.class);
handleArgsConfigOptions(); handleArgsConfigOptions();

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -36,17 +36,17 @@ import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer; 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.GeyserBootstrap; import org.geysermc.geyser.GeyserBootstrap;
import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.GeyserImpl;
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.util.FileUtils; import org.geysermc.geyser.session.auth.AuthType;
import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.FileUtils;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -83,16 +83,19 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
@Override @Override
public void onEnable() { public void onEnable() {
GeyserLocale.init(this);
try { try {
if (!configFolder.toFile().exists()) if (!configFolder.toFile().exists())
//noinspection ResultOfMethodCallIgnored //noinspection ResultOfMethodCallIgnored
configFolder.toFile().mkdirs(); configFolder.toFile().mkdirs();
File configFile = FileUtils.fileOrCopiedFromResource(configFolder.resolve("config.yml").toFile(), File configFile = FileUtils.fileOrCopiedFromResource(configFolder.resolve("config.yml").toFile(),
"config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString())); "config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()), this);
this.geyserConfig = FileUtils.loadConfig(configFile, GeyserVelocityConfiguration.class); this.geyserConfig = FileUtils.loadConfig(configFile, GeyserVelocityConfiguration.class);
} catch (IOException ex) { } catch (IOException ex) {
logger.warn(GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex); logger.error(GeyserLocale.getLocaleStringLog("geyser.config.failed"), ex);
ex.printStackTrace(); ex.printStackTrace();
return;
} }
InetSocketAddress javaAddr = proxyServer.getBoundAddress(); InetSocketAddress javaAddr = proxyServer.getBoundAddress();

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,8 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Floodgate * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.crypto; package org.geysermc.floodgate.crypto;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,8 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Floodgate * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.crypto; package org.geysermc.floodgate.crypto;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,8 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Floodgate * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.crypto; package org.geysermc.floodgate.crypto;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -20,8 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Floodgate * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.crypto; package org.geysermc.floodgate.crypto;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,6 @@
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Geyser * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.util; package org.geysermc.floodgate.util;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,6 @@
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Geyser * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.util; package org.geysermc.floodgate.util;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,6 @@
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Geyser * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.util; package org.geysermc.floodgate.util;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -21,7 +21,6 @@
* *
* @author GeyserMC * @author GeyserMC
* @link https://github.com/GeyserMC/Geyser * @link https://github.com/GeyserMC/Geyser
*
*/ */
package org.geysermc.floodgate.util; package org.geysermc.floodgate.util;

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -83,7 +83,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.nukkitx.fastutil</groupId> <groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-long-long-maps</artifactId> <artifactId>fastutil-int-long-maps</artifactId>
<version>${fastutil.version}</version> <version>${fastutil.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -155,7 +155,7 @@
<dependency> <dependency>
<groupId>com.github.GeyserMC</groupId> <groupId>com.github.GeyserMC</groupId>
<artifactId>MCProtocolLib</artifactId> <artifactId>MCProtocolLib</artifactId>
<version>6970991</version> <version>6a23a780</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen