mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-15 20:51:34 +01:00
Renamed scheduledCallback to spawnCallback
This commit is contained in:
parent
fbff3a6b0b
commit
487e7a097c
@ -32,19 +32,19 @@ public class FakePlayer extends Player {
|
|||||||
/**
|
/**
|
||||||
* Inits a new {@link FakePlayer}.
|
* Inits a new {@link FakePlayer}.
|
||||||
*
|
*
|
||||||
* @param uuid the FakePlayer uuid
|
* @param uuid the FakePlayer uuid
|
||||||
* @param username the FakePlayer username
|
* @param username the FakePlayer username
|
||||||
* @param scheduledCallback the optional callback called when the fake player first spawn
|
* @param spawnCallback the optional callback called when the fake player first spawn
|
||||||
*/
|
*/
|
||||||
public static void initPlayer(@NotNull UUID uuid, @NotNull String username,
|
public static void initPlayer(@NotNull UUID uuid, @NotNull String username,
|
||||||
@NotNull FakePlayerOption option, @Nullable Consumer<FakePlayer> scheduledCallback) {
|
@NotNull FakePlayerOption option, @Nullable Consumer<FakePlayer> spawnCallback) {
|
||||||
final FakePlayer fakePlayer = new FakePlayer(uuid, username, option);
|
final FakePlayer fakePlayer = new FakePlayer(uuid, username, option);
|
||||||
|
|
||||||
if (scheduledCallback != null) {
|
if (spawnCallback != null) {
|
||||||
fakePlayer.addEventCallback(PlayerSpawnEvent.class,
|
fakePlayer.addEventCallback(PlayerSpawnEvent.class,
|
||||||
event -> {
|
event -> {
|
||||||
if (event.isFirstSpawn()) {
|
if (event.isFirstSpawn()) {
|
||||||
scheduledCallback.accept(fakePlayer);
|
spawnCallback.accept(fakePlayer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -53,12 +53,12 @@ public class FakePlayer extends Player {
|
|||||||
/**
|
/**
|
||||||
* Inits a new {@link FakePlayer} without adding it in cache.
|
* Inits a new {@link FakePlayer} without adding it in cache.
|
||||||
*
|
*
|
||||||
* @param uuid the FakePlayer uuid
|
* @param uuid the FakePlayer uuid
|
||||||
* @param username the FakePlayer username
|
* @param username the FakePlayer username
|
||||||
* @param scheduledCallback the optional callback called when the fake player first spawn
|
* @param spawnCallback the optional callback called when the fake player first spawn
|
||||||
*/
|
*/
|
||||||
public static void initPlayer(@NotNull UUID uuid, @NotNull String username, @Nullable Consumer<FakePlayer> scheduledCallback) {
|
public static void initPlayer(@NotNull UUID uuid, @NotNull String username, @Nullable Consumer<FakePlayer> spawnCallback) {
|
||||||
initPlayer(uuid, username, new FakePlayerOption(), scheduledCallback);
|
initPlayer(uuid, username, new FakePlayerOption(), spawnCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user