类 OnDatapackSyncEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.OnDatapackSyncEvent
public class OnDatapackSyncEvent
extends net.neoforged.bus.api.Event
Fires when a player joins the server or when the reload command is ran,
before tags and crafting recipes are sent to the client. Send datapack data
to clients when this event fires.
-
字段概要
字段修饰符和类型字段说明private final @Nullable ServerPlayer
private final PlayerList
private final it.unimi.dsi.fastutil.objects.ReferenceSet
<RecipeType<?>> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明@Nullable ServerPlayer
Gets the player that is joining the server, or null when syncing for all players, such as when the reload command runs.Gets the server's player list, containing all players, when the event fires.Set
<RecipeType<?>> Creates a stream of players that need to receive data during this event, which is the specified player (if present) or all players.void
sendRecipes
(Iterable<RecipeType<?>> recipeTypes) Requests that all recipes of the given types should be sent to the players.void
sendRecipes
(RecipeType<?>... recipeTypes) Requests that all recipes of the given types should be sent to the players.
-
字段详细资料
-
playerList
-
player
-
recipeTypesToSend
-
-
构造器详细资料
-
OnDatapackSyncEvent
-
-
方法详细资料
-
getPlayerList
Gets the server's player list, containing all players, when the event fires.- 返回:
- The server's player list.
-
getRelevantPlayers
Creates a stream of players that need to receive data during this event, which is the specified player (if present) or all players.- 返回:
- A stream of players to sync data to.
-
getPlayer
Gets the player that is joining the server, or null when syncing for all players, such as when the reload command runs.- 返回:
- The player to sync datapacks to. Null when syncing for all players.
-
sendRecipes
Requests that all recipes of the given types should be sent to the players.- 另请参阅:
-
sendRecipes
Requests that all recipes of the given types should be sent to the players.- 另请参阅:
-
getRecipeTypesToSend
- 返回:
- The recipe types that have already been requested to be sent to the players.
-