日本語 (Japanese) | English
- licenseが変更されました
FoliaPhantom-extra は、旧来の Bukkit / Spigot / Paper プラグインを、Folia サーバー(PaperMC のマルチスレッド対応版)で動作させるための、手動パッチ適用ユーティリティです。
このプラグインは、対象プラグインの JAR ファイルを修正し、Folia のスレッドモデルに適合しないスケジューラAPI呼び出しを、FoliaネイティブのAPI呼び出しに置き換えます。これにより、開発者が Folia 対応を施していないプラグインでも、多くの場合で動作させることが可能になります。
- バイトコード変換技術: プラグインのクラスファイルを直接解析し、
BukkitSchedulerの呼び出しを Folia のRegionSchedulerやAsyncSchedulerを使うコードに書き換えます。 plugin.ymlの自動パッチ: パッチ処理中に、対象プラグインのplugin.ymlにfolia-supported: trueフラグを自動的に追加・修正し、Folia サーバーに正式対応プラグインとして認識させます。- 幅広いスケジューラ対応:
runTask,runTaskTimerといった主要なメソッドに加え、scheduleSyncDelayedTaskなどの古いメソッドにも対応。同期・非同期タスクの両方を適切に変換します。 - 地形・ワールド生成の互換性:
ChunkGeneratorや同期的なcreateWorld呼び出しをラップし、Foliaの非同期環境で動作するように試みます。
FoliaPhantom-extra は、他のプラグインを自動的にスキャンするのではなく、指定したJARファイルを手動で修正するツールです。
- FoliaPhantom-extra の導入: Releasesページから最新版の
FoliaPhantom-extra.jarをダウンロードし、サーバーのpluginsフォルダに配置します。 - ディレクトリの生成: サーバーを一度起動します。
plugins/FoliaPhantom-extra/フォルダ内にinputとoutputという2つのディレクトリが自動で生成されます。 - パッチ対象の配置: サーバーを停止し、パッチを適用したいプラグインのJARファイルを
inputディレクトリに移動します。 - パッチの実行: 再度サーバーを起動します。
FoliaPhantom-extraはinputディレクトリ内のすべてのJARファイルを検出し、パッチ処理を実行します。 - 成果物の確認: パッチが完了したJARファイルは
outputディレクトリに保存されます。処理が成功すると、inputディレクトリ内の元のファイルは削除されます。 - プラグインの導入:
outputディレクトリからパッチ済みのJARファイルを取り出し、サーバーのメインのpluginsフォルダに配置して使用してください。
- 同期的なワールド生成のリスク:
createWorldのような、完了までに時間のかかる処理を同期的に呼び出すプラグインをラップした場合、サーバーが一時的にフリーズ(ハングアップ)する可能性があります。Foliaの設計上、これは避けられないリスクであり、Watchdogが警告を出すことがあります。 - NMS/CB依存コード: このプラグインはスケジューラや一部のワールド生成APIの互換性を解決しますが、
net.minecraft.server(NMS) やorg.bukkit.craftbukkit(CB) のコードに直接依存するプラグインの互換性までは保証しません。 - 高度なクラスローダー操作: 一部のセキュリティ系プラグインや、特殊なクラスローダー処理を行うプラグインとは競合する可能性があります。
- 100%の互換性保証ではない: このプラグインは多くのケースで有効ですが、全てのプラグインの動作を保証するものではありません。問題が発生した場合は、GitHub Issues での報告をお願いします。
FoliaPhantom-extra は、高度なバイトコードエンジニアリング技術を採用しています。
- JARの検出:
onEnableフェーズでplugins/FoliaPhantom-extra/input/ディレクトリ内のJARファイルをスキャンします。 - 出力JARの生成: パッチを適用するための出力用JARファイルを
plugins/FoliaPhantom-extra/output/内に作成します。 - バイトコード変換 (ASM): 各クラスファイル(
.class)をバイトコードレベルで解析し、以下のAPI呼び出しを発見すると、それを内部のパッチャーロジックを呼び出すコードに置き換えます。org.bukkit.scheduler.BukkitSchedulerの各種メソッドorg.bukkit.plugin.Plugin#getDefaultWorldGeneratororg.bukkit.Server#createWorld
- パッチャーの役割: 内部ロジックは、元の呼び出しに対応する Folia のAPIを呼び出します。
- スケジューラ:
RegionSchedulerやAsyncSchedulerを適切に使い分けます。 - ワールド生成:
getDefaultWorldGeneratorが返すChunkGeneratorをラッパーで包み、createWorldの呼び出しを専用のスレッドで実行してデッドロックを回避します。
- スケジューラ:
plugin.ymlのパッチ:folia-supported: trueをYAMLに追加・上書きします。- 保存: 全ての変換とパッチが完了したJARを
outputディレクトリに保存します。
- License has changed
FoliaPhantom-extra is a manual patching utility designed to run legacy Bukkit, Spigot, and Paper plugins on a Folia server (the multi-threaded version of PaperMC).
This plugin modifies a target plugin's JAR file, replacing scheduler API calls incompatible with Folia's threading model with their native Folia equivalents. This allows many plugins, even those not updated by their developers for Folia, to run successfully.
- Bytecode Transformation Technology: Directly analyzes plugin class files and rewrites
BukkitSchedulercalls to use Folia'sRegionSchedulerandAsyncScheduler. - Automatic
plugin.ymlPatching: During the patching process, it automatically adds or corrects thefolia-supported: trueflag in the target plugin'splugin.yml, ensuring it is recognized as a compliant plugin by the Folia server. - Broad Scheduler Compatibility: Supports major methods like
runTaskandrunTaskTimer, as well as legacy methods likescheduleSyncDelayedTask, properly converting both synchronous and asynchronous tasks. - Terrain & World Gen Compatibility: Attempts to wrap calls to
ChunkGeneratorand synchronouscreateWorldto work within Folia's asynchronous environment.
FoliaPhantom-extra is a tool that manually patches specified JAR files, rather than automatically scanning them.
- Install FoliaPhantom-extra: Download the latest
FoliaPhantom-extra.jarfrom the Releases page and place it in your server'spluginsfolder. - Generate Directories: Start the server once. This will automatically create two directories:
inputandoutputinside theplugins/FoliaPhantom-extra/folder. - Place Target JARs: Stop the server. Move the plugin JAR files you want to patch into the
inputdirectory. - Run the Patcher: Start the server again.
FoliaPhantom-extrawill detect all JARs in theinputdirectory and perform the patching process. - Retrieve Patched JARs: The patched JAR files will be saved to the
outputdirectory. Once a JAR is successfully processed, the original file in theinputdirectory is deleted. - Install the Patched Plugin: Take the patched JAR file from the
outputdirectory and move it to your main serverpluginsfolder for use.
- Risk of Synchronous World Generation: Wrapping a plugin that calls time-consuming methods like
createWorldsynchronously may cause the server to freeze or hang temporarily. This is an unavoidable risk due to Folia's design, and you may see warnings from the Watchdog. - NMS/CB Dependencies: While this plugin resolves scheduler and some world-generation API issues, it does not guarantee compatibility for plugins that depend directly on
net.minecraft.server(NMS) ororg.bukkit.craftbukkit(CB) code. - Advanced Class-loading: May conflict with certain security plugins or other plugins that perform complex class-loader manipulations.
- Not a 100% Guarantee: Although effective in many scenarios, this plugin does not guarantee that every plugin will work. If you encounter issues, please report them on our GitHub Issues.
FoliaPhantom-extra employs sophisticated bytecode engineering.
- JAR Detection: During the
onEnablephase, it scans for JAR files in theplugins/FoliaPhantom-extra/input/directory. - Output JAR Creation: It creates an output JAR file for patching inside
plugins/FoliaPhantom-extra/output/. - Bytecode Transformation (ASM): It parses each class file (
.class) at the bytecode level. When it finds a call to a targeted API, it replaces it with code that calls internal patcher logic. Targeted APIs include:- Methods in
org.bukkit.scheduler.BukkitScheduler org.bukkit.plugin.Plugin#getDefaultWorldGeneratororg.bukkit.Server#createWorld
- Methods in
- The Patcher's Role: The internal logic invokes the appropriate Folia-native API.
- Schedulers: It intelligently redirects calls to
RegionSchedulerorAsyncScheduler. - World Generation: It wraps the
ChunkGeneratorreturned bygetDefaultWorldGeneratorand dispatchescreateWorldcalls to a dedicated thread to prevent deadlocks.
- Schedulers: It intelligently redirects calls to
plugin.ymlPatching: It adds or overwrites the YAML file to includefolia-supported: true.- Saving: The fully transformed and patched JAR is saved to the
outputdirectory.