Skip to content

Commit 16a3db9

Browse files
Update Lua definitions
1 parent 307b78a commit 16a3db9

File tree

34 files changed

+473
-70
lines changed

34 files changed

+473
-70
lines changed

library/paper/imports.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,6 @@
674674
---| '"io.papermc.paper.command.brigadier.CommandSourceStack"'
675675
---| '"io.papermc.paper.command.brigadier.Commands"'
676676
---| '"io.papermc.paper.command.brigadier.MessageComponentSerializer"'
677-
---| '"io.papermc.paper.command.brigadier.MessageComponentSerializerHolder"'
678677
---| '"io.papermc.paper.command.brigadier.argument.ArgumentTypes"'
679678
---| '"io.papermc.paper.command.brigadier.argument.CustomArgumentType.Converted"'
680679
---| '"io.papermc.paper.command.brigadier.argument.CustomArgumentType"'
@@ -694,6 +693,13 @@
694693
---| '"io.papermc.paper.command.brigadier.argument.resolvers.selector.PlayerSelectorArgumentResolver"'
695694
---| '"io.papermc.paper.command.brigadier.argument.resolvers.selector.SelectorArgumentResolver"'
696695
---| '"io.papermc.paper.configuration.ServerConfiguration"'
696+
---| '"io.papermc.paper.connection.PlayerCommonConnection"'
697+
---| '"io.papermc.paper.connection.PlayerConfigurationConnection"'
698+
---| '"io.papermc.paper.connection.PlayerConnection"'
699+
---| '"io.papermc.paper.connection.PlayerGameConnection"'
700+
---| '"io.papermc.paper.connection.PlayerLoginConnection"'
701+
---| '"io.papermc.paper.connection.ReadablePlayerCookieConnection"'
702+
---| '"io.papermc.paper.connection.WritablePlayerCookieConnection"'
697703
---| '"io.papermc.paper.datacomponent.BuildableDataComponent"'
698704
---| '"io.papermc.paper.datacomponent.DataComponentBuilder"'
699705
---| '"io.papermc.paper.datacomponent.DataComponentHolder"'
@@ -831,6 +837,10 @@
831837
---| '"io.papermc.paper.event.block.PlayerShearBlockEvent"'
832838
---| '"io.papermc.paper.event.block.TargetHitEvent"'
833839
---| '"io.papermc.paper.event.block.VaultChangeStateEvent"'
840+
---| '"io.papermc.paper.event.connection.PlayerConnectionValidateLoginEvent"'
841+
---| '"io.papermc.paper.event.connection.configuration.AsyncPlayerConnectionConfigureEvent"'
842+
---| '"io.papermc.paper.event.connection.configuration.PlayerConnectionInitialConfigureEvent"'
843+
---| '"io.papermc.paper.event.connection.configuration.PlayerConnectionReconfigureEvent"'
834844
---| '"io.papermc.paper.event.entity.ElderGuardianAppearanceEvent"'
835845
---| '"io.papermc.paper.event.entity.EntityAttemptSmashAttackEvent"'
836846
---| '"io.papermc.paper.event.entity.EntityCompostItemEvent"'
@@ -893,6 +903,7 @@
893903
---| '"io.papermc.paper.event.player.PlayerPickEntityEvent"'
894904
---| '"io.papermc.paper.event.player.PlayerPickItemEvent"'
895905
---| '"io.papermc.paper.event.player.PlayerPurchaseEvent"'
906+
---| '"io.papermc.paper.event.player.PlayerServerFullCheckEvent"'
896907
---| '"io.papermc.paper.event.player.PlayerShieldDisableEvent"'
897908
---| '"io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent"'
898909
---| '"io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent"'
@@ -989,6 +1000,8 @@
9891000
---| '"io.papermc.paper.registry.data.GameEventRegistryEntry.Builder"'
9901001
---| '"io.papermc.paper.registry.data.GameEventRegistryEntry"'
9911002
---| '"io.papermc.paper.registry.data.InlinedRegistryBuilderProvider"'
1003+
---| '"io.papermc.paper.registry.data.InstrumentRegistryEntry.Builder"'
1004+
---| '"io.papermc.paper.registry.data.InstrumentRegistryEntry"'
9921005
---| '"io.papermc.paper.registry.data.JukeboxSongRegistryEntry.Builder"'
9931006
---| '"io.papermc.paper.registry.data.JukeboxSongRegistryEntry"'
9941007
---| '"io.papermc.paper.registry.data.PaintingVariantRegistryEntry.Builder"'

library/paper/io.papermc.paper.command.brigadier.MessageComponentSerializerHolder.lua

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- Optional.empty
2+
---@meta
3+
-- io.papermc.paper.connection.PlayerCommonConnection
4+
---@class io.papermc.paper.connection.PlayerCommonConnection: io.papermc.paper.connection.WritablePlayerCookieConnection, io.papermc.paper.connection.ReadablePlayerCookieConnection, java.lang.Object
5+
local PlayerCommonConnection = {}
6+
7+
---@param details java.util.Map report details
8+
---@public
9+
---@return nil
10+
--- Sends data to appear in this connection's report logs. This is useful for debugging server state that may be causing player disconnects. <p> These are formatted as key - value, where keys are limited to a length of 128 characters, values are limited to 4096, and 32 maximum entries can be sent.
11+
function PlayerCommonConnection:sendReportDetails(details) end
12+
13+
---@param links org.bukkit.ServerLinks links to send
14+
---@public
15+
---@return nil
16+
--- Sends the given server links to this connection.
17+
function PlayerCommonConnection:sendLinks(links) end
18+
19+
---@param host string host
20+
---@param port number port
21+
---@public
22+
---@return nil
23+
--- Transfers this connection to another server.
24+
function PlayerCommonConnection:transfer(host, port) end
25+
26+
---@param type com.destroystokyo.paper.ClientOption client option
27+
---@public
28+
---@return T the client option value of the player
29+
function PlayerCommonConnection:getClientOption(type) end
30+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---@meta
2+
-- io.papermc.paper.connection.PlayerConfigurationConnection
3+
---@class io.papermc.paper.connection.PlayerConfigurationConnection: io.papermc.paper.connection.PlayerCommonConnection, java.lang.Object
4+
local PlayerConfigurationConnection = {}
5+
6+
---@public
7+
---@return net.kyori.adventure.audience.Audience the configuring player audience
8+
--- Returns the audience representing the player in configuration mode. This can be used to interact with the Adventure API during the configuration stage. This is guaranteed to be an instance of {@link PlayerConfigurationConnection}
9+
function PlayerConfigurationConnection:getAudience() end
10+
11+
---@public
12+
---@return com.destroystokyo.paper.profile.PlayerProfile profile
13+
--- Gets the profile for this connection.
14+
function PlayerConfigurationConnection:getProfile() end
15+
16+
---@public
17+
---@return nil
18+
--- Clears the players chat history and their local chat.
19+
function PlayerConfigurationConnection:clearChat() end
20+
21+
---@public
22+
---@return nil
23+
--- Completes the configuration for this player, which will cause this player to reenter the game. <p> Note, this should be only be called if you are reconfiguring the player.
24+
function PlayerConfigurationConnection:completeReconfiguration() end
25+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---@meta
2+
-- io.papermc.paper.connection.PlayerConnection
3+
---@class io.papermc.paper.connection.PlayerConnection: java.lang.Object
4+
local PlayerConnection = {}
5+
6+
---@param component net.kyori.adventure.text.Component disconnect reason
7+
---@public
8+
---@return nil
9+
--- Disconnects the player connection. <p> Note that calling this during connection related events may caused undefined behavior.
10+
function PlayerConnection:disconnect(component) end
11+
12+
---@public
13+
---@return boolean is transferred
14+
--- Gets if this connection originated from a transferred connection. <p> Do note that this is sent and stored on the client.
15+
function PlayerConnection:isTransferred() end
16+
17+
---@public
18+
---@return java.net.SocketAddress the remote {@link SocketAddress} of the channel
19+
--- Gets the raw remote address of the connection. This may be a proxy address or a Unix domain socket address, depending on how the channel was established.
20+
function PlayerConnection:getAddress() end
21+
22+
---@public
23+
---@return java.net.InetSocketAddress the client {@link InetSocketAddress}
24+
--- Gets the real client address of the player. If the connection is behind a proxy, this will be the actual player’s IP address extracted from the proxy handshake.
25+
function PlayerConnection:getClientAddress() end
26+
27+
---@public
28+
---@return java.net.InetSocketAddress The client's virtual host, or {@code null} if unknown
29+
--- Returns the virtual host the client is connected to. <p>The virtual host refers to the hostname/port the client used to connect to the server.</p>
30+
function PlayerConnection:getVirtualHost() end
31+
32+
---@public
33+
---@return java.net.InetSocketAddress the player's proxy address, null if the server doesn't have Proxy Protocol enabled, or the player didn't connect to an HAProxy instance
34+
--- Gets the socket address of this player's proxy
35+
function PlayerConnection:getHAProxyAddress() end
36+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---@meta
2+
-- io.papermc.paper.connection.PlayerGameConnection
3+
---@class io.papermc.paper.connection.PlayerGameConnection: io.papermc.paper.connection.PlayerCommonConnection, java.lang.Object
4+
local PlayerGameConnection = {}
5+
6+
---@public
7+
---@return nil
8+
--- Bumps the player to the configuration stage. <p> This will, by default, cause the player to stay until their connection is released by {@link PlayerConfigurationConnection#completeReconfiguration()}
9+
function PlayerGameConnection:reenterConfiguration() end
10+
11+
---@public
12+
---@return org.bukkit.entity.Player player
13+
--- Gets the player that is associated with this game connection.
14+
function PlayerGameConnection:getPlayer() end
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---@meta
2+
-- io.papermc.paper.connection.PlayerLoginConnection
3+
---@class io.papermc.paper.connection.PlayerLoginConnection: io.papermc.paper.connection.ReadablePlayerCookieConnection, java.lang.Object
4+
local PlayerLoginConnection = {}
5+
6+
---@public
7+
---@return com.destroystokyo.paper.profile.PlayerProfile authenticated profile, or null if not present
8+
--- Gets the authenticated profile for this connection. This may return null depending on what stage this connection is at.
9+
function PlayerLoginConnection:getAuthenticatedProfile() end
10+
11+
---@public
12+
---@return com.destroystokyo.paper.profile.PlayerProfile the unsafe unauthenticated profile, or null if not sent
13+
--- Gets the player profile that this connection is requesting to authenticate as.
14+
function PlayerLoginConnection:getUnsafeProfile() end
15+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---@meta
2+
-- io.papermc.paper.connection.ReadablePlayerCookieConnection
3+
---@class io.papermc.paper.connection.ReadablePlayerCookieConnection: io.papermc.paper.connection.PlayerConnection, java.lang.Object
4+
local ReadablePlayerCookieConnection = {}
5+
6+
---@param key org.bukkit.NamespacedKey the key identifying the cookie
7+
---@public
8+
---@return java.util.concurrent.CompletableFuture a {@link CompletableFuture} that will be completed when the Cookie response is received or otherwise available. If the cookie is not set in the client, the {@link CompletableFuture} will complete with a null value.
9+
--- Retrieves a cookie from this connection.
10+
function ReadablePlayerCookieConnection:retrieveCookie(key) end
11+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---@meta
2+
-- io.papermc.paper.connection.WritablePlayerCookieConnection
3+
---@class io.papermc.paper.connection.WritablePlayerCookieConnection: io.papermc.paper.connection.PlayerConnection, java.lang.Object
4+
local WritablePlayerCookieConnection = {}
5+
6+
---@param key org.bukkit.NamespacedKey the key identifying the cookie
7+
---@param value table<number> the data to store in the cookie
8+
---@public
9+
---@return nil
10+
--- Stores a cookie in this player's client.
11+
function WritablePlayerCookieConnection:storeCookie(key, value) end
12+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
--- Optional.empty
2+
---@meta
3+
-- io.papermc.paper.event.connection.PlayerConnectionValidateLoginEvent
4+
---@class io.papermc.paper.event.connection.PlayerConnectionValidateLoginEvent: org.bukkit.event.Event, java.lang.Object
5+
---@overload fun(connection: io.papermc.paper.connection.PlayerConnection, kickMessage: net.kyori.adventure.text.Component): io.papermc.paper.event.connection.PlayerConnectionValidateLoginEvent
6+
local PlayerConnectionValidateLoginEvent = {}
7+
8+
---@public
9+
---@return io.papermc.paper.connection.PlayerConnection connection
10+
--- Gets the connection of the player in this event. Note, the type of this connection is not guaranteed to be stable across versions. Additionally, disconnecting the player through this connection / using any methods that may send packets is not supported.
11+
function PlayerConnectionValidateLoginEvent:getConnection() end
12+
13+
---@public
14+
---@return nil
15+
--- Allows the player to log in. This skips any login validation checks.
16+
function PlayerConnectionValidateLoginEvent:allow() end
17+
18+
---@param message net.kyori.adventure.text.Component Kick message to display to the user
19+
---@public
20+
---@return nil
21+
--- Disallows the player from logging in, with the given reason
22+
function PlayerConnectionValidateLoginEvent:kickMessage(message) end
23+
24+
---@public
25+
---@return net.kyori.adventure.text.Component disallow reason
26+
--- Gets the reason for why a player is not allowed to join the server. This will be null in the case that the player is allowed to log in.
27+
function PlayerConnectionValidateLoginEvent:getKickMessage() end
28+
29+
---@public
30+
---@return boolean if allowed
31+
--- Gets if the player is allowed to enter the next stage.
32+
function PlayerConnectionValidateLoginEvent:isAllowed() end
33+
34+
---@public
35+
---@return org.bukkit.event.HandlerList
36+
function PlayerConnectionValidateLoginEvent:getHandlers() end
37+
38+
---@public
39+
---@return org.bukkit.event.HandlerList
40+
function PlayerConnectionValidateLoginEvent:getHandlerList() end
41+

0 commit comments

Comments
 (0)