mirror of https://github.com/Minestom/Minestom.git
Replaced TaskBuilder#buildTask to TaskBuilder#schedule
This commit is contained in:
parent
4c77c99442
commit
336d040cd4
|
@ -54,7 +54,7 @@ public class Main {
|
|||
MinecraftServer.getBenchmarkManager().enable(new UpdateOption(10 * 1000, TimeUnit.MILLISECOND));
|
||||
|
||||
|
||||
MinecraftServer.getSchedulerManager().buildShutdownTask(() -> System.out.println("Good night")).buildTask();
|
||||
MinecraftServer.getSchedulerManager().buildShutdownTask(() -> System.out.println("Good night")).schedule();
|
||||
|
||||
PlayerInit.init();
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class PlayerInit {
|
|||
ColoredText footer = ColoredText.of(benchmarkMessage);
|
||||
player.sendHeaderFooter(header, footer);
|
||||
}
|
||||
}).repeat(10, TimeUnit.TICK).buildTask();
|
||||
}).repeat(10, TimeUnit.TICK).schedule();
|
||||
|
||||
connectionManager.onPacketReceive((player, packetController, packet) -> {
|
||||
// Listen to all received packet
|
||||
|
|
|
@ -6,7 +6,6 @@ import net.minestom.server.event.player.PlayerLoginEvent;
|
|||
import net.minestom.server.network.player.FakePlayerConnection;
|
||||
import net.minestom.server.network.player.PlayerConnection;
|
||||
import net.minestom.server.utils.time.TimeUnit;
|
||||
import net.minestom.server.utils.time.UpdateOption;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -42,7 +41,7 @@ public class FakePlayer extends Player {
|
|||
final FakePlayer fakePlayer = new FakePlayer(uuid, username, option);
|
||||
|
||||
fakePlayer.addEventCallback(PlayerLoginEvent.class, event -> {
|
||||
MinecraftServer.getSchedulerManager().buildTask(() -> scheduledCallback.accept(fakePlayer)).delay(1, TimeUnit.TICK).buildTask();
|
||||
MinecraftServer.getSchedulerManager().buildTask(() -> scheduledCallback.accept(fakePlayer)).delay(1, TimeUnit.TICK).schedule();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -77,7 +76,7 @@ public class FakePlayer extends Player {
|
|||
super.showPlayer(connection);
|
||||
if (!option.isInTabList()) {
|
||||
// Remove from tab-list
|
||||
MinecraftServer.getSchedulerManager().buildTask(() -> connection.sendPacket(getRemovePlayerToList())).delay(20, TimeUnit.TICK).buildTask();
|
||||
MinecraftServer.getSchedulerManager().buildTask(() -> connection.sendPacket(getRemovePlayerToList())).delay(20, TimeUnit.TICK).schedule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import net.minestom.server.utils.chunk.ChunkUtils;
|
|||
import net.minestom.server.utils.player.PlayerUtils;
|
||||
import net.minestom.server.utils.thread.MinestomThread;
|
||||
import net.minestom.server.utils.time.TimeUnit;
|
||||
import net.minestom.server.utils.time.UpdateOption;
|
||||
import net.minestom.server.utils.validate.Check;
|
||||
import net.minestom.server.world.DimensionType;
|
||||
|
||||
|
@ -580,7 +579,7 @@ public class InstanceContainer extends Instance {
|
|||
return;
|
||||
}
|
||||
currentBlock.scheduledUpdate(instance, position, getBlockData(position));
|
||||
}).delay(time, unit).buildTask();
|
||||
}).delay(time, unit).schedule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -88,11 +88,11 @@ public class TaskBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* Builds this task for execution
|
||||
* Schedule this task for execution
|
||||
*
|
||||
* @return the built task
|
||||
*/
|
||||
public Task buildTask() {
|
||||
public Task schedule() {
|
||||
Task task = new Task(
|
||||
this.schedulerManager,
|
||||
this.runnable,
|
||||
|
|
Loading…
Reference in New Issue