
Thunderbolt_lib
Thunderbolt_lib is the addon API and runtime bridge library for AE2 Lightning Tech.
- Загрузки
- 163
- Подписчики
- 0
- Обновлён
- 30 мая 2026 г.
- Лицензия
- MIT
Опубликован 2 мая 2026 г.
Plugin API and runtime bridge library for AE2 Lightning Tech (AE2LT). Lets your mod integrate deeply with AE2LT's lightning energy network without ever touching its internal classes.
Thunderbolt_lib is a required dependency for any third-party plugin that extends, modifies, or hooks into AE2LT's lightning system. It ships no items, blocks, or recipes of its own — only frozen public APIs, NeoForge capability contracts, recipe builders, and a reflective runtime bridge that degrades gracefully when AE2LT itself is absent.
Why download this?
- Players / modpack authors — if a mod or modpack lists
ae2lt_apias a dependency, install this jar alongside AE2 Lightning Tech. - Plugin developers — depend on this library to access AE2LT's machines, recipe types, and lightning energy capabilities without coupling to AE2LT's internal classes.
Important: Thunderbolt_lib only does meaningful work when AE2 Lightning Tech is installed in the same Minecraft instance. Both mods must be present.
Target
| Minecraft | 1.21.1 |
| Loader | NeoForge 21.1.x |
| Java | 21 |
| Targets | AE2 Lightning Tech (backwards-compatible since AE2LT introduced its lightning network) |
| Runtime mod ID | ae2lt_api |
The project is presented as Thunderbolt_lib, but registers under ae2lt_api, so existing plugin dependency declarations are unaffected.
What it provides
Lightning energy capability
Make your blocks and items first-class citizens of the AE2LT lightning network. ILightningEnergyHandler is exposed via two NeoForge capabilities — LIGHTNING_ENERGY_BLOCK (sided) and LIGHTNING_ENERGY_ITEM (void) — implement the interface and register it to participate in reads and writes. All quantities are expressed as long, scaling cleanly from a single machine to network-wide accounting.
Lightning energy tier
A unified two-tier voltage definition that flows losslessly across API surfaces. LightningEnergyTier is a two-value enum (HIGH_VOLTAGE / EXTREME_HIGH_VOLTAGE), and ships with:
CODEC— MojangCodec<LightningEnergyTier>STREAM_CODEC— vanillaStreamCodec<RegistryFriendlyByteBuf, LightningEnergyTier>fromOrdinal(int)— ordinal-based static decoder
It shares its on-the-wire format with AE2LT's own LightningTier, so packets and NBT round-trip cleanly between the two APIs without any hand-written adapter.
Reflective runtime bridge
Won't crash when AE2LT is missing — just degrades gracefully. Instead of hard-referencing AE2LT's classes at load time, this library probes them reflectively at runtime and wires the lightning energy capability onto the five grid-connected block entities AE2LT publicly registers:
ae2lt:lightning_collectorae2lt:lightning_simulation_roomae2lt:lightning_assembly_chamberae2lt:overload_processing_factoryae2lt:tesla_coil
ae2lt:crystal_catalyzerruns on FE only, does not participate in the lightning energy network, and is intentionally excluded.
Frozen ID constants
Reference AE2LT's registry IDs without dragging its main jar onto your compile path. Two ResourceLocation constant sets collect everything in one place:
AE2LTBlockEntityIds— AE2LT's block-entity IDs, plusLIGHTNING_GRID_MEMBERS(the list of the five grid-connected machines above)AE2LTRecipeIds— AE2LT's recipe-type IDs
Both live in com.qianchang.ae2lt_api.api.ids. If AE2LT later renames any internal resource, the patch lands here so plugins don't have to chase it.
Native API detection bridge
Lets both API surfaces coexist in your mod, leaving you in control of which one to call. com.qianchang.ae2lt_api.api.bridge.AE2LTNativeBridge checks at runtime whether AE2LT's first-party API package (com.moakiee.ae2lt.api, namespace ae2lt) is loaded.
| Surface | This library | AE2LT first-party |
|---|---|---|
| Java package | com.qianchang.ae2lt_api.api.* |
com.moakiee.ae2lt.api.* |
| Namespace | ae2lt_api |
ae2lt |
| Capability ID | ae2lt_api:lightning_energy |
ae2lt:lightning_energy |
The two API surfaces are deliberately namespace-distinct; this library performs no implicit conversion between them, so callers explicitly choose which side to use.
Events
Intercept lightning collection and apply your own conditional logic. LightningCollectedEvent is fired when an AE2LT collector picks up lightning energy. The event is cancellable and exposes isNaturalWeather() (to distinguish a true thunderstorm from a machine-induced strike) along with the matching 5-argument constructor; the original 4-argument constructor is preserved with naturalWeather defaulted to false, so migration is painless.
Recipe builders
Generate schema-compliant JSON for all six AE2LT recipe types — drop them straight into your data generation pipeline:
| Builder | Recipe type |
|---|---|
LightningAssemblyRecipeBuilder |
ae2lt:lightning_assembly |
LightningTransformRecipeBuilder |
ae2lt:lightning_transform |
LightningSimulationRecipeBuilder |
ae2lt:lightning_simulation |
OverloadProcessingRecipeBuilder |
ae2lt:overload_processing |
CrystalCatalyzerRecipeBuilder |
ae2lt:crystal_catalyzer |
LightningStrikeRecipeBuilder |
ae2lt:lightning_strike |
CrystalCatalyzerRecipeBuilder additionally supports dustMode() and outputTag(...), matching AE2LT's crystal_catalyzer/dust/*.json schema.
Plugin loading & API facade
Unified registration callbacks, no hand-rolled NeoForge lifecycle wiring. Plugin discovery runs through @AE2LTPlugin, IAE2LTPlugin, and Java ServiceLoader; the static facade AE2LTAPI collects the API version, capability handles, and bridge utilities into a single entry point you can pull in with one import static and use across your codebase with minimal boilerplate.
Adding as a dependency
Plugin developers — declare both ae2lt_api (this library) and ae2lt (the main mod) as required in your neoforge.mods.toml:
[[dependencies.your_mod_id]]
modId = "ae2lt_api"
type = "required"
versionRange = "[1.0.0,)"
ordering = "AFTER"
side = "BOTH"
[[dependencies.your_mod_id]]
modId = "ae2lt"
type = "required"
versionRange = "[1.0.0,)"
ordering = "AFTER"
side = "BOTH"
Set the lower bound of versionRange to the minimum version your plugin actually supports.
Feedback
Bug reports and suggestions are welcome on the project issue tracker. When reporting an issue, please include the versions of Minecraft, NeoForge, AE2 Lightning Tech, and Thunderbolt_lib you are running — it makes reproduction and triage much faster.
Source, changelog, releases
- Source code — github.com/QianChang-official/Thunderbolt_lib
- Changelog — CHANGELOG.md
- GitHub releases (jar mirror) — all releases
Credits
Maintained and developed by QianChang.
Special thanks to the AE2 Lightning Tech team — MOAKIEE, CystrySU, gjmhmm8, _leng, TedXenon, and MHanHanBing — for publishing clear, stable registry IDs and recipe schemas that make this bridge possible.
Thanks also to the Applied Energistics 2 team — without AE2 there would be no AE2LT, and no reason for this bridge to exist.
Disclaimer
This name is used for non-commercial community purposes only. If any rights holder considers the name to be infringing or unsuitable, please contact the maintainer and it will be changed promptly.
Full notice — DISCLAIMER.md
Ченджлог
1.0.5Релиз1.21.1 · 6 мая 2026 г.
Thunderbolt_lib 1.0.5 — tracks AE2 Lightning Tech 1.0.5.
What's Changed Added Frequency-binding detection — AE2LTNativeBridge#isFrequencyBindingAvailable(), AE2LTAPI#isAE2LTFrequencyBindingAvailable(), plus AE2LTVersion constants and version gate. These let addons detect AE2LT 1.0.5's internal BE-level frequency-binding host without hard-binding to non-API symbols. Reflection cache — AE2LTReflection now memoizes findMethod/findField in ConcurrentHashMaps, eliminating repeated class-hierarchy walks on every lightning tick. Changed Version bumped to 1.0.5 across gradle.properties, API_VERSION, and target/verified constants. CHANGELOG and bilingual READMEs updated. Repository hygiene .vscode/launch.json removed from git tracking; .vscode/ added to .gitignore. Compatibility AE2LT 1.0.5 did not change its first-party public API (com.moakiee.ae2lt.api) or recipe schemas, so all recipe builders and bridge block-entity IDs remain unchanged. All existing Thunderbolt_lib 1.0.4 Java API symbols are preserved; this release is purely additive.
1.0.4Релиз1.21.1 · 4 мая 2026 г.
Summary Aligns Thunderbolt_lib with AE2 Lightning Tech 1.0.4. Adds AE2LTVersion runtime version helpers and version facade methods on AE2LTAPI. Adds capability ID helpers on AE2LTNativeBridge. Adds AE2LT first-party naming aliases on ILightningEnergyHandler and LightningEnergyTier. Updates metadata to require AE2LT [1.0.4,). Compatibility AE2LT 1.0.4 does not change the public first-party API package, recipe schemas, or bridge block-entity IDs compared with 1.0.3. Thunderbolt_lib 1.0.4 keeps existing 1.0.3 API symbols and adds only conservative helper interfaces, apart from the tighter AE2LT runtime dependency range.
Verification ./gradlew.bat clean build Built asset: Thunderbolt_lib-1.0.4.jar
1.0.3Релиз1.21.1 · 4 мая 2026 г.
Tracks AE2 Lightning Tech 1.0.3. Purely additive — every 1.0.2 API symbol and behavior is preserved, so existing plugins recompile unchanged.
Added
- Frozen ID constants —
com.qianchang.ae2lt_api.api.ids.AE2LTBlockEntityIds(six AE2LT block-entity IDs plusLIGHTNING_GRID_MEMBERS, the five grid-connected machines) andAE2LTRecipeIds(six recipe-type IDs). Plugins can now reference AE2LT registry IDs without compiling against AE2LT's main jar. - Native API detection bridge —
com.qianchang.ae2lt_api.api.bridge.AE2LTNativeBridgeprobes at runtime whether AE2LT's own first-party API (com.moakiee.ae2lt.api, namespaceae2lt) is loaded. The two API surfaces stay namespace-distinct; this library does not perform implicit conversion between them. LightningEnergyTier.CODEC(MojangCodec) andLightningEnergyTier.STREAM_CODEC(vanillaStreamCodec<RegistryFriendlyByteBuf, _>) — wire-format-compatible with AE2LT's ownLightningTier, so packet and NBT data round-trip cleanly between the two APIs.LightningEnergyTier.fromOrdinal(int)— static ordinal decoder for packet round-trips.LightningCollectedEvent.isNaturalWeather()plus a matching 5-argument constructor.
Changed
mod_versionandAE2LTCapabilities.API_VERSIONbumped to 1.0.3.AE2LTLightningCollectorEventBridgenow propagates the natural-weather flag through toLightningCollectedEvent.AE2LTCapabilitiesJavadoc clarifies the deliberate namespace split between this library (ae2lt_api:lightning_energy) and AE2LT's own first-party capability (ae2lt:lightning_energy).
Compatibility
- All 1.0.2 public signatures, serialization names, capability IDs, and recipe IDs are preserved.
LightningCollectedEvent's 4-argument constructor still works and defaultsnaturalWeathertofalse.- Migration: bump the dependency version coordinate — no source changes required.
Full diff: CHANGELOG.md
1.0.2Релиз1.21.1 · 2 мая 2026 г.
跟进 AE2LT 1.0.2 发布版本号
Changed Bumped mod_version and AE2LTCapabilities.API_VERSION to track the AE2LT 1.0.2 release line. No functional changes from 1.0.1; jar contents are byte-identical apart from the version strings. Compatibility Minecraft 1.21.1 / NeoForge 21.1.x / Java 21 Runtime mod id: ae2lt_api(保持向后兼容) 与上游 AE2-Lightning-Tech 1.0.0+ 兼容(已按 1.0.2 配方 Schema 对齐) 完整变更说明详见 CHANGELOG.md。
1.0.1Релиз1.21.1 · 2 мая 2026 г.
Thunderbolt_lib 1.0.1 按 AE2LT 1.0.2 配方 Schema 对齐 API。本次承载所有实际 API/桥接修正,与 1.0.2 内容完全一致(后者仅版本号变更)。
Added CrystalCatalyzerRecipeBuilder.outputTag(String tagId, int count) for tag-resolved output stacks. CrystalCatalyzerRecipeBuilder.mode(String) and dustMode() to opt into AE2LT's dust catalyzer mode. CrystalCatalyzerRecipeBuilder.MODE_DUST constant. Changed AE2LTReflection.BRIDGED_BLOCK_ENTITY_IDS corrected to the five grid-connected machines AE2LT 1.0.2 publicly registers LIGHTNING_ENERGY_BLOCK on: ae2lt:lightning_collector ae2lt:lightning_simulation_room ae2lt:lightning_assembly_chamber ae2lt:overload_processing_factory ae2lt:tesla_coil AE2LTCapabilities Javadoc refreshed to match the 5-BE bridge list. Removed ae2lt:crystal_catalyzer removed from the lightning-energy bridge list. Crystal Catalyzer runs on FE only and is not part of the AE2LT lightning-energy network. Compatibility Minecraft 1.21.1 / NeoForge 21.1.x / Java 21 Runtime mod id: ae2lt_api(保持向后兼容) 旧依赖 ae2lt_api 1.0.0 的 addon 升级到 1.0.1 后应继续兼容(API 表面无破坏性变更) 完整变更说明详见 CHANGELOG.md。
1.0.0Релиз1.21.1 · 2 мая 2026 г.
Thunderbolt_lib v1.0.0 release.
This release only covers changes added after v0.3.2-snapshot. The older builder hotfixes and serialization fixes from v0.3.2-snapshot are intentionally not repeated here.
Changes in this release:
aligned the framework version with AE2 Lightning Tech 1.0.0 renamed the published artifact to Thunderbolt_lib-1.0.0.jar renamed the project/repository display name to Thunderbolt_lib kept the runtime mod_id as ae2lt_api to avoid breaking existing addon dependencies and capability lookups added a runtime compatibility bridge that exposes AE2LT lightning-connected machines through ILightningEnergyHandler bridged the following AE2LT block entities: lightning_collector, lightning_simulation_room, lightning_assembly_chamber, overload_processing_factory, tesla_coil, crystal_catalyzer made LightningCollectedEvent fire around collector insertion so addons can modify or cancel HV/EHV collection before it enters the ME lightning network added LightningStrikeRecipeBuilder for ae2lt:lightning_strike added AE2LTRecipeTypes to centralize current AE2LT recipe ids expanded AE2LTAPI with item capability access helpers in addition to block helpers refreshed README / README_zh_CN / project comparison documentation for the current 1.0.0 API surface added a non-commercial naming disclaimer stating that the project name will be changed promptly if any rights holder requests it Asset:
Thunderbolt_lib-1.0.0.jar
Комментарии
Загружаем…