From 9a59f9e8e2ce21015ab299505e197842ec50c949 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 22 Oct 2020 01:03:08 -0400 Subject: [PATCH] Shuffle some event classes around. The new locations make better sense. --- .../event/{proxy => connection}/ProxyPingEvent.java | 2 +- .../{connection => player}/DisconnectEvent.java | 2 +- .../api/event/player/GameProfileRequestEvent.java | 2 +- .../api/event/{connection => player}/LoginEvent.java | 2 +- .../event/{connection => player}/PostLoginEvent.java | 2 +- .../event/{connection => player}/PreLoginEvent.java | 2 +- .../api/event/{query => proxy}/ProxyQueryEvent.java | 2 +- .../api/event/query/package-info.java | 4 ---- .../proxy/connection/client/ConnectedPlayer.java | 4 ++-- .../proxy/connection/client/LoginSessionHandler.java | 12 ++++++------ .../connection/client/StatusSessionHandler.java | 2 +- .../proxy/protocol/netty/GS4QueryHandler.java | 6 +++--- 12 files changed, 19 insertions(+), 23 deletions(-) rename api/src/main/java/com/velocitypowered/api/event/{proxy => connection}/ProxyPingEvent.java (95%) rename api/src/main/java/com/velocitypowered/api/event/{connection => player}/DisconnectEvent.java (95%) rename api/src/main/java/com/velocitypowered/api/event/{connection => player}/LoginEvent.java (95%) rename api/src/main/java/com/velocitypowered/api/event/{connection => player}/PostLoginEvent.java (91%) rename api/src/main/java/com/velocitypowered/api/event/{connection => player}/PreLoginEvent.java (98%) rename api/src/main/java/com/velocitypowered/api/event/{query => proxy}/ProxyQueryEvent.java (98%) delete mode 100644 api/src/main/java/com/velocitypowered/api/event/query/package-info.java diff --git a/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java b/api/src/main/java/com/velocitypowered/api/event/connection/ProxyPingEvent.java similarity index 95% rename from api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java rename to api/src/main/java/com/velocitypowered/api/event/connection/ProxyPingEvent.java index f89cfcb74..dd95b414e 100644 --- a/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/connection/ProxyPingEvent.java @@ -1,4 +1,4 @@ -package com.velocitypowered.api.event.proxy; +package com.velocitypowered.api.event.connection; import com.google.common.base.Preconditions; import com.velocitypowered.api.proxy.InboundConnection; diff --git a/api/src/main/java/com/velocitypowered/api/event/connection/DisconnectEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/DisconnectEvent.java similarity index 95% rename from api/src/main/java/com/velocitypowered/api/event/connection/DisconnectEvent.java rename to api/src/main/java/com/velocitypowered/api/event/player/DisconnectEvent.java index 6ef3b251b..cd275e319 100644 --- a/api/src/main/java/com/velocitypowered/api/event/connection/DisconnectEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/DisconnectEvent.java @@ -1,4 +1,4 @@ -package com.velocitypowered.api.event.connection; +package com.velocitypowered.api.event.player; import com.google.common.base.Preconditions; import com.velocitypowered.api.proxy.Player; diff --git a/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java index 4c209056a..34b5c1432 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java @@ -6,7 +6,7 @@ import com.velocitypowered.api.util.GameProfile; import org.checkerframework.checker.nullness.qual.Nullable; /** - * This event is fired after the {@link com.velocitypowered.api.event.connection.PreLoginEvent} in + * This event is fired after the {@link PreLoginEvent} in * order to set up the game profile for the user. This can be used to configure a custom profile for * a user, i.e. skin replacement. */ diff --git a/api/src/main/java/com/velocitypowered/api/event/connection/LoginEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/LoginEvent.java similarity index 95% rename from api/src/main/java/com/velocitypowered/api/event/connection/LoginEvent.java rename to api/src/main/java/com/velocitypowered/api/event/player/LoginEvent.java index c204d9027..a8ebfa33b 100644 --- a/api/src/main/java/com/velocitypowered/api/event/connection/LoginEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/LoginEvent.java @@ -1,4 +1,4 @@ -package com.velocitypowered.api.event.connection; +package com.velocitypowered.api.event.player; import com.google.common.base.Preconditions; import com.velocitypowered.api.event.ResultedEvent; diff --git a/api/src/main/java/com/velocitypowered/api/event/connection/PostLoginEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/PostLoginEvent.java similarity index 91% rename from api/src/main/java/com/velocitypowered/api/event/connection/PostLoginEvent.java rename to api/src/main/java/com/velocitypowered/api/event/player/PostLoginEvent.java index e9b7d08b0..0d3661c86 100644 --- a/api/src/main/java/com/velocitypowered/api/event/connection/PostLoginEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/PostLoginEvent.java @@ -1,4 +1,4 @@ -package com.velocitypowered.api.event.connection; +package com.velocitypowered.api.event.player; import com.google.common.base.Preconditions; import com.velocitypowered.api.proxy.Player; diff --git a/api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/PreLoginEvent.java similarity index 98% rename from api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java rename to api/src/main/java/com/velocitypowered/api/event/player/PreLoginEvent.java index da027c516..9ea4be85e 100644 --- a/api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/PreLoginEvent.java @@ -1,4 +1,4 @@ -package com.velocitypowered.api.event.connection; +package com.velocitypowered.api.event.player; import com.google.common.base.Preconditions; import com.velocitypowered.api.event.ResultedEvent; diff --git a/api/src/main/java/com/velocitypowered/api/event/query/ProxyQueryEvent.java b/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyQueryEvent.java similarity index 98% rename from api/src/main/java/com/velocitypowered/api/event/query/ProxyQueryEvent.java rename to api/src/main/java/com/velocitypowered/api/event/proxy/ProxyQueryEvent.java index 721a2f74b..3fe08408e 100644 --- a/api/src/main/java/com/velocitypowered/api/event/query/ProxyQueryEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyQueryEvent.java @@ -1,4 +1,4 @@ -package com.velocitypowered.api.event.query; +package com.velocitypowered.api.event.proxy; import com.google.common.base.Preconditions; import com.velocitypowered.api.proxy.server.QueryResponse; diff --git a/api/src/main/java/com/velocitypowered/api/event/query/package-info.java b/api/src/main/java/com/velocitypowered/api/event/query/package-info.java deleted file mode 100644 index 42fb5a47f..000000000 --- a/api/src/main/java/com/velocitypowered/api/event/query/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Provides events for handling GS4 queries. - */ -package com.velocitypowered.api.event.query; \ No newline at end of file diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 911506405..750caf43e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -6,8 +6,8 @@ import static java.util.concurrent.CompletableFuture.completedFuture; import com.google.common.base.Preconditions; import com.google.gson.JsonObject; -import com.velocitypowered.api.event.connection.DisconnectEvent; -import com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus; +import com.velocitypowered.api.event.player.DisconnectEvent; +import com.velocitypowered.api.event.player.DisconnectEvent.LoginStatus; import com.velocitypowered.api.event.player.KickedFromServerEvent; import com.velocitypowered.api.event.player.KickedFromServerEvent.DisconnectPlayer; import com.velocitypowered.api.event.player.KickedFromServerEvent.Notify; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java index 86dd2ec4d..e250c2d86 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java @@ -8,12 +8,12 @@ import static com.velocitypowered.proxy.util.EncryptionUtils.decryptRsa; import static com.velocitypowered.proxy.util.EncryptionUtils.generateServerId; import com.google.common.base.Preconditions; -import com.velocitypowered.api.event.connection.DisconnectEvent; -import com.velocitypowered.api.event.connection.DisconnectEvent.LoginStatus; -import com.velocitypowered.api.event.connection.LoginEvent; -import com.velocitypowered.api.event.connection.PostLoginEvent; -import com.velocitypowered.api.event.connection.PreLoginEvent; -import com.velocitypowered.api.event.connection.PreLoginEvent.PreLoginComponentResult; +import com.velocitypowered.api.event.player.DisconnectEvent; +import com.velocitypowered.api.event.player.DisconnectEvent.LoginStatus; +import com.velocitypowered.api.event.player.LoginEvent; +import com.velocitypowered.api.event.player.PostLoginEvent; +import com.velocitypowered.api.event.player.PreLoginEvent; +import com.velocitypowered.api.event.player.PreLoginEvent.PreLoginComponentResult; import com.velocitypowered.api.event.permission.PermissionsSetupEvent; import com.velocitypowered.api.event.player.GameProfileRequestEvent; import com.velocitypowered.api.event.player.PlayerChooseInitialServerEvent; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java index b5d7f62bf..b6d0bf424 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java @@ -2,7 +2,7 @@ package com.velocitypowered.proxy.connection.client; import com.google.common.collect.ImmutableList; import com.spotify.futures.CompletableFutures; -import com.velocitypowered.api.event.proxy.ProxyPingEvent; +import com.velocitypowered.api.event.connection.ProxyPingEvent; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.InboundConnection; import com.velocitypowered.api.proxy.server.RegisteredServer; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java index 888f6ab29..c5ac5f8d9 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java @@ -1,12 +1,12 @@ package com.velocitypowered.proxy.protocol.netty; -import static com.velocitypowered.api.event.query.ProxyQueryEvent.QueryType.BASIC; -import static com.velocitypowered.api.event.query.ProxyQueryEvent.QueryType.FULL; +import static com.velocitypowered.api.event.proxy.ProxyQueryEvent.QueryType.BASIC; +import static com.velocitypowered.api.event.proxy.ProxyQueryEvent.QueryType.FULL; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.collect.ImmutableSet; -import com.velocitypowered.api.event.query.ProxyQueryEvent; +import com.velocitypowered.api.event.proxy.ProxyQueryEvent; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.plugin.PluginContainer; import com.velocitypowered.api.plugin.PluginDescription;