This commit is contained in:
tanyaofei 2024-07-28 23:18:34 +08:00
parent 338663f6eb
commit 554aa9f4d3
4 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.utils.EntityUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.devtools.core.utils.task.Tasks;
import io.github.hello09x.devtools.core.utils.task.SchedulerUtils;
import io.github.hello09x.fakeplayer.api.event.FakePlayerSpawnEvent;
import io.github.hello09x.fakeplayer.api.spi.Action;
import io.github.hello09x.fakeplayer.api.spi.NMSBridge;
@ -122,7 +122,7 @@ public class FakePlayer {
var locale = TranslatorUtils.getLocale(creator);
var address = ipGen.next();
this.player.setMetadata(FakePlayerStatus.METADATA_KEY, new FixedMetadataValue(Main.getInstance(), FakePlayerStatus.SPAWNING));
return Tasks
return SchedulerUtils
.runTaskAsynchronously(Main.getInstance(), () -> {
var event = this.callPreLoginEvent(address);
if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
@ -133,7 +133,7 @@ public class FakePlayer {
));
}
})
.thenComposeAsync(nul -> Tasks.runTask(Main.getInstance(), () -> {
.thenComposeAsync(nul -> SchedulerUtils.runTask(Main.getInstance(), () -> {
{
var event = this.callLoginEvent(address);
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED && config.getPreventKicking().ordinal() < PreventKicking.ON_SPAWNING.ordinal()) {

View File

@ -92,7 +92,7 @@ public class FakeplayerListener implements Listener {
}
}
case ALWAYS -> {
if (!ComponentUtils.asString(event.reason()).startsWith("[fakeplayer]")) {
if (!ComponentUtils.toString(event.reason()).startsWith("[fakeplayer]")) {
event.setCancelled(true);
log.warning(String.format(
"Canceled kicking fake player '%s' due to your configuration",

View File

@ -23,7 +23,7 @@ public abstract class AbstractInvsee implements Invsee {
return;
}
view.setTitle(ComponentUtils.asString(translator.translate(
view.setTitle(ComponentUtils.toString(translator.translate(
"fakeplayer.manager.inventory.title",
null,
Placeholder.component("name", text(owner.getName()))

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.core.util;
import com.destroystokyo.paper.profile.PlayerProfile;
import io.github.hello09x.devtools.core.utils.task.Tasks;
import io.github.hello09x.devtools.core.utils.task.SchedulerUtils;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@ -41,7 +41,7 @@ public class Skins {
var profile = from.getPlayerProfile();
return CompletableFuture
.supplyAsync(profile::complete)
.thenComposeAsync(completed -> Tasks.runTask(plugin, () -> {
.thenComposeAsync(completed -> SchedulerUtils.runTask(plugin, () -> {
if (!completed) {
return false;
}