Previous: ../02-ๆไธปๆๅ/่ฏๆญไธๆ้.mdใยทใNext: ็ฉๅ็ฑปๆไปถ.md Related: ็ฉๅ็ฑปๆไปถ.md ยท ๆนๅๆจกๅไฝ็ฉ.md ยท ็ปๆตๆไปถ.md ยท ../02-ๆไธปๆๅ/็ฉๅๆบๅผ็จ.md
๐งฉ External Plugin Integration ยท Overview โ
QinhCoreLib (QCL) can cooperate with a large set of third-party plugins on the server: it lets items from other plugins be referenced uniformly by QI/GUI/CustomBlock/API, and lets capabilities like blocks, models, crops, and economy be reused directly. This page explains the design philosophy of the integration, how to confirm it's connected, and provides a master matrix of all plugins. Per-plugin details are spread across three sub-pages.
๐ Design philosophy: soft dependency + reflection bridge, skip if not installed โ
QCL follows the same set of rules for integration with all third-party plugins, which can be summed up in three sentences:
| Principle | Meaning |
|---|---|
| Soft dependency (softdepend) | QCL does not hard-depend on any third-party plugin. It starts up normally even if none are installed, and never reports "missing dependency" and refuses to load. |
| Reflection bridge | QCL does not import third-party plugin classes at compile time; instead it calls them at runtime via reflection. This way, even if the other plugin isn't installed or has changed versions, QCL itself won't crash because it "can't find a class". |
| Degrade rather than crash | When the corresponding plugin isn't installed, the bridge's isAvailable() returns false, and each capability method returns null / false. The caller gets an empty result and treats it as "that item source is unavailable", rather than throwing an exception and blowing up the server. |
๐ก In one sentence: installed = automatically connected, not installed = silently skipped. You don't need to delete config or change anything just because "I haven't installed some plugin".
๐ When is a bridge probed? โ
Each bridge probes once when its corresponding module loads (detecting whether the target class exists and whether the key methods can be reflected). On a successful probe, it is registered as hookedBridge in the startup summary and written into the BridgeStatusRegistry.
# In the startup summary you'll see "hooked bridge" entries like these
hookedBridge: MMOItems
hookedBridge: CraftEngine
hookedBridge: Vault๐ How to confirm it's connected โ
After installing the third-party plugin and restarting the server, one command confirms it:
/qcl status detailThis detailed status lists the integration situation bridge by bridge, read from the BridgeStatusRegistry. You should pay attention to:
| What you want to confirm | Where to look |
|---|---|
| Whether a given bridge is available | The isAvailable status on that bridge's row |
| Whether MythicMobs is connecting to the modern or legacy version | The bindMode in that bridge's diagnostics (dual binding, detailed on the items page below) |
| Which economy backend was actually chosen | The economy-related row + the economy.default-provider config |
โ ๏ธ If you've installed a plugin but its bridge still shows as unavailable in
/qcl status detail:
- Confirm the third-party plugin itself loaded successfully first (check its own startup log).
- Confirm the plugin version didn't drastically change class names โ the reflection bridge does its best for multi-version compatibility, but in extreme cases the probe can still fail.
- Reload with
/qcl reloadand check again (a reload refreshes the external item modules).
๐บ๏ธ Master matrix of all plugins โ
The table below covers all third-party plugins QCL currently integrates with โ item types, block/model/crop types, and economy types.
๐ Items (provide item-fetching capability, paired with unified item source references) โ
| Plugin | Bridge class | Reference prefix | Main capability |
|---|---|---|---|
| MMOItems | MMOItemsBridge | mi-type-id | Fetch item by "type + id" |
| NeigeItems | NeigeItemsBridge | ni-id | Fetch item by id |
| MythicMobs | MythicMobsBridge | mm-id | Fetch item by id (amount optional) |
| MagicGem | MagicGemBridge | mg-id | Fetch gem item, check whether a gem exists |
| CustomFishing | CustomFishingBridge | cf-id | Build item (amount optional) |
| ItemsAdder | ItemsAdderBridge | ia-namespace_id | Build item stack |
| Nexo | NexoBridge | nx-id | Build item stack |
| CraftEngine | CraftEngineBridge | ce-namespace_id | Build item + block/furniture (see blocks page) |
| QinhItems | internal QinhItemsItemSource | qi:id | Reflect QinhItemRegistry.create(id, amount) |
These bridges let the corresponding items be referenced by QI / GUI / CustomBlock / API through the unified reference syntax. For per-plugin details see ๐ ็ฉๅ็ฑปๆไปถ.md.
๐งฑ Blocks / models / crops โ
| Plugin | Bridge class | Purpose |
|---|---|---|
| CraftEngine | CraftEngineBridge / CraftEngineManager | Custom items / block-placement recognition / furniture-placement recognition |
| (abstraction layer) | CustomBlockBridge + CustomBlockProvider | A unified "custom block" abstraction, with a built-in CraftEngine provider |
| ModelEngine | ModelEngineBridge / Manager | Modeled entities, playing animations, bone item-holding |
| CustomCrops | CustomCropsBridge / Manager | Crop recognition / harvest / planting / growth / bone meal |
For details see ๐ ๆนๅๆจกๅไฝ็ฉ.md.
๐ฐ Economy โ
| Backend | provider id | Currency model | Implementation |
|---|---|---|---|
| Vault | vault | Single currency | Obtained via service registration |
| ExcellentEconomy | excellenteconomy (ee) | Multiple currencies | Reflection API |
| PlayerPoints | playerpoints (pp) | Single point currency (integer) | Reflection API |
All managed uniformly by
EconomyBridge, which registers the "installed and enabled" backends in order. For details see ๐ ็ปๆตๆไปถ.md.
๐งฐ The shared compatibility base: ReflectionBridge โ
All bridges achieve "multi-version compatibility, no crash on missing class" thanks to a common underlying set of reflection utilities:
ReflectionBridge:isClassAvailable(className)โ determines whether a given class exists in the current runtime environment (the first step of a bridge probe).ReflectionCache: caches method/field lookups to avoid repeated reflection overhead, providing utilities likegetClazz/getMethod/getDeclaredMethod/findMethodByName/getField/findFieldInHierarchy/invoke/invokeStatic/get/set/safeCall.
Precisely because of this wrapper layer, a bridge can still find the correct method signature when "different major versions of the same plugin have different class names". For the developer-side details see ../04-ๅผๅ่ /ๅทฅๅ ท้.md.
โ Standard procedure for integrating a third-party plugin โ
- Install the third-party plugin normally (confirm it can load on its own).
- Restart the server (or start QCL first, then
/qcl reload). - Run
/qcl status detail, and confirm the corresponding bridge'sisAvailableis true and that there's ahookedBridgeentry in the startup summary. - Items: go to ็ฉๅๆบๅผ็จ.md and try referencing with the corresponding prefix; blocks/models/crops: see the corresponding page; economy: configure
economy.default-providerthen verify via a GUI economy action or the API.
๐ Continue reading โ
- ๐ ็ฉๅ็ฑปๆไปถ.md โ detailed walkthrough of the nine item bridges, reference prefixes, and examples.
- ๐งฑ ๆนๅๆจกๅไฝ็ฉ.md โ CraftEngine / ModelEngine / CustomCrops.
- ๐ฐ ็ปๆตๆไปถ.md โ comparison of the three backends, auto source selection, config setup.
- ๐ ../02-ๆไธปๆๅ/็ฉๅๆบๅผ็จ.md โ overview of the unified item source reference syntax.
- ๐ง ../04-ๅผๅ่ /ๅทฅๅ ท้.md โ ReflectionBridge / ReflectionCache developer API.