delay scheduler task

This commit is contained in:
MidnightTale 2023-04-25 00:38:59 +07:00
commit 934cf33c6f

View file

@ -77,8 +77,13 @@ public class FoliaFlow extends JavaPlugin implements Listener {
}), 0L, 1L, TimeUnit.MILLISECONDS); }), 0L, 1L, TimeUnit.MILLISECONDS);
} catch (UnsupportedOperationException ignored) { } catch (UnsupportedOperationException ignored) {
} }
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), AsyncScheduler scheduler = getServer().getAsyncScheduler();
"summon minecraft:block_display 100.0005 48 -0.0005 {block_state:{Name:\"minecraft:obsidian\"},Tags:[\"FoliaFlow_FakeBlock\"]}");
scheduler.runDelayed(this, task -> {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "summon minecraft:block_display 100.0005 48 -0.0005 {block_state:{Name:\"minecraft:obsidian\"},Tags:[\"FoliaFlow_FakeBlock\"]}");
}, 10, TimeUnit.SECONDS);
// Register the event listener
getServer().getPluginManager().registerEvents(this, this); getServer().getPluginManager().registerEvents(this, this);
} }