[{"data":1,"prerenderedAt":385},["ShallowReactive",2],{"docs-\u002Fplatforms\u002Fbukkit":3},{"id":4,"title":5,"body":6,"description":375,"extension":376,"meta":377,"navTitle":378,"navigation":379,"path":380,"rawbody":381,"seo":382,"stem":383,"__hash__":384},"docs\u002Fplatforms\u002Fbukkit.md","Bukkit \u002F Paper \u002F Folia",{"type":7,"value":8,"toc":365},"minimark",[9,14,23,42,47,72,79,114,118,128,142,146,152,155,159,165,326,330,345,352,356],[10,11,13],"h1",{"id":12},"bukkitpaper","Bukkit\u002FPaper",[15,16,17,18,22],"p",{},"Use ",[19,20,21],"code",{},"magicutils-bukkit"," to wire MagicUtils to Bukkit, Paper, and Folia.",[15,24,25,26,29,30,33,34,37,38,41],{},"If you want a shared install for multiple plugins, use\n",[19,27,28],{},"magicutils-bukkit-bundle"," as a standalone plugin and add a dependency on it\nin your ",[19,31,32],{},"plugin.yml"," (",[19,35,36],{},"depend: [MagicUtils]"," or ",[19,39,40],{},"softdepend",").",[43,44,46],"h2",{"id":45},"folia-support","Folia support",[15,48,49,51,52,59,60,63,64,67,68,71],{},[19,50,21],{}," runs on ",[53,54,58],"a",{"href":55,"rel":56},"https:\u002F\u002Fpapermc.io\u002Fsoftware\u002Ffolia",[57],"nofollow","Folia"," with no\nextra configuration. ",[19,61,62],{},"BukkitBootstrap"," detects the Folia runtime at startup and\ninstalls a region-aware platform, so ",[19,65,66],{},"runOnMain(...)"," schedules on the global\nregion and ",[19,69,70],{},"runForAudience(player, ...)"," resolves the correct entity region.\nOn regular Bukkit\u002FPaper the same calls run on the main server thread.",[15,73,74,75,78],{},"For direct control, the ",[19,76,77],{},"BukkitThreading"," helper works on both Folia and regular\nservers:",[80,81,82,89,95,105],"ul",{},[83,84,85,88],"li",{},[19,86,87],{},"BukkitThreading.isFoliaRuntime()"," reports whether Folia is active.",[83,90,91,94],{},[19,92,93],{},"runGlobal(plugin, task)"," runs on the global region (or the main thread).",[83,96,97,100,101,104],{},[19,98,99],{},"runEntity(plugin, entity, task)"," \u002F ",[19,102,103],{},"runForSender(plugin, sender, task)"," run on\nthe region that owns the entity\u002Fsender.",[83,106,107,100,110,113],{},[19,108,109],{},"isGlobalThread()",[19,111,112],{},"isOwnedByCurrentRegion(entity)"," are guards for\nregion-sensitive code.",[43,115,117],{"id":116},"recommended-bootstrap","Recommended Bootstrap",[119,120,126],"pre",{"className":121,"code":123,"language":124,"meta":125},[122],"language-java","public final class MyPlugin extends JavaPlugin {\n    private BukkitBootstrap.RuntimeResult magic;\n\n    @Override\n    public void onEnable() {\n        magic = BukkitBootstrap.forPlugin(this)\n                .enableCommands()\n                .configureCommands(registry -> registry.registerCommand(new ExampleCommand()))\n                .buildRuntime();\n    }\n\n    @Override\n    public void onDisable() {\n        if (magic != null) {\n            magic.runtime().close();\n            magic = null;\n        }\n    }\n}\n","java","",[19,127,123],{"__ignoreMap":125},[15,129,130,133,134,137,138,141],{},[19,131,132],{},"build()"," returns the legacy bootstrap view. ",[19,135,136],{},"buildRuntime()"," additionally gives\nyou a managed ",[19,139,140],{},"MagicRuntime",".",[43,143,145],{"id":144},"manual-wiring","Manual Wiring",[119,147,150],{"className":148,"code":149,"language":124,"meta":125},[122],"Platform platform = new BukkitPlatformProvider(plugin);\nConfigManager configManager = new ConfigManager(platform);\nLogger logger = new Logger(platform, plugin, configManager);\n",[19,151,149],{"__ignoreMap":125},[15,153,154],{},"Use the manual path only when you need full control over how the services are\ncreated.",[43,156,158],{"id":157},"bootstrap-options","Bootstrap Options",[15,160,161,164],{},[19,162,163],{},"BukkitBootstrap.Builder"," supports the following configuration:",[166,167,168,181],"table",{},[169,170,171],"thead",{},[172,173,174,178],"tr",{},[175,176,177],"th",{},"Method",[175,179,180],{},"Description",[182,183,184,198,212,222,232,242,252,262,272,286,296,306,316],"tbody",{},[172,185,186,192],{},[187,188,189],"td",{},[19,190,191],{},"logger(logger)",[187,193,194,195,141],{},"Bind an existing ",[19,196,197],{},"java.util.logging.Logger",[172,199,200,205],{},[187,201,202],{},[19,203,204],{},"enableCommands()",[187,206,207,208,211],{},"Create a ",[19,209,210],{},"CommandRegistry"," during bootstrap.",[172,213,214,219],{},[187,215,216],{},[19,217,218],{},"permissionPrefix(prefix)",[187,220,221],{},"Set the permission node prefix for commands.",[172,223,224,229],{},[187,225,226],{},[19,227,228],{},"configureCommands(consumer)",[187,230,231],{},"Register commands during bootstrap.",[172,233,234,239],{},[187,235,236],{},[19,237,238],{},"enableDiagnostics()",[187,240,241],{},"Enable the diagnostics service.",[172,243,244,249],{},[187,245,246],{},[19,247,248],{},"configureDiagnostics(consumer)",[187,250,251],{},"Register custom diagnostic checks.",[172,253,254,259],{},[187,255,256],{},[19,257,258],{},"initLanguage(boolean)",[187,260,261],{},"Enable\u002Fdisable language manager initialization.",[172,263,264,269],{},[187,265,266],{},[19,267,268],{},"bindLoggerLanguage(boolean)",[187,270,271],{},"Bind the language manager to the logger.",[172,273,274,279],{},[187,275,276],{},[19,277,278],{},"setMessagesManager(boolean)",[187,280,281,282,285],{},"Set the global ",[19,283,284],{},"Messages"," language manager.",[172,287,288,293],{},[187,289,290],{},[19,291,292],{},"registerMessages(boolean)",[187,294,295],{},"Register the plugin's messages scope.",[172,297,298,303],{},[187,299,300],{},[19,301,302],{},"addMagicUtilsMessages(boolean)",[187,304,305],{},"Register built-in MagicUtils messages.",[172,307,308,313],{},[187,309,310],{},[19,311,312],{},"bindClientLocaleSync(boolean)",[187,314,315],{},"Follow each player's client locale.",[172,317,318,323],{},[187,319,320],{},[19,321,322],{},"translations(consumer)",[187,324,325],{},"Configure additional translations.",[43,327,329],{"id":328},"commands","Commands",[15,331,332,335,336,338,339,342,343,141],{},[19,333,334],{},"BukkitBootstrap.enableCommands()"," creates a ",[19,337,210],{}," for the plugin.\nThe registry registers commands directly with the Bukkit ",[19,340,341],{},"CommandMap",", so you do\nnot need to declare them in ",[19,344,32],{},[15,346,347,348,351],{},"Permission nodes are resolved using the prefix passed to\n",[19,349,350],{},"permissionPrefix(...)"," or, by default, the plugin name.",[43,353,355],{"id":354},"placeholders","Placeholders",[15,357,358,359,364],{},"When ",[53,360,363],{"href":361,"rel":362},"https:\u002F\u002Fmodrinth.com\u002Fplugin\u002Fplaceholderapi",[57],"PlaceholderAPI"," is installed,\nMagicUtils placeholders can be bridged into PlaceholderAPI through the Bukkit\nintegration layer.",{"title":125,"searchDepth":366,"depth":366,"links":367},3,[368,370,371,372,373,374],{"id":45,"depth":369,"text":46},2,{"id":116,"depth":369,"text":117},{"id":144,"depth":369,"text":145},{"id":157,"depth":369,"text":158},{"id":328,"depth":369,"text":329},{"id":354,"depth":369,"text":355},"Wire MagicUtils to Bukkit, Paper, and Folia with BukkitBootstrap. Folia is auto-detected, so region-based threading works with no extra setup.","md",{},null,true,"\u002Fplatforms\u002Fbukkit","---\ntitle: Bukkit \u002F Paper \u002F Folia\ndescription: Wire MagicUtils to Bukkit, Paper, and Folia with BukkitBootstrap. Folia is auto-detected, so region-based threading works with no extra setup.\n---\n\n# Bukkit\u002FPaper\n\nUse `magicutils-bukkit` to wire MagicUtils to Bukkit, Paper, and Folia.\n\nIf you want a shared install for multiple plugins, use\n`magicutils-bukkit-bundle` as a standalone plugin and add a dependency on it\nin your `plugin.yml` (`depend: [MagicUtils]` or `softdepend`).\n\n## Folia support\n\n`magicutils-bukkit` runs on [Folia](https:\u002F\u002Fpapermc.io\u002Fsoftware\u002Ffolia) with no\nextra configuration. `BukkitBootstrap` detects the Folia runtime at startup and\ninstalls a region-aware platform, so `runOnMain(...)` schedules on the global\nregion and `runForAudience(player, ...)` resolves the correct entity region.\nOn regular Bukkit\u002FPaper the same calls run on the main server thread.\n\nFor direct control, the `BukkitThreading` helper works on both Folia and regular\nservers:\n\n- `BukkitThreading.isFoliaRuntime()` reports whether Folia is active.\n- `runGlobal(plugin, task)` runs on the global region (or the main thread).\n- `runEntity(plugin, entity, task)` \u002F `runForSender(plugin, sender, task)` run on\n  the region that owns the entity\u002Fsender.\n- `isGlobalThread()` \u002F `isOwnedByCurrentRegion(entity)` are guards for\n  region-sensitive code.\n\n## Recommended Bootstrap\n\n```java\npublic final class MyPlugin extends JavaPlugin {\n    private BukkitBootstrap.RuntimeResult magic;\n\n    @Override\n    public void onEnable() {\n        magic = BukkitBootstrap.forPlugin(this)\n                .enableCommands()\n                .configureCommands(registry -> registry.registerCommand(new ExampleCommand()))\n                .buildRuntime();\n    }\n\n    @Override\n    public void onDisable() {\n        if (magic != null) {\n            magic.runtime().close();\n            magic = null;\n        }\n    }\n}\n```\n\n`build()` returns the legacy bootstrap view. `buildRuntime()` additionally gives\nyou a managed `MagicRuntime`.\n\n## Manual Wiring\n\n```java\nPlatform platform = new BukkitPlatformProvider(plugin);\nConfigManager configManager = new ConfigManager(platform);\nLogger logger = new Logger(platform, plugin, configManager);\n```\n\nUse the manual path only when you need full control over how the services are\ncreated.\n\n## Bootstrap Options\n\n`BukkitBootstrap.Builder` supports the following configuration:\n\n| Method | Description |\n| --- | --- |\n| `logger(logger)` | Bind an existing `java.util.logging.Logger`. |\n| `enableCommands()` | Create a `CommandRegistry` during bootstrap. |\n| `permissionPrefix(prefix)` | Set the permission node prefix for commands. |\n| `configureCommands(consumer)` | Register commands during bootstrap. |\n| `enableDiagnostics()` | Enable the diagnostics service. |\n| `configureDiagnostics(consumer)` | Register custom diagnostic checks. |\n| `initLanguage(boolean)` | Enable\u002Fdisable language manager initialization. |\n| `bindLoggerLanguage(boolean)` | Bind the language manager to the logger. |\n| `setMessagesManager(boolean)` | Set the global `Messages` language manager. |\n| `registerMessages(boolean)` | Register the plugin's messages scope. |\n| `addMagicUtilsMessages(boolean)` | Register built-in MagicUtils messages. |\n| `bindClientLocaleSync(boolean)` | Follow each player's client locale. |\n| `translations(consumer)` | Configure additional translations. |\n\n## Commands\n\n`BukkitBootstrap.enableCommands()` creates a `CommandRegistry` for the plugin.\nThe registry registers commands directly with the Bukkit `CommandMap`, so you do\nnot need to declare them in `plugin.yml`.\n\nPermission nodes are resolved using the prefix passed to\n`permissionPrefix(...)` or, by default, the plugin name.\n\n## Placeholders\n\nWhen [PlaceholderAPI](https:\u002F\u002Fmodrinth.com\u002Fplugin\u002Fplaceholderapi) is installed,\nMagicUtils placeholders can be bridged into PlaceholderAPI through the Bukkit\nintegration layer.\n",{"title":5,"description":375},"platforms\u002Fbukkit","oaPt3S6Jod1k27tN-8ai1qxqlVrYZWeDxWibS2gd6kk",1783944485844]