Compare commits

..

306 Commits

Author SHA1 Message Date
TinyYana 49e92a5c41 新增繁體中文版README、CONTRIBUTING、設定語系檔;及日文版貢獻指南
Co-authored-by: corn323 <wingsky34@gmail.com>
2026-08-10 20:19:58 +08:00
Bacteriawa a9f3c2c291 Fix PCA sync protocol for async portal transfers #166
Update the PCA sync protocol patch to use getHandleRaw() instead of getHandle() when syncing entities to clients. This ensures proper ownership checking when the owner is a destination-world clone being restored during an async portal transfer.
2026-08-10 18:09:24 +08:00
Helvetica Volubi c619486da9 fix: fix bot spawn problem 2026-08-09 03:24:54 +08:00
dependabot[bot] 5cd355881a [ci skip]Bump actions/setup-java from 5.6.0 to 5.7.0 (#171)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.6.0 to 5.7.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v5.6.0...v5.7.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-08 16:23:04 +08:00
Bacteriawa 5a28a619b7 Make RegionizedWorldData.connections public
Change the connections field in RegionizedWorldData from private to public (ReferenceList<Connection>) and add a comment indicating it's exposed for BotList access. The change is in the 0112 patch file; related patch index updates are included in subsequent feature patch files.
2026-08-08 02:04:59 +08:00
Bacteriawa 9b5f3e1bd9 Update Folia 2026-08-08 01:51:27 +08:00
Helvetica Volubi 132ee404d4 refactor: rename compatibility helper classes for clarity 2026-08-05 00:56:21 +08:00
Helvetica Volubi 0e10a8e8b0 merge patches 2026-08-05 00:49:01 +08:00
Helvetica Volubi 24e68fb203 fix typo 2026-08-05 00:42:33 +08:00
Helvetica Volubi 141c226294 Replace fast compressor with high compressor in buffered linear format 2026-08-05 00:26:22 +08:00
Helvetica Volubi 1049012aff chore: simplify code 2026-08-03 02:25:33 +08:00
Helvetica Volubi 302825cc7e feat: optimize RegionizedTaskQueue TTL and reduce ticket operations in nether portal searching 2026-08-01 16:38:23 +08:00
dependabot[bot] d806e4a423 [ci skip]Bump actions/setup-java from 5 to 5.6.0 (#168)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5 to 5.6.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v5...v5.6.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-01 16:13:12 +08:00
Helvetica Volubi 952c4321d9 fix: fix up BotList 2026-07-31 01:07:56 +08:00
Helvetica Volubi dd7ef6701a feat: update fakeplayer code from Leaves 2026-07-30 02:13:08 +08:00
Helvetica Volubi 43036f971c feat: update Entity tick and removal limiter 2026-07-30 00:58:37 +08:00
Helvetica Volubi 25ce58c40d fix: fix folia nether portal ticket placement 2026-07-28 21:23:43 +08:00
Helvetica Volubi 106f1edb09 set release to stable cannel 2026-07-28 15:38:35 +08:00
Helvetica Volubi eea830188f update some optimizations from upstream 2026-07-28 15:37:41 +08:00
Helvetica Volubi f517cc0b8a feat: update b_linear format from upstream
Because of some reasons, this patch will be anonymous and hide the original commit address.
2026-07-28 02:03:00 +08:00
Helvetica Volubi d90c8567d3 [ci skip] simplify code 2026-07-28 01:29:59 +08:00
Helvetica Volubi 78b3a8a6e7 [ci skip] Use ComfreyWeight instead of HyacinthusWeight 2026-07-27 03:43:02 +08:00
Helvetica Volubi 2f93769135 [ci skip] Use ComfreyWeight instead of HyacinthusWeight 2026-07-27 03:32:49 +08:00
Helvetica Volubi 4e277ad91e [ci skip] Update clip version 2026-07-27 01:17:13 +08:00
Helvetica Volubi 1620687dba [ci skip] fix typo 2026-07-26 19:09:05 +08:00
Bacteriawa 7b7eb911c9 Update Folia 2026-07-26 17:16:36 +08:00
Helvetica Volubi 0724ba3fa9 fix: bind packetListenerImpl to Connection when place new photographer (#160) 2026-07-26 01:38:29 +08:00
Helvetica Volubi e6d6562f4f update zh_cn.json 2026-07-26 00:45:33 +08:00
Helvetica Volubi 580201740e fix: update references and add additional launch parameters in documentation 2026-07-25 21:33:59 +08:00
Helvetica Volubi d54b248f27 fix: fix I18n in config comments 2026-07-25 19:45:01 +08:00
Helvetica Volubi 11b0b05a93 [ci skip]fix workflow & fix typo 2026-07-25 19:21:42 +08:00
Helvetica Volubi 7db058ef56 feat: add zh_cn config comment support & update en_us
Co-authored-by: flowingsun <rain_wyc@outlook.com>
2026-07-25 16:52:23 +08:00
Helvetica Volubi 019adaf46f fix: replace NullPlugin with MinecraftInternalPlugin in delayed task scheduling 2026-07-25 14:08:35 +08:00
Helvetica Volubi 6f55ed7e8e [ci skip]fix: update contribution guidelines for clarity on file submission 2026-07-25 13:17:02 +08:00
Helvetica Volubi 12c58f69b3 [ci skip]docs: add localized comment support instructions for configuration entries 2026-07-25 02:17:06 +08:00
Helvetica Volubi 0fd3b32108 fix: fix typo 2026-07-24 22:58:05 +08:00
Helvetica Volubi b8f43b47e6 resort comments in json 2026-07-24 22:16:25 +08:00
Helvetica Volubi 5f718d45a1 pre update for config comment I18n support 2026-07-24 20:34:55 +08:00
Helvetica Volubi 1cbb19d9e4 fix a losing api 2026-07-24 01:52:18 +08:00
Helvetica Volubi 4339b5e8a6 [ci skip] fix typo 2026-07-23 01:29:34 +08:00
Helvetica Volubi bcbc0685b2 [ci skip] update more information 2026-07-23 00:48:51 +08:00
Helvetica Volubi c9bfe55ce4 introduce 26.1.2 changes
Fakeplayer Action Gui - Stage 1 (#161)

Still needs some tweaks to fit Leaves' changes

* pre add gui (not implemented)

* fallback one change in Actions

* pre for new structure of gui register

* Enhance GUI node structure with item support and command handling

* feat: update GUI node handling in bot actions

* feat: enhance command building logic in GUI nodes

* fix a bug

* feat: implement GUI navigation and command execution in BotAction GUI

* feat: refactor GuiNode and related classes to use Item instead of ItemStack

* feat: update command building logic to include additional action parameters

* feat: simplify command syntax in BotAction GUI and update inventory view handling

* feat: add ActionType enum and implement action confirmation in BotAction GUI

* feat: enhance ActionType handling and selection in BotAction GUI

* feat: integrate GUI data handling in bot actions and enhance navigation

* fix up

* because of tmp move to new org, rebrand

* Implement pagination for bot action GUI and enhance action stop functionality

* ci updates

* replace boarder item

* fix https://github.com/LophineCraft/Lophine/pull/161#issuecomment-5012127501 issues - 1

* fix https://github.com/LophineCraft/Lophine/pull/161#issuecomment-5012127501 issues - 2

* fix index

* replace some items

* feat: use the same item shown for stop & start action

* remove 2 todos, we wouldn't provide them

* refactor: simplify rendering methods in BotActionGuiContainer

* feat: add empty action placeholder and simplify item rendering

* fix: remove extra suggestions

* fix: update GUI icons for jump, move, and swap actions

* fix: update comment in open action gui

* set release mode to true

---------

Co-authored-by: xiaoxijun <A3167717663@hotmail.com>
2026-07-23 00:23:03 +08:00
Helvetica Volubi 04bedd5dfc [ci skip] update some information 2026-07-22 01:31:07 +08:00
Helvetica Volubi 4cc1be5faa [ci skip] do not show luminol anymore because we are starting hard fork 2026-07-22 00:15:57 +08:00
Helvetica Volubi 9c00870696 [ci skip] fix docs 2026-07-20 03:15:35 +08:00
Helvetica Volubi e988b087a6 fix: fallback night-config version to fix config save problem 2026-07-19 17:37:19 +08:00
Helvetica Volubi 4d60979f75 merge data command related patches 2026-07-19 02:06:25 +08:00
Helvetica Volubi c8b50d84a9 2 patches from EarthMe - Camellia
Co-authored-by: MrHua269 <mrhua269@gmail.com>
2026-07-18 02:00:06 +08:00
Helvetica Volubi 6744e2c6d5 merge some patches 2026-07-18 01:46:03 +08:00
Helvetica Volubi 0678cc6e46 Start hard-fork from Luminol 2026-07-18 01:27:14 +08:00
Helvetica Volubi f4aea025c1 [ci skip] some info update 2026-07-12 21:35:51 +08:00
Helvetica Volubi 847fec5cb0 [ci skip] fix ci for update 2026-07-12 16:22:59 +08:00
Helvetica Volubi 576d2322ee [ci skip] ci updates 2026-07-11 01:21:56 +08:00
Helvetica Volubi 917b2cf3d9 fix: some fix for bot action
fix stop command could stop all the same type of action when a stop action called

fix some typo in command reply
2026-07-11 01:03:57 +08:00
Helvetica Volubi 6309c478be [ci skip] because of tmp move to new org, rebrand 2026-07-10 00:06:51 +08:00
Helvetica Volubi 012ea4f5b5 fix bot & replay api 2026-07-07 00:52:11 +08:00
Helvetica Volubi 377c81f26f fix bot command register 2026-07-06 20:24:48 +08:00
Helvetica Volubi 91e00f34ff Update Luminol to fix some bugs 2026-07-06 01:25:07 +08:00
Helvetica Volubi ac51af2fbc Update Luminol
Replace MenthaMC Maven repo with Bacteriawa

Update Maven repository URL from https://repo.menthamc.org/... to https://repo.bacteriawa.com/... across project files. Changes include README.md and README_EN.md (repository id changed to "repository" and URL updated), build.gradle.kts (rename menthaMavenPublicUrl to bacteriawaMavenPublicUrl and switch repository used for dependencies and publishing, update publishing repo name), luminol-server/build.gradle.kts.patch (use bacteriawaMavenPublicUrl), and settings.gradle.kts (add new Maven URL). This centralizes the project to use the Bacteriawa Maven host for dependency resolution and publishing.

Origin Commit: https://github.com/LuminolMC/Luminol/commit/ba28403ff6d15da3cf8b1af9828bbd1f997a7b9e

Co-authored-by: Bacteriawa <a3167717663@hotmail.com>
2026-07-05 22:07:45 +08:00
Helvetica Volubi 6df2e43b80 Update Luminol 2026-07-03 06:03:06 +08:00
Helvetica Volubi a62cc74f09 [ci skip]push repo 2026-07-02 20:01:53 +08:00
Helvetica Volubi f703bda607 Merge 26.1.2 changes to 26.2 branch 2026-07-02 19:40:42 +08:00
Helvetica Volubi 8a7b605fa6 feat: old leader zombie health logic
close https://github.com/LuminolMC/Lophine/issues/157
2026-07-02 19:40:42 +08:00
xiaoxijun 9f2f53001a #154 (#155)
* Add PCA sync protocol support

Introduce PCA sync protocol and integrate it into Carpet/Leaves.

- Added org/leavesmc/leaves/protocol/PcaSyncProtocol.java: full implementation of the PCA sync protocol (handlers for sync requests, watcher maps, update payloads, player/block watch management, scheduling, and config-driven behavior).
- Added fun/bm/lophine/config/modules/function/protocol/PcaSyncProtocolConfig.java and enum PcaPlayerEntityType.java to drive enabling and player-entity sync policy.
- Integrated protocol into Carpet: register new carpet rules (pcaSyncProtocol, pcaSyncPlayerEntity) in CarpetCompatSync and added batching to avoid excessive updates when rules change.
- Enhanced CarpetServerProtocol to track active players, batch rule updates, and send server rule data safely on the server thread.
- Added a Minecraft patch (0046-PCA-sync-protocol.patch) to trigger syncs from setChanged() in containers, chest boats, minecarts and BlockEntity updates so watched clients receive entity/block-entity updates.

This enables PCA clients to watch and receive synchronized block-entity and entity state on demand, while keeping updates gated by config and player permissions and improving rule-update performance via batching.

* Add Vanilla-like experience config and updates

Introduce a new VanillaLikeExperienceConfig module and a patch (0047) that gates multiple Paper/Luminol behavior changes behind this toggle to restore more vanilla-like technical behavior when enabled. The patch injects conditional checks across many server classes (entity merging, phantoms, pistons, hoppers, TNT handling, explosions, portal/piston protections, item merging, teleportation, spawn counting, etc.). Also adjust PCA sync protocol references in the existing 0046 patch to use the updated fun.bm.lophine package path. Includes the new fun.bm.lophine.config.modules.fixes.VanillaLikeExperienceConfig.java file.

* Restore vanilla ender pearl loading on Folia

Add patch (features/0048) that restores vanilla ender-pearl loading behavior on Folia. Reintroduces ender-pearl tracking and persistence: ServerPlayer now uses a thread-safe enderPearls set and saves pearl tags, ThrownEnderpearl maintains a lastSavedEnderPearlTag (updated on construction, owner changes, spawn and restore) and updates/clears it on tick/removal, and EnderpearlItem updates the saved tag when spawning a pearl. PlayerList and BotList now schedule pearl removal via the Bukkit taskScheduler when players/bots quit. The changes preserve Paper's legacyEnderPearlBehavior checks where applicable and add logging and safer tag handling to avoid saving invalid snapshots.

* Restore vanilla ender pearl loading

Restore vanilla ender-pearl loading behavior on Folia by preserving the last saved NBT for thrown pearls. ThrownEnderpearl.java: add a volatile CompoundTag lastSavedEnderPearlTag, provide a defensive-copying getter getLastSavedEnderPearlTag(), adjust @Nullable annotation placement, and update logger/comment. Minor index/format updates in ServerPlayer.java, PlayerList.java and EnderpearlItem.java.

* remove extra import

* Add Precise mob cap and adjust ender pearl patch

Introduce a Precise mob cap feature and integrate it into Paper/Folia world/region lifecycle. Adds new patch features/0049-Precise-mob-cap.patch which modifies RegionizedWorldData, ServerChunkCache and ServerLevel to support an incremental, event-driven mob counting system that can supersede the existing GlobalEntitiesCounter. Adds PreciseMobCapConfig (toggle and behavior flags) and PreciseMobCapCounter (unique id management, area map registration, per-level global counters, spawnable-chunk tracking, spawn state creation, and cleanup on unload). Also updates the existing 0048 ender-pearl loading patch file (minor import/index adjustments). The Precise mob cap counts only relevant mobs (configurable to match vanilla or Paper-optimized behavior), hooks into entity tracking start/end, and requires per-player-mob-spawns=false to be set in Paper world defaults when enabled.

* remove extra import

* pre merge config

* transform config

* merge config

* rebuild patches

* fix a bug in new counter

* simplify code

---------

Co-authored-by: Helvetica Volubi <suisuroru@blue-millennium.fun>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2026-07-02 19:40:42 +08:00
Helvetica Volubi f98781b7cc [ci skip]allow to push repo
we will trigger ci later
2026-07-02 17:55:45 +08:00
Helvetica Volubi 3251e0d8e0 Update Luminol 2026-07-01 23:27:02 +08:00
Helvetica Volubi 03dddb546d try update to 26.2 2026-06-29 21:38:11 +08:00
Helvetica Volubi 37c22202ab [ci skip] oops 2026-06-28 04:18:47 +08:00
Helvetica Volubi 2e67f978ec Update Luminol 2026-06-28 03:16:11 +08:00
Helvetica Volubi ed2f464914 fixup build 2026-06-25 18:12:18 +08:00
Helvetica Volubi 1cd09226f6 fixes #152 2026-06-25 17:49:55 +08:00
Helvetica Volubi 8cd8f4fbad Update Luminol 2026-06-25 17:48:52 +08:00
Bacteriawa e90c758a01 Lophine: add configs and update-suppression guards
Add Lophine-specific configuration support (global and carpet configs) and a temporary config transform step during init. Introduce config-controlled command registrations (function, scoreboard, trigger, tick) and enable tick-rate/command tweaks and an entity raytracing tracker flag. Fix datapack command save/listing behavior. Integrate Leaves update-suppression handling broadly: catch and convert update-suppression exceptions across packet handling, ticking, neighbor updates, block state updates and more; add configurable shulker CCE behavior and redstone upward-update compatibility. Provide an option to reintroduce an InstantNeighborUpdater (instant block updater) and other small compatibility/rebrand adjustments.
2026-06-23 01:35:57 +08:00
Helvetica Volubi e508462093 Update Luminol 2026-06-23 00:37:42 +08:00
dependabot[bot] b9c68a9b84 [ci skip]Bump actions/checkout from 6 to 7 (#153)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-20 16:36:49 +08:00
Helvetica Volubi 74d0b5ca5f Update Luminol & remove a unused config 2026-06-19 23:28:39 +08:00
Helvetica Volubi 4df4d07ae9 Merge the duplicate configuration items (#151)
* do not release & push repo before finished

* langs update

* updateSuppression config moved up

* redirect tick command option to carpet config system

* optimizedDragonRespawn

* diff in files

* counter rules transformed

* oops!

* some fakeplayer options moved up

* simplify

* creative no clip moved

* pre remove core module

* pre update luminol to further fix a bug that config not saved to real file

* fix up transform

* fix up transform

* fix up

* fix up some problem in PR

* redirect forgotten moved config

* fix bugs in PR

* refix

* switch for final merge
2026-06-15 20:27:41 +08:00
Helvetica Volubi cfc73efc9a Update Luminol 2026-06-14 18:43:18 +08:00
Helvetica Volubi 0989bcaec7 [ci skip]refactor: convert AbstractConcurrentTable to interface and update ConcurrentTable implementation 2026-06-13 01:19:56 +08:00
Helvetica Volubi 3763d0b885 Update clip & weight 2026-06-10 03:20:21 +08:00
Roberta001 cd3db4ae8c Fix bot connection region crash (#149)
* Fix: bot connection causing region crash, fix readme

* Fix NPE on Region Shutdown with bots

* simple fix up

* Revert "Fix NPE on Region Shutdown with bots"

This reverts commit b55c982cb9.

* Revert "fix: fix a bug in server shutdown with fakeplayer"

This reverts commit a721c27e96.

* fix: improve bot shutdown handling to prevent region crashes

---------

Co-authored-by: Helvetica Volubi <suisuroru@blue-millennium.fun>
2026-06-09 16:17:13 +08:00
Bacteriawa 11e9760eb3 Add validation and safety checks across protocols
Harden NBT/packet handling and add defensive checks across multiple protocols and utilities.

- ServerBot: Improved create-state NBT parsing, fill legacy fallbacks, validate skin list entries, and guard loading of saved actions/configs with try/catch and logged warnings.
- LeavesProtocolManager: Treat malformed payloads as rejected (INVALID_PAYLOAD), avoid throwing on decode failures, add safe bytebuf invocation with logging, and a selector description helper.
- REIServerProtocol: Enforce tag types and presence, validate indices and slot bounds, and improve error messages for malformed REI data.
- LitematicaSchematic: Validate schematic metadata (non-empty regions, palette), check region sizes and limit volume to a maximum, and avoid silent failures.
- ServuxLitematicsProtocol: Wrap Litematica paste handling in try/catch, notify player on invalid data, and log warnings.
- LitematicaBitArray: Validate array size/backing storage, prevent oversized backing arrays, and add index bounds checks.
- LitematicaBlockStatePalette: Improve error messaging for invalid palette entries.
- SchematicPlacement: Validate required tags (Schematics/Origin/SubRegion positions), use safe enum-by-ordinal lookup, and guard against null vanilla boxes when streaming chunk positions.
- CommunicationManager: Validate ordinals for rotation/mirror, limit sub-region modification counts, and catch/reject malformed Syncmatica packets with logging.

Overall this commit improves robustness by validating inputs, avoiding unhandled runtime exceptions from malformed or malicious data, and adding informative logs for rejected payloads.
2026-06-09 02:24:45 +08:00
Helvetica Volubi 13c5bd7331 Update Luminol to fix endportal teleport problem 2026-06-07 15:36:24 +08:00
Helvetica Volubi bbcc103643 Update Luminol 2026-06-06 22:10:57 +08:00
Helvetica Volubi a721c27e96 fix: fix a bug in server shutdown with fakeplayer 2026-06-06 04:48:38 +08:00
Helvetica Volubi 09011f05e6 Update Luminol 2026-06-05 16:31:04 +08:00
Helvetica Volubi b8692e23d2 [ci skip]remove some import in patches 2026-06-04 14:56:05 +08:00
Helvetica Volubi 1bb1811027 Add trigger command unsafe support 2026-06-04 01:02:14 +08:00
Helvetica Volubi a4936582bb [ci skip] switch to release
because of no code update, we will start release next commit
2026-06-04 00:53:49 +08:00
Helvetica Volubi fc760a047f port: port 1.21.11 changes, fix some bugs in lagFree (https://github.com/LuminolMC/Lophine/issues/145)
Origin Commit: 311fd32acb
2026-06-03 20:19:26 +08:00
Helvetica Volubi 5567b194d7 update file's sign & add update suppression event to Leaves Features Manager 2026-06-03 13:57:27 +08:00
Helvetica Volubi f6f2781237 enabled forgotten config sync 2026-06-03 13:25:28 +08:00
Bacteriawa f469ad848b Add MiniTweaks mob fire/explosion rules
Add a MiniTweaks patch that adjusts mob explosion and fire behavior and expose new config flags.

- Add patch file features/0043-MiniTweaks-mob-fire-and-explosion-rules.patch updating Creeper, LargeFireball and SmallFireball logic to consult config flags when deciding whether explosions break blocks or create fire.
- Add four new config options to GeneralCompatConfig: noCreeperBlockBreaking, noGhastBlockBreaking, disableBlazeFire, disableGhastFire.

These changes allow disabling creeper/ghast block breaking and suppressing blaze/ghast-caused fire while preserving existing explosion event handling.
2026-06-03 13:22:25 +08:00
Bacteriawa 924ab75f1d Remove Carpet features patches and protocols
Delete Carpet integration: remove luminol and minecraft Carpet feature patch files (1todos/server/luminol-patches/features/0006-Carpet-features.patch and 1todos/server/minecraft-patches/features/0044-Carpet-features.patch) and remove related protocol implementations (1todos/server/src/lophine/protocol/CarpetLoggerProtocol.java and 1todos/server/src/lophine/protocol/tiscm/TISCMProtocol.java). These files contained the Carpet feature backport/compat patches and protocol helpers; removing them cleans up the obsolete Carpet-specific changes.
2026-06-03 13:22:25 +08:00
Bacteriawa 1b2f577e42 Add Carpet features, update Leaves patches
Register a new lophine_carpet config and add Carpet feature patches and protocol classes. Adds luminol and minecraft Carpet feature patches, plus CarpetLoggerProtocol and TISCMProtocol Java files. Updates many Leaves-related patch files (metadata and authors/dates) and applies Leaves behaviour changes across numerous block classes (onRemove handling, affectNeighborsAfterRemoval wiring, Containers.dropContentsOnDestroy, etc.) to preserve pre-1.21.1 behaviour and compatibility. These changes enable Carpet integration and ensure Leaves patches are consistently applied across the codebase.
2026-06-03 13:22:24 +08:00
Helvetica Volubi 76c504e86f add new option for push repo (#148)
* ci test push repo - false

* ci test push repo - true

* ci test push repo - auto

* set to correct value
2026-06-03 01:55:40 +08:00
Helvetica Volubi 7ada14e6b6 Update Luminol 2026-06-03 00:56:30 +08:00
Helvetica Volubi 24965b48c5 old block behavior re-patched 2026-06-03 00:33:11 +08:00
Bacteriawa 5dab6a557b Add redstone & crash-fix configs; fix exception
Add RedStoneConfig (EXPERIMENT) with toggles for redstone update behaviors, CCE usage, instant block updater, and old block removal; add UpdateSuppressionCrashFixConfig (FIXES) to enable crash prevention. Fix UpdateSuppressionException: provideLevel and provideBlock now assign their fields only when those fields are currently null, ensuring the first-provided context is preserved and preventing unintended overwrites.
2026-06-02 22:59:40 +08:00
Bacteriawa e27300d2c2 Add Leaves update-suppression & redstone patches
Flip release flag to 0 and add multiple Leaves-related minecraft patches. These patches add broad UpdateSuppressionException handling (providing player/level/block context and consuming exceptions) across packet processing, ticking, entity events, chunk updates and redstone logic to avoid crashes and lost drops. Also add CCE-safe redstone handling, an opt-in redstone "ignore upwards" update, instant block updater selection, revert TrapDoorBlock Paper changes, preserve item drops when breaking blocks, and avoid resetting placed blocks on exception / suppressing block-entity crashes. Patches rely on config flags (e.g. UpdateSuppressionCrashFixConfig and RedStoneConfig) and introduce new patch files under lophine-server/minecraft-patches/features.
2026-06-02 20:56:23 +08:00
Helvetica Volubi cd665f0168 [ci skip] update clip 2026-05-26 22:40:41 +08:00
Helvetica Volubi aa07ef21ca Update Luminol 2026-05-26 01:25:35 +08:00
Helvetica Volubi d50ad73a17 global entities counter applied 2026-05-21 16:46:53 +08:00
Helvetica Volubi 0d794003bc Update Luminol 2026-05-21 14:45:32 +08:00
Helvetica Volubi 3856196543 Start Pre-release 26.1.2
some patches still not applied, need further update
2026-05-17 05:37:52 +08:00
Helvetica Volubi eff43b61ff fake player patches applied 2026-05-17 04:24:05 +08:00
Helvetica Volubi 06514362b8 protocols update
patches 28/44
2026-05-17 03:29:22 +08:00
Helvetica Volubi 5b94c79f39 patches 22/44 2026-05-17 02:46:52 +08:00
Helvetica Volubi 24a315a368 fix up ci 2026-05-11 11:30:05 +08:00
Helvetica Volubi 3d54e47c5e more patches - stage 16/44 2026-05-11 11:12:58 +08:00
Helvetica Volubi 6aadb1ca19 update Luminol 2026-05-11 10:27:28 +08:00
Helvetica Volubi 0a4a6baf70 update Luminol 2026-05-07 14:36:44 +08:00
Helvetica Volubi ee36fab64c apply patch: Leaves - Item overstack util 2026-05-04 22:44:14 +08:00
Helvetica Volubi e85db692f3 Update Luminol 2026-05-04 17:04:01 +08:00
Helvetica Volubi 9635e516dd more patches - stage 12/44 2026-05-04 00:57:49 +08:00
Helvetica Volubi d7e1b3a6bb more patches - stage 8/44 2026-05-04 00:20:54 +08:00
Helvetica Volubi 0fc9a1426d apply more patches 2026-05-03 16:45:10 +08:00
Helvetica Volubi 017e49da8a apply some patches 2026-05-03 00:30:08 +08:00
M2ke4U 42d870e32b Updated upstream & Ported some leaves patches & Fixed issues in gitignore
Signed-off-by: MrHua269 <mrhua269@gmail.com>
2026-05-02 23:09:13 +08:00
Helvetica Volubi 54ff033ef6 fix: fix up ci 2026-05-02 01:46:03 +08:00
Helvetica Volubi 9761fde77d baseline of 26.1.2
WARNING: no patch merged, we will start merge later

there are to many update between 1.21.11 and 26.1.2, so we need more time to build a base version which can stable to use
2026-05-02 00:46:03 +08:00
Helvetica Volubi e0d42cb1d3 Update Luminol 2026-05-01 23:12:36 +08:00
xiaoyueyoqwq 559b2e089a Fix Syncmatica modifier cleanup (#141)
Co-authored-by: xiaoyueyoqwq <xiaoyueyoqwq@users.noreply.github.com>
2026-05-01 23:07:35 +08:00
Helvetica Volubi a07649d14d [ci skip]update code from Leaves to fix some bug 2026-05-01 23:06:47 +08:00
Helvetica Volubi 6aa709cf75 [ci skip] fixup ci 2026-04-22 18:30:09 +08:00
Helvetica Volubi 6a452799cc feat: add full blocking load option for localized language support 2026-04-22 13:26:54 +08:00
Helvetica Volubi e17a3f2033 perf: some perform update && update Gradle wrapper to version 9.4.1 2026-04-22 01:40:07 +08:00
Helvetica Volubi 74ac0bccf5 fix: fix some function is not covered by core config 2026-04-14 00:41:54 +08:00
xiaoxijun f65b7f176b Carpet features (#134)
* Carpet features

* refactor(config): move up config

* refactor file

diff in file system

* Update Luminol

* move up - stage 1

* Revert "Update Luminol"

This reverts commit 6f02993bfe.

* move up - stage 2

* new carpet features

* upload docs

* stage - pre update

* [ci skip]Update Luminol

only update for dev branch, so skip ci

* remove blank

* feat:add carpet core config & move some function to config load stage

* remove some unused value & logic

* fix up

* Update Luminol

* fix up

* remove imports update

* add warning to carpet system if it is enabled

* Update Luminol

* use new function to sync config

* oops!

* Update Luminol

* fix up a bug

* refactor

* Update Luminol

* move up directory

* Update Luminol

* oops!

* refactor need

* feat: add CoreConfig to enable general rules in CarpetCompatSync

* modify some default value

* fix: enhance HUD logger subscriptions and improve player data handling

---------

Co-authored-by: Helvetica Volubi <suisuroru@blue-millennium.fun>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2026-04-13 19:45:35 +08:00
Helvetica Volubi 97a17dbf78 fix: update Luminol plugin versions in build configuration 2026-04-13 18:35:25 +08:00
Bacteriawa c5194eeb8f Update Luminol 2026-04-11 03:40:59 +08:00
Helvetica Volubi 58c5573421 fix: fix some crash problem 2026-04-08 09:49:45 +08:00
Helvetica Volubi 1907a41329 perf: some perform update for global entities counter 2026-04-08 09:15:55 +08:00
Helvetica Volubi 21cce73216 fix GlobalEntitiesCounter again 2026-04-07 20:25:57 +08:00
Helvetica Volubi 163a9902cc fix: fix mob despawn when player is away from all the player 2026-04-02 18:38:19 +08:00
Helvetica Volubi ba1216d4d3 Update Luminol 2026-03-30 00:08:27 +08:00
dependabot[bot] beb5cbeb52 [ci skip]Bump gradle/actions from 5 to 6 (#135)
Bumps [gradle/actions](https://github.com/gradle/actions) from 5 to 6.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v5...v6)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-28 18:41:16 +08:00
Helvetica Volubi 5cc4371833 Update Luminol 2026-03-26 08:50:42 +08:00
Helvetica Volubi 35f1e58d4d [ci skip]Update Luminol
only update for dev branch, so skip ci
2026-03-22 15:14:15 +08:00
Helvetica Volubi 690d7c2785 Update Luminol 2026-03-21 21:56:12 +08:00
Helvetica Volubi 115c9f8ee8 fix: try to fix a bug in syncmatica protocol 2026-03-19 19:00:17 +08:00
Helvetica Volubi faa3529943 feat: split timeout options to config file 2026-03-19 18:39:37 +08:00
Helvetica Volubi 3c3a2a6ff4 [ci skip] fixup 2026-03-16 18:09:49 +08:00
Helvetica Volubi 25776c7200 Update Luminol
我去,这个怎么没提交上
2026-03-16 16:39:26 +08:00
Helvetica Volubi 74e9d146e3 Update Luminol & adapt auto update system 2026-03-16 16:08:58 +08:00
Helvetica Volubi a8b2972e0e [ci skip] fix up a config transform flag 2026-03-14 01:38:42 +08:00
xiaoxijun ed3063a477 [ci skip]Update gradle.properties 2026-03-10 23:40:16 +08:00
Helvetica Volubi 85d2fa3372 feat: add Leaves' Creative Fly No Clip feature
fix #16
2026-03-09 00:13:34 +08:00
Helvetica Volubi b22e9e588b Update Luminol 2026-03-08 00:20:08 +08:00
Helvetica Volubi 90b751da5a Update Luminol 2026-03-03 20:55:18 +08:00
dependabot[bot] 7efeb48a7e [ci skip]Bump actions/upload-artifact from 6 to 7 (#133)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 16:29:34 +08:00
Helvetica Volubi e5cc20ba9b Update Luminol 2026-02-23 21:23:49 +08:00
Helvetica Volubi 46e7abe59c Update Luminol 2026-02-18 00:25:23 +08:00
Helvetica Volubi 40df6b9dfb Switch to release cannel
Update Luminol
2026-02-13 21:14:41 +08:00
Bacteriawa 5559fa8bcc Update Luminol 2026-02-13 16:21:55 +08:00
Helvetica Volubi 6319ddf78f [ci skip]update qodana (#131)
* qodana update test

use community version

* fix: update bug-report.yml and qodana.yaml for improved configuration clarity

* chore: configure Git user details for CI environment

* [ci skip]fix: update linter image in qodana.yaml to use community version

* fix: update linter and action versions to use latest releases

* Revert "chore: configure Git user details for CI environment"

This reverts commit e53b12ac49.

* fix: update qodana.yaml to exclude all files instead of just JavaFiles

* Revert "qodana update test"

This reverts commit 4aac78cb72.

* [ci skip]fix: update .gitignore and qodana.yaml for project structure changes
2026-02-08 01:20:10 +08:00
Bacteriawa e74300a756 Fix Server crash when using CCE #109 2026-02-08 00:02:31 +08:00
Bacteriawa d9674b4e7c Update Luminol 2026-02-07 23:20:40 +08:00
Helvetica Volubi 6d02f00ac0 Update Luminol to fix #127
fixes #127
2026-01-30 19:47:50 +08:00
Helvetica Volubi 2960e7d24f perf: add cache for replay api 2026-01-28 22:45:50 +08:00
Helvetica Volubi d950c6d3e8 Update Luminol 2026-01-26 23:48:23 +08:00
Helvetica Volubi 357c351b95 fix up version fetcher 2026-01-22 00:59:08 +08:00
Helvetica Volubi a780b13fcc Update Luminol 2026-01-21 21:37:37 +08:00
Helvetica Volubi cf80fc6a86 Update Luminol 2026-01-18 03:31:10 +08:00
Helvetica Volubi 20acc9ccf5 feat: add save-all support 2026-01-16 02:41:01 +08:00
Helvetica Volubi e49ab25111 simply fix for replay api
fixed https://github.com/MC-XiaoHei/ISeeYou/issues/70
2026-01-14 01:57:42 +08:00
Helvetica Volubi eed4457419 add removed check before all checks start in addEffects 2026-01-13 21:06:48 +08:00
Helvetica Volubi 429a0345d9 refactor(bot): delay some logic of extra load in fakeplayer spawn 2026-01-13 20:47:55 +08:00
Helvetica Volubi 670d4e39c9 Update Luminol 2026-01-13 19:30:32 +08:00
Helvetica Volubi 5d4ddb9a6b fix #124 (refix of #121) 2026-01-09 19:10:28 +08:00
Helvetica Volubi 0ad90dc36e Update Luminol 2026-01-07 17:13:18 +08:00
Helvetica Volubi 284810dfb8 fixes #121 2026-01-04 17:51:09 +08:00
Helvetica Volubi 0f67f445b9 Update Luminol 2026-01-04 12:32:42 +08:00
Helvetica Volubi 018cc61204 Update Luminol 2026-01-03 13:59:49 +08:00
Helvetica Volubi b9c3d8deea fix ender dragon caused server crash 2026-01-03 01:40:35 +08:00
Helvetica Volubi 0d5b289d65 Update Luminol 2026-01-03 01:04:31 +08:00
Helvetica Volubi 5b20ad2e2c Update Luminol 2025-12-29 23:39:50 +08:00
Helvetica Volubi 9fcce731d0 Update Luminol 2025-12-29 01:28:30 +08:00
Helvetica Volubi 0783c97224 Update Protocols from Leaves 2025-12-28 00:29:37 +08:00
Helvetica Volubi 300e891906 Update Luminol 2025-12-27 23:42:13 +08:00
Helvetica Volubi a3e0a3ee1a Update Wool Counter & FakePlayer code from Leaves 2025-12-27 20:39:17 +08:00
Helvetica Volubi b3703e2069 fix a bug in way point 2025-12-27 20:36:30 +08:00
Helvetica Volubi d3c8da4edb Update Luminol 2025-12-27 17:16:52 +08:00
Helvetica Volubi bed0bfff06 fix: refix waypoint
related issue: https://github.com/LuminolMC/Lophine/issues/110
2025-12-26 03:38:04 +08:00
Helvetica Volubi 238231b28b Update Luminol 2025-12-26 03:28:41 +08:00
Helvetica Volubi db772aaf62 fix: fix waypoint module 2025-12-23 10:07:28 +08:00
Helvetica Volubi b1bee59e6c Update Luminol 2025-12-23 10:06:50 +08:00
Helvetica Volubi a9d24bd32c Update Luminol 2025-12-21 01:31:40 +08:00
dependabot[bot] f299d5188d [ciskip]build(deps): bump JetBrains/qodana-action from 2025.2 to 2025.3 (#108)
Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2025.2 to 2025.3.
- [Release notes](https://github.com/jetbrains/qodana-action/releases)
- [Commits](https://github.com/jetbrains/qodana-action/compare/v2025.2...v2025.3)

---
updated-dependencies:
- dependency-name: JetBrains/qodana-action
  dependency-version: '2025.3'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-21 01:30:55 +08:00
Helvetica Volubi bbcc85fa93 1.21.11 Early Access
waypoint has force disabled because of some serious bug
2025-12-18 09:42:25 +08:00
Helvetica Volubi c26d8d1ee3 [ci skip]before we start to update to 1.21.11, we need push to maven repo 2025-12-18 03:43:04 +08:00
Helvetica Volubi 7bc12d2487 fix: add null check in RegionizedWorldData >> conections
some of our function patches will crash because of get null in conn.getPlayer(), then when we process player.chunkPosition() will get NPE, so we need to fix it.
2025-12-17 00:26:36 +08:00
dependabot[bot] 2c3aa4b68e [ci skip]build(deps): bump actions/upload-artifact from 5 to 6 (#106)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 15:44:44 +08:00
Bacteriawa 91312b7a15 Update Luminol 2025-12-14 00:18:07 +08:00
Helvetica Volubi 77c412bfe8 feat: update concurrent in waypoint 2025-12-11 02:05:57 +08:00
Helvetica Volubi c06d875df7 feat: add optimized concurrent table for waypoint management 2025-12-10 15:22:58 +08:00
Helvetica Volubi 5e96851513 fix a bug in entities counter 2025-12-10 02:52:55 +08:00
Helvetica Volubi 91b3ad527c fix waypoint manager
we use thread safe method to load it
2025-12-10 01:49:10 +08:00
dependabot[bot] 959a1c346c [ci skip]build(deps): bump actions/checkout from 3 to 6 (#102)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-08 15:51:58 +08:00
Helvetica Volubi b594382a6a [ci skip] fixup ci 2025-12-07 19:06:04 +08:00
Helvetica Volubi 37f1b4e5f1 fix: fix some async bugs 2025-12-07 18:42:46 +08:00
mrhua269 af2af944bf Fix issues of photographer with folia region threading 2025-12-06 23:25:37 +08:00
mrhua269 54688d8e34 Fix issues of fakeplayer with folia region threading 2025-12-06 22:35:51 +08:00
Helvetica Volubi 7b7f0b6d1f [ci skip] fix up branch in qodana 2025-12-06 21:58:02 +08:00
Helvetica Volubi 0ab3983145 Update Luminol
We need to check folia-supported,so we update it now
2025-12-06 16:52:56 +08:00
Helvetica Volubi 24a9d5cea8 fix https://github.com/MC-XiaoHei/ISeeYou/issues/68#issuecomment-3619619509 2025-12-06 15:45:34 +08:00
Helvetica Volubi 8ee77c3354 [ci skip] remove unused check
we have checked in protocol manager
2025-12-06 15:45:12 +08:00
qodana-cloud[bot] 98df254bad [ci skip]Add qodana CI checks (#100)
* Add qodana.yaml file

* Add github workflow file

---------

Co-authored-by: Qodana Application <qodana-support@jetbrains.com>
2025-12-04 14:19:47 +08:00
Helvetica Volubi 19f001ad1b [ci skip] remove unused data 2025-12-04 14:05:46 +08:00
Helvetica Volubi 106dfeaa38 fix: fix global entity count max limit problem 2025-12-04 13:37:48 +08:00
Helvetica Volubi 403ae2b2d0 feat: chunkCount 2025-12-04 12:13:14 +08:00
Helvetica Volubi 96c99519d5 fix: fix an async bug
if latest task is not done, skip this tick so that we can not block thread and run the task have not done, after it done, the new data will be processed in the next tick
2025-12-03 20:33:13 +08:00
Helvetica Volubi 5c4031b836 [ci skip] fixup template & comment 2025-12-03 20:20:59 +08:00
Helvetica Volubi 376857ff97 feat: global entities counter
We provided a new way to use entities counter to spawn mobs, maybe have some bugs, so we set this to experiment config

 - Update file update
 - Update Luminol
2025-12-03 16:31:34 +08:00
Helvetica Volubi fa1ab90579 fix a ConcurrentModificationException caused by ServuxStructuresProtocol
Update Luminol
2025-11-30 15:53:28 +08:00
Creeam fc9c6937b6 Add LeavesConfig dummy class (#99)
For some plugin detections
2025-11-30 07:28:01 +00:00
Helvetica Volubi 12d8ba9050 Update Luminol 2025-11-29 06:03:01 +08:00
Helvetica Volubi 38a1ce0443 fix: fix crash caused by uncheck data access 2025-11-26 22:32:20 +08:00
dependabot[bot] a5a415e495 build(deps): bump actions/checkout from 5 to 6 (#93)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 08:21:49 +00:00
Helvetica Volubi b7bf1b5916 Update Luminol 2025-11-24 00:16:50 +08:00
Helvetica Volubi 4a8888c578 try fixes bugs caused by Bukkit.getScheduler().runTaskLater
we use (FoliaGlobalRegionScheduler.GlobalScheduledTask) Bukkit.getGlobalRegionScheduler().runDelayed to instead of Bukkit.getScheduler().runTaskLater, and we also provided a brand-new way to cancel task by task id
2025-11-22 01:57:16 +08:00
Helvetica Volubi 2c59a32afe [ci skip] Update context 2025-11-20 15:36:46 +08:00
Helvetica Volubi cc5382977d Update Luminol 2025-11-20 15:32:41 +08:00
xiaoxijun c07dde1c0b feat: CCE Update Suppression support and other dependences (#84)
add cce update suppression & prevent crashes caused by update suppres & dustTrapdoorReintroduced & instantBlockUpdater & old Block remove behaviour & do not reset placed block on exception & do not prevent block entity and entity crash at LevelChunk (#84)

* add cce update suppression & prevent crashes caused by update suppression

* no need for this transformed flag

* Add Redstone ignore upwards update

* fix up license

* move config

* instant Block Updater

* feat: Update Suppression!

* Leaves: Do not reset placed block on exception & Do not prevent block entity and entity crash at LevelChunk

---------

Co-authored-by: Helvetica Volubi <suisuroru@blue-millennium.fun>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2025-11-19 00:04:34 +08:00
Helvetica Volubi 871a003a2e Update Luminol to fix open-gui bug 2025-11-17 17:54:27 +08:00
Helvetica Volubi d6a981a6e9 [ci skip] skip release and push in unexpect branch
See https://github.com/LuminolMC/Luminol/commit/ec746a66f0813f60eb59de11b8207f773fc4728c
2025-11-17 17:26:24 +08:00
Helvetica Volubi bc166a9fb6 [ci skip] refactor code 2025-11-16 21:22:06 +08:00
Helvetica Volubi feebf388f8 Add Replay Api (#86)
* feat: base replay api support

* fix an async bug
2025-11-16 21:05:01 +08:00
Helvetica Volubi dbcf764e76 fix ServuxStructuresProtocol (#89)
* Add LeaveHooks to fix bug caused by servux structures protocol

* add missing file

* add comment

* add license
2025-11-16 20:51:19 +08:00
Helvetica Volubi 735fe8855a try to fix a bug in fake player spawn 2025-11-16 18:53:16 +08:00
Helvetica Volubi 1b45a090f6 Update Luminol 2025-11-16 14:09:42 +08:00
Helvetica Volubi bb1335d390 [ci skip] Update Luminol
do not release yet, release at next commit
2025-11-15 15:38:52 +08:00
Helvetica Volubi 00743c841f Update Luminol 2025-11-14 22:27:06 +08:00
xiaoxijun bdb9c9dec4 Add Alternative block placement Protocol (#81)
* Add Alternative block placement Protocol

* fix: fix config error caused by config system

- TODO: fix config system read enum bug in luminol

* remove Leaves logger & use mojang logger

* update code from leaves

---------

Co-authored-by: Helvetica Volubi <suisuroru@blue-millennium.fun>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2025-11-12 19:15:21 +08:00
Helvetica Volubi ac3653dda7 [ci skip]Update Gradle wrapper to version 9.2.0 2025-11-12 00:56:44 +08:00
Helvetica Volubi a08fd04751 Update Luminol to fix a sentry bug 2025-11-12 00:20:46 +08:00
Helvetica Volubi f5debe9ee1 [ci skip] Update Luminol 2025-11-10 17:27:08 +08:00
Helvetica Volubi 1a84d2e670 Update Luminol to fix a crash bug in config command system 2025-11-10 00:27:08 +08:00
Helvetica Volubi e96891275d [ci skip] update datapack command save 2025-11-09 02:38:51 +08:00
Helvetica Volubi 9e342c6683 Update Luminol 2025-11-06 00:12:13 +08:00
Helvetica Volubi 00f7f5ee2b fix: fixes #69 2025-11-01 02:53:48 +08:00
Helvetica Volubi 77b9582c4a Update Luminol 2025-10-31 22:23:17 +08:00
Helvetica Volubi 184048fd26 Update Luminol 2025-10-31 00:23:24 +08:00
Helvetica Volubi 7ccca03023 try to fix BBOR protocol 2025-10-29 02:09:22 +08:00
Helvetica Volubi b34fa8237e feat: provided void trade instead of infinite trade
fixes #77
2025-10-29 00:20:45 +08:00
Helvetica Volubi 42a4d18717 refactor: deprecated tickCount 2025-10-27 21:40:42 +08:00
Helvetica Volubi 2d8d7f5784 refactor: prepare to drop reuse tickCount 2025-10-27 21:11:51 +08:00
Helvetica Volubi bf509bcded feat: wool hopper counter(#27) 2025-10-27 19:59:03 +08:00
Helvetica Volubi ef6759a9ab [ci skip] Update Luminol to skip release by robot 2025-10-27 05:40:37 +00:00
Helvetica Volubi bc1483ea7a fix: try to fix Concurrent throw in protocol 2025-10-27 00:10:44 +08:00
Helvetica Volubi 5768a60ba8 fix: rewrite request block data method 2025-10-25 03:22:14 +08:00
Helvetica Volubi 05434f422c fix: fixes #63 2025-10-23 00:20:15 +08:00
Helvetica Volubi 21e9299352 Update code from Leaves 2025-10-22 11:34:52 +08:00
Helvetica Volubi 83e7718346 fix: try fix #63 2025-10-22 02:41:51 +08:00
Helvetica Volubi 5845b976c1 fix: try fix #70 2025-10-22 02:15:15 +08:00
xiaoxijun 4ca94280ae Add support for more mod protocols (#73)
* Add Syncmatica protocols

* Add AppleSkin protocols

* Add BBOR Protocol

* Add Jade Protocol

* Add Xaero Map Protocol

* Add Support REI protocol

* Fixed an issue where the configuration file was not loading correctly.

* move config file directory

* add license & refactor code

* update leaves fix

https://github.com/LeavesMC/Leaves/issues/747#event-19986621829

* Update Luminol

* fix up jade protocol

* fix up rei

---------

Co-authored-by: Helvetica Volubi <suisuroru@blue-millennium.fun>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
2025-10-20 00:06:40 +08:00
Helvetica Volubi 4cc49c6d99 fix: fix bot save command 2025-10-20 00:02:21 +08:00
Helvetica Volubi 93c0258c7e fix: use local lastTickCount to save data 2025-10-19 23:40:17 +08:00
Helvetica Volubi 43a5ea0385 Update Luminol 2025-10-18 02:34:13 +08:00
Helvetica Volubi 678882a435 Update Luminol & fix a bug in shutdown server 2025-10-14 19:14:12 +08:00
Helvetica Volubi 8e5884147f fix: fix async bugs
fixes #70
2025-10-12 11:54:30 +08:00
Helvetica Volubi b999cf9f5f [ci skip] update ci 2025-10-11 23:34:49 +08:00
Helvetica Volubi 847bcd54e0 Update Luminol 2025-10-06 14:20:14 +08:00
Helvetica Volubi 15a55403ff Modify merge ItemEntity logic
Add followTickSequenceMerge to modify merge items, due to Paper's modification of the merge radius, when the merge radius is large and stacks containing many items get stuck in an unexpected position, individual items may never reach their destination. This configuration option is added to fix this behavior.
2025-10-04 01:15:49 +08:00
Helvetica Volubi 482809df6e [ci skip]fix: fix default translations support 2025-10-03 18:24:30 +08:00
Helvetica Volubi 5db8ec4bd9 fix: pre fix a bug in I18n (will cause bug in 1.21.9) 2025-10-03 17:03:37 +08:00
Helvetica Volubi d60cd46c15 Update Luminol 2025-10-02 16:51:47 +08:00
Helvetica Volubi df40d4bdc9 Update Luminol 2025-10-01 23:21:57 +08:00
Helvetica Volubi 0084883933 feat: add config to enable scoreboard command unsafe 2025-09-29 22:59:44 +08:00
Helvetica Volubi 1d1e4ec70b fix: fixes #62 2025-09-29 16:49:58 +08:00
Helvetica Volubi 1927a66d8e fix:fix a bug in config of multi-format 2025-09-29 00:14:55 +08:00
Helvetica Volubi 38442749e7 fix: fixes #65 2025-09-28 17:39:20 +08:00
Helvetica Volubi 70dae5976d fix: try fixes #63 2025-09-28 15:49:30 +08:00
Helvetica Volubi b08756b4b3 fix: fixes #64 2025-09-28 14:44:04 +08:00
Helvetica Volubi 5e658adad3 Update Luminol 2025-09-28 13:12:54 +08:00
Bacteriawa 4d6e08312a Update Luminol 2025-09-25 23:43:14 +08:00
Helvetica Volubi 9efe6499d0 Update Luminol 2025-09-24 01:08:36 +08:00
Helvetica Volubi 319946e8c1 fixes #61 2025-09-21 21:14:01 +08:00
Helvetica Volubi 28ce6ae7b1 Update Luminol & fix up CI 2025-09-19 15:10:55 +08:00
Helvetica Volubi af4a8a8731 Update Luminol 2025-09-13 22:17:35 +08:00
Helvetica Volubi 7059c6a062 Update Luminol & Leaves Redstone Shears Wrench 2025-09-13 04:03:53 +08:00
Helvetica Volubi 98a8b65665 Update Luminol 2025-09-13 02:39:56 +08:00
Helvetica Volubi ac6b1e2377 Update Luminol 2025-09-12 05:09:04 +08:00
Helvetica Volubi 0e964ae71c fixes #58 2025-09-11 17:24:13 +08:00
Helvetica Volubi ba6bd9f71c Update Luminol 2025-09-06 17:15:36 +08:00
Helvetica Volubi 4513cfd637 Fake Player command use brigadier (#57)
* pre update for new command system branch

* update ref
2025-09-05 03:30:27 +08:00
Helvetica Volubi d87cca6a97 fix: fix shutdown problem if bot was not removed in world 2025-09-04 21:38:52 +08:00
Helvetica Volubi 79dbac2a8e Update Luminol 2025-09-04 17:30:46 +08:00
Helvetica Volubi 4d3e3ac832 feat: add function command unsafe support 2025-09-04 02:19:09 +08:00
Helvetica Volubi d985a9ca33 fix: fixes #55 2025-09-01 22:16:41 +08:00
Helvetica Volubi 192ef93833 upload license 2025-08-31 00:04:58 +08:00
Bacteriawa b61d6cf1ac Add Fakeplayer 2025-08-30 23:44:05 +08:00
Helvetica Volubi 1c4dea41c8 fix: fix servux's MobCapData build & send
rebuild in folia environment
2025-08-30 03:50:31 +08:00
Helvetica Volubi 4740744adb Update upstream(Luminol) 2025-08-30 01:23:09 +08:00
Bacteriawa 434694f6a1 [ci skip]update readme 2025-08-29 21:13:17 +08:00
Bacteriawa e584866cf5 [ci skip]update readme 2025-08-29 21:11:05 +08:00
Helvetica Volubi 1cff183f26 [ci skip]fix up 2025-08-27 23:45:26 +08:00
Helvetica Volubi a3af47db18 Update upstream to fix a config bug 2025-08-27 22:36:54 +08:00
Helvetica Volubi b830c66be7 Update upstream(Luminol) & rename config names 2025-08-27 00:22:52 +08:00
Helvetica Volubi fc50c2ac44 Update gradle.properties 2025-08-26 14:08:25 +08:00
Helvetica Volubi f81cee2454 feat: add a config to revert MC-159283 2025-08-26 03:04:39 +08:00
Helvetica Volubi 049716a64c Update upstream(Luminol) 2025-08-25 22:31:49 +08:00
dependabot[bot] c7c37c5a95 build(deps): bump actions/setup-java from 4 to 5 (#52)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 21:32:02 +08:00
Helvetica Volubi 4dea005c0d Update gradle.properties 2025-08-24 22:07:20 +08:00
Helvetica Volubi 074c5c9553 Update upstream(Luminol-lithium-sleeping-block-entity) 2025-08-24 03:55:44 +08:00
Helvetica Volubi f79cc86332 Update upstream(Luminol-lithium-sleeping-block-entity) 2025-08-22 20:55:59 +08:00
740 changed files with 66432 additions and 3400 deletions
+1 -1
View File
@@ -11,4 +11,4 @@ issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
custom: https://afdian.com/a/Luminol
custom: [https://afdian.com/a/bm0721] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+17 -3
View File
@@ -1,7 +1,7 @@
name: Bug反馈 Bug report
description:
报告Bug,插件不兼容情况,以及其他相关问题。
Report issues with plugin incompatbility or other behavior related issues.
Report issues with plugin incompatibility or other behavior related issues.
labels:
- bug
- pending
@@ -25,7 +25,7 @@ body:
LophineMC服务端发行版本 LophineMC server release version (contains the git commit's hash)<br>
通过执行`/version`命令将获取到的内容复制到这里。 Run `/version` on your server and paste the full, unmodified output here.
placeholder: >
e.g. git-Lophine-"0635a89" (MC: 1.20.4)
e.g. git-Lophine-"fa1ab90" (MC: 1.21.8)
validations:
required: true
- type: textarea
@@ -41,7 +41,7 @@ body:
attributes:
label: 观测到的实际行为 Observed/Actual behavior
description: 你实际看到的。 What you actually saw.
placeholder: e.g. 使用 /tpsbar [NAME] 命令切换不了TPSBAR
placeholder: e.g. 使用 /tpsbar 命令切换不了TPSBAR
validations:
required: true
- type: textarea
@@ -65,6 +65,20 @@ body:
To list plugins, run `/plugins`. For datapacks, run `/datapack list`.
validations:
required: true
- type: textarea
id: config-file-list
attributes:
label: 配置文件列表(如果可以)。 Config File List (if possible).
description:
服务器上的配置文件列表。
All config files on your server.
例如以下文件(或者文件夹):
Example files (or folders)
- \spigot.yml
- \bukkit.yml
- \config\\\*
- \lophine_config\\\*
- \luminol_config\\\*
- type: textarea
id: other
attributes:
+1 -1
View File
@@ -28,7 +28,7 @@ body:
validations:
required: true
- type: textarea
id: othre
id: other
attributes:
label: 其他 Other
description: 添加其他的信息。 Add any other context or screenshots about the feature request below.
+100 -17
View File
@@ -7,6 +7,20 @@ on:
pull_request:
branches:
- "**"
workflow_dispatch:
inputs:
force-release:
description: "Force disable release if you enter false, force release if you enter true, default release if not released else skip release"
required: false
default: ""
force-push:
description: "Force disable push to repo if you enter false, force push to repo if you enter true, default push if not released else skip push repo"
required: false
default: ""
comments:
description: "Add comments to release"
required: false
default: ""
permissions: write-all
@@ -14,58 +28,127 @@ jobs:
build:
runs-on: ubuntu-latest
environment: default
env:
BUILD_NUMBER: ${{ github.run_number }}
steps:
- name: Checkout Git Repository
uses: actions/checkout@v5
uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v4
- name: Set Up JDK
uses: actions/setup-java@v5.7.0
with:
distribution: zulu
java-version: 21
java-version: 25
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v6
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Configure Git User Details
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
run: git config --global user.email "ci@lophinelabs.com" && git config --global user.name "LophinelabsCI"
- name: Apply All Patches
run: ./gradlew --refresh-dependencies applyAllPatches
- name: CreateMojmapPaperclipJar
run: ./gradlew --refresh-dependencies createMojmapPaperclipJar
- name: Build Paperclip Jar
run: ./gradlew --refresh-dependencies createPaperclipJar
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ env.project_id_b }} CI Artifacts
path: lophine-server/build/libs/*-paperclip-*-mojmap.jar
path: lophine-server/build/libs/*-paperclip-*.jar
- name: SetENV
- name: Set Environment
if: github.event_name != 'pull_request'
run: sh scripts/SetENV.sh
- name: Publish to repo
if: github.event_name != 'pull_request' && env.flag_release == 'true' && false # do not push to any repo
- name: Check If Release Exists
if: github.event_name != 'pull_request' && env.flag_release == 'true'
run: |
git fetch --tags
if [ -n "$(git tag -l "${{ env.tag }}")" ]; then
echo "Release already exists"
release_exists=true
else
echo "Release does not exist"
release_exists=false
fi
if [ "$release_exists" == "true" ]; then
counter=1
while [ -n "$(git tag -l "${{ env.tag }}-${counter}")" ]; do
counter=$((counter + 1))
done
echo "tag=${{ env.tag }}-${counter}" >> $GITHUB_ENV
echo "release_count= - ${counter}" >> $GITHUB_ENV
release_exists=false
fi
echo "release_exists=${release_exists}" >> $GITHUB_ENV
- name: Check If Branch In Expectations
if: github.event_name != 'pull_request' && env.flag_release == 'true'
run: |
if [[ "$GITHUB_REF_NAME" == ver/* ]] || [[ "$GITHUB_REF_NAME" == exp/* ]] || [[ "$GITHUB_REF_NAME" == dev/* ]]; then
echo "Branch is in expected prefixes"
echo "unexpect=false" >> $GITHUB_ENV
else
echo "Branch is NOT in expected prefixes"
echo "unexpect=true" >> $GITHUB_ENV
fi
- name: Publish To Repo
if: ( github.event_name != 'pull_request' && !( env.unexpect == 'true' ) && env.flag_push_repo == 'true' && !( inputs.force-push == 'false' )) || inputs.force-push == 'true'
continue-on-error: true
run: ./gradlew --refresh-dependencies generateDevelopmentBundle publish -PpublishDevBundle=true
env:
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
- name: Create Release
if: github.event_name != 'pull_request' && env.flag_release == 'true'
- name: Create Release - Pre Process
if: ( github.event_name != 'pull_request' && !( env.unexpect == 'true' ) && env.flag_release == 'true' && env.release_exists != 'true' && !(inputs.force-release == 'false')) || inputs.force-release == 'true'
run: |
if [ "${{ inputs.comments }}" == "" ]; then
echo "No comments provided"
echo "flag_comment=false" >> $GITHUB_ENV
else
echo "Comments provided: ${{ inputs.comments }}"
echo "flag_comment=true" >> $GITHUB_ENV
fi
- name: Create Release - No Comment
if: env.flag_comment == 'false'
uses: ncipollo/release-action@v1
with:
tag: ${{ env.tag }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}${{ env.release_count }}
body: |
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [![download](https://img.shields.io/github/downloads/LuminolMC/${{ env.project_id }}/${{ env.tag }}/total?color=red&style=flat-square)](https://github.com/LuminolMC/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [![download](https://img.shields.io/github/downloads/LophineLabs/${{ env.project_id }}/${{ env.tag }}/total?color=red&style=flat-square)](https://github.com/LophineLabs/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
This release is automatically compiled by GitHub Actions
### Branch Info
> ${{ github.ref_name }}
### Commit Message
${{ env.commit_msg }}
artifacts: ${{ env.jar_dir }}
generateReleaseNotes: true
prerelease: ${{ env.pre }}
makeLatest: ${{ env.make_latest }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release - With Comment
if: env.flag_comment == 'true'
uses: ncipollo/release-action@v1
with:
tag: ${{ env.tag }}
name: ${{ env.project_id_b }} ${{ env.mcversion }} - ${{ env.commit_id }}${{ env.release_count }}
body: |
📦Version: `${{ env.mcversion }}` | Commit ${{ env.commit_id }} [![download](https://img.shields.io/github/downloads/LophineLabs/${{ env.project_id }}/${{ env.tag }}/total?color=red&style=flat-square)](https://github.com/LophineLabs/${{ env.project_id }}/releases/download/${{ env.tag }}/${{ env.jar }})
This release is automatically compiled by GitHub Actions
### Comments
> ${{ inputs.comments }}
### Branch Info
> ${{ github.ref_name }}
### Commit Message
${{ env.commit_msg }}
artifacts: ${{ env.jar_dir }}
+29
View File
@@ -0,0 +1,29 @@
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches: # Specify your branches here
- ver/* # Stable branch
- exp/* # Experimental branch
- dev/* # Development Branch
jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@latest
with:
pr-mode: false
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1658551725 }}
QODANA_ENDPOINT: 'https://qodana.cloud'
+2 -4
View File
@@ -6,12 +6,10 @@ build
/run
/lightingluminol-server/build.gradle.kts
/lightingluminol-api/build.gradle.kts
/luminol-server/build.gradle.kts
/lophine-server/build.gradle.kts
/lophine-api/build.gradle.kts
/luminol-server/src/minecraft
/paper-server
/luminol-api/build.gradle.kts
/paper-api
/paper-api-generator
+3 -3
View File
@@ -3,11 +3,11 @@ Lophine inherits its licensing from the included upstream projects.
Lophine从上游继承了许可证。
As such, Lophine is licensed under the
[GNU General Public License version 3](licenses/GPL.md); as it inherits it from Luminol,
who in turn inherits it from the original Folia, Paper, Spigot, Bukkit and CraftBukkit projects.
[GNU General Public License version 3](licenses/GPL.md); as it inherits it from Folia,
who in turn inherits it from the original Paper, Spigot, Bukkit and CraftBukkit projects.
因此,Lophine中应当遵守[GNU通用公共许可证-第3版](licenses/GPL.md)
因为Lophine从上游Luminol继承了它,而Luminol又从其上游的Folia、Paper、Spigot、Bukkit和Craftbukkit项目中继承了它。
因为Lophine从上游Folia继承了它,而Folia又从其上游的Paper、Spigot、Bukkit和Craftbukkit项目中继承了它。
Any author who is _not_ listed below should be presumed to have released their work
under the original [GPL](licenses/GPL.md) license.
+85 -57
View File
@@ -1,108 +1,136 @@
<img src="public/image/lophine/lophine3.png" alt="Logo" align="right" width="250">
<div align="center">
<img src="./public/image/lophine/lophine3.png" alt="Lophine Logo" width="300">
# Lophine
*Lophine 是一个基于Folia的分支,具有许多有用的优化和可配置的原版特性,目标是在Folia上实现更多生电的内容(请注意,完整生电请使用Fabric)*
![Created At](https://img.shields.io/github/created-at/LophineLabs/Lophine?style=for-the-badge&color=blue)
[![License](https://img.shields.io/github/license/LophineLabs/Lophine?style=for-the-badge&color=green)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LophineLabs/Lophine?style=for-the-badge&color=orange)](https://github.com/LophineLabs/Lophine/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LophineLabs/Lophine?style=for-the-badge&color=purple)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LophineLabs/Lophine?style=for-the-badge&color=yellow)
![GitHub all releases](https://img.shields.io/github/downloads/LophineLabs/Lophine/total?style=for-the-badge&color=red)
![Repo contributors](https://img.shields.io/github/contributors/LophineLabs/Lophine?style=for-the-badge&color=brightgreen)
[English](./README_EN.md) | **中文(简体)** | [中文(繁體)](./README_ZH_TW.md)
</div>
# Lophine
---
<h4>Lophine 是一个基于Luminol的分支,具有许多有用的优化和可配置的原版特性,目标是在Folia上实现更多生电的实现</h4>
## ✨ 核心特性
![Created At](https://img.shields.io/github/created-at/LuminolMC/Lophine?style=flat-square)
[![License](https://img.shields.io/github/license/LuminolMC/Lophine?style=flat-square)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Lophine?style=flat-square)](https://github.com/LuminolMC/Lophine/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LuminolMC/Lophine?style=flat-square)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Lophine?style=flat-square)
![GitHub all releases](https://img.shields.io/github/downloads/LuminolMC/Lophine/total?style=flat-square)
- 🔧 **可配置的原版特性** - 灵活调整游戏机制以适应不同服务器需求
- 📊 **Tpsbar 支持** - 实时显示服务器 TPS 状态
- 🐛 **Folia Bug 修复** - 针对 Folia 已知问题的专项修复
- 💾 **多存档格式支持** - 支持 linear 和 b_linearlinear 重新实现)存档格式
- 🔬 **生电功能增强** - 在 Folia 上实现更多生电内容(完整生电请使用 Fabric)
- 🛠️ **更多实用功能** - 持续添加有用的服务器功能
[English](./README_EN.md) | **中文**
### 额外启动参数
## 特性
- morninggloryclip.useMojangSource 强制服务端使用mojang源下载文件
- morninggloryclip.enable.mixin 启用服务器插件的mixin支持
- 支持部分Bukkit插件
- 可配置的原版特性
- Tpsbar 支持
- 针对folia bug的一些修复
- linear和b_linear(linear的重新实现)存档格式支持
- 对单线程区域性能的优化
- 更多有用的功能
## 📥 下载
## 下载
### 稳定版本
所有发布版本都可以在 [Releases](https://github.com/LophineLabs/Lophine/releases) 页面找到。
任何版本都可以在 [Release](https://github.com/LuminolMC/Lophine/releases), 中找到,你也可以通过[以下步骤](./README.md#构建)自己构建。
### 开发版本
如果您想体验最新功能,可以通过以下步骤自行构建。
## 构建
### 构建步骤
要构建一个paperclip jar,你需要运行以下命令。你可以在lophine-server/build/libs中找到jar(注意:需要`JDK21`
```bash
# 克隆项目
git clone https://github.com/LophineLabs/Lophine.git
cd Lophine
```shell
./gradlew applyAllPatches && ./gradlew createMojmapPaperclipJar
# 应用补丁并构建 Paperclip JAR
./gradlew applyAllPatches && ./gradlew createPaperclipJar
```
## 使用API
构建完成后,您可以在 `lophine-server/build/libs` 目录中找到生成的 JAR 文件。
使用 Gradle:
## 🔌 API 使用
### Gradle 配置
```kotlin
repositories {
maven {
url = "https://repo.menthamc.org/repository/maven-public/"
url = "https://repo.bacteriawa.com/repository/maven-public/"
}
}
dependencies {
compileOnly("me.earthme.luminol:luminol-api:$VERSION")
compileOnly("fun.bm.lophine:lophine-api:26.2.build.+")
}
```
使用 Maven
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
}
```
### Maven 配置
```xml
<repositories>
<repository>
<id>menthamc</id>
<url>https://repo.menthamc.org/repository/maven-public/</url>
<id>repository</id>
<url>https://repo.bacteriawa.com/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>me.earthme.luminol</groupId>
<artifactId>luminol-api</artifactId>
<version>$VERSION</version>
<groupId>fun.bm.lophine</groupId>
<artifactId>lophine-api</artifactId>
<version>[26.2.build,)</version>
</dependency>
</dependencies>
```
## 联系方式
## 💬 社区与支持
> 如果您对这个项目感兴趣或有任何问题,请随时向我们提问。
**QQ群: [1015048616](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=QML5kIVsniPi1PlZvnjHQT_02EHsZ5Jc&authKey=%2FTCJsZC7JFQ9sxAroPCKuYnlV57Z5fyqp36ewXZk3Sn4iJ9p4MB1JKdc%2FFcX3HOM&noverify=0&group_code=1015048616)** | QQ频道: [点击加入](https://pd.qq.com/s/eq9krf9j) | Telegram: [点击加入](https://t.me/LuminolMinecraft) | Discord: [点击加入](https://discord.gg/Qd7m3V6eDx)
### 加入我们的社区
- **QQ群**: [1020403749](https://qm.qq.com/cgi-bin/qm/qr?k=y_MA9UaN7PM9e9J1LIs9Eea3LK8C0h6J&jump_from=webapi&authKey=ap5f8MlbeezXYtnmpnT5ZOFljDuOyV6OAb2PIcViQ+Ilr60Ycq63FDDTsJOZDYtj)
- **Discord**: [点击加入](https://discord.gg/UXSgPZczcy)
## 关于 Issue
### 获取帮助
当您遇到任何问题时,请向我们提问,我们将尽力解决,但请记得清楚地描述您的问题并提供足够的日志等信息。
- 📋 [提交 Issue](https://github.com/LophineLabs/Lophine/issues)
- 💬 [GitHub Discussions](https://github.com/LophineLabs/Lophine/discussions)
- 📖 [项目文档](./docs/)
## 贡献代码
## 🐛 问题反馈
可查看 [Contributing](./docs/CONTRIBUTING.md)
当您遇到任何问题时,请向我们提问,我们将尽力解决。请记得:
## BStats
- 📝 **清楚描述问题** - 详细说明问题的具体表现
- 📋 **提供完整日志** - 包含错误日志和相关配置信息
- 🔍 **环境信息** - 说明服务器版本、插件列表等环境详情
- 🔄 **复现步骤** - 如果可能,请提供问题复现的具体步骤
## 🤝 贡献代码
我们欢迎社区贡献!详细的贡献指南请查看:
- 📖 [贡献指南 (中文)](./docs/CONTRIBUTING.md)
- 📖 [Contributing Guide (English)](./docs/CONTRIBUTING_EN.md)
## 📊 项目统计
### BStats 数据
![bStats](https://bstats.org/signatures/server-implementation/Lophine.svg "bStats")
## 特别感谢
<b>感谢[LegacyLands](https://github.com/LegacyLands)对本项目的赞助,如果你想开发一些跨folia/非folia平台的插件,[legacy-lands-library](https://github.com/LegacyLands/legacy-lands-library/)将会是个不错的lib</b>
![legacy-lands-logo](public/image/legacy-lands-logo.png)
## 请给我们一个 ⭐Star
## ⭐ 请给我们一个 Star
> 你的每一个免费的 ⭐Star 就是我们每一个前进的动力。
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&LuminolMC/Lophine&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
<img alt="Star历史表" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
</picture>
</a>
+91 -60
View File
@@ -1,106 +1,137 @@
<img src="public/image/lophine/lophine3.png" alt="Logo" align="right" width="250">
<div align="center">
<img src="./public/image/lophine/lophine3.png" alt="Lophine Logo" width="300">
# Lophine
*Lophine is a Folia fork with many useful optimizations and configurable vanilla features, aims to provide more function for survival-usable circuit on folia (Please note that Fabric should be used for complete survival-usable)*
![Created At](https://img.shields.io/github/created-at/LophineLabs/Lophine?style=for-the-badge&color=blue)
[![License](https://img.shields.io/github/license/LophineLabs/Lophine?style=for-the-badge&color=green)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LophineLabs/Lophine?style=for-the-badge&color=orange)](https://github.com/LophineLabs/Lophine/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LophineLabs/Lophine?style=for-the-badge&color=purple)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LophineLabs/Lophine?style=for-the-badge&color=yellow)
![GitHub all releases](https://img.shields.io/github/downloads/LophineLabs/Lophine/total?style=for-the-badge&color=red)
![Repo contributors](https://img.shields.io/github/contributors/LophineLabs/Lophine?style=for-the-badge&color=brightgreen)
**English** | [中文(简体)](./README.md) | [中文(繁體)](./README_ZH_TW.md)
</div>
# Lophine
---
<h4>Lophine is a Luminol fork with many useful optimizations and configurable vanilla features, aims to provide
more function for survival-usable circuit on folia</h4>
## ✨ Core Features
![Created At](https://img.shields.io/github/created-at/LuminolMC/Lophine?style=flat-square)
[![License](https://img.shields.io/github/license/LuminolMC/Lophine?style=flat-square)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LuminolMC/Lophine?style=flat-square)](https://github.com/LuminolMC/Lophine/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LuminolMC/Lophine?style=flat-square)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LuminolMC/Lophine?style=flat-square)
![GitHub all releases](https://img.shields.io/github/downloads/LuminolMC/Lophine/total?style=flat-square)
- 🔧 **Configurable Vanilla Features** - Flexibly adjust game mechanics to suit different server needs
- 📊 **Tpsbar Support** - Real-time TPS status display
- 🐛 **Folia Bug Fixes** - Targeted fixes for known Folia issues
- 💾 **Multiple World Format Support** - Support for linear and b_linear (linear reimplementation) world formats
- 🔬 **Redstone Enhancement** - More redstone functionality on Folia (use Fabric for complete redstone features)
- 🛠️ **More Useful Functions** - Continuously adding useful server features
**English** | [中文](./README.md)
### Additional Launch Parameters
## Features
- morninggloryclip.useMojangSource - Use Mojang's source for Minecraft Server
- morninggloryclip.enable.mixin - Enable mixin support for Leaves Plugin
- Supported some Bukkit plugin
- Configurable vanilla features
- Tpsbar support
- Useful fixes of bugs of folia
- Linear and BufferedLinear(AKA. b_linear)(a reimplementation of linear) region format support
- Useful optimizations to improve the performance of single threaded region
- More functions
## 📥 Download
## Download
### Stable Releases
All release versions can be found on the [Releases](https://github.com/LophineLabs/Lophine/releases) page.
Any versions are available in the [release](https://github.com/LuminolMC/Lophine/releases), also you can build it by yourself through [the following steps](./README_EN.md#Build).
### Development Builds
If you want to experience the latest features, you can build it yourself following the steps below.
## Build
### Build Steps
To build a paperclip jar, you need to run the following command. You can find the jar in lophine-server/build/libs(Note: `JDK21` is needed)
```bash
# Clone the project
git clone https://github.com/LophineLabs/Lophine.git
cd Lophine
```shell
./gradlew applyAllPatches && ./gradlew createMojmapPaperclipJar
# Apply patches and build Paperclip JAR
./gradlew applyAllPatches && ./gradlew createPaperclipJar
```
## Using API
After building, you can find the generated JAR file in the `lophine-server/build/libs` directory.
For gradle:
## 🔌 API Usage
### Gradle Configuration
```kotlin
repositories {
maven {
url = "https://repo.menthamc.org/repository/maven-public/"
url = "https://repo.bacteriawa.com/repository/maven-public/"
}
}
dependencies {
compileOnly("me.earthme.luminol:luminol-api:$VERSION")
compileOnly("fun.bm.lophine:lophine-api:26.2.build.+")
}
```
For maven
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
}
```
### Maven Configuration
```xml
<repositories>
<repository>
<id>menthamc</id>
<url>https://repo.menthamc.org/repository/maven-public/</url>
<id>repository</id>
<url>https://repo.bacteriawa.com/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>me.earthme.luminol</groupId>
<artifactId>luminol-api</artifactId>
<version>$VERSION</version>
</dependency>
<dependency>
<groupId>fun.bm.lophine</groupId>
<artifactId>lophine-api</artifactId>
<version>[26.2.build,)</version>
<scope>provided</scope>
</dependency>
</dependencies>
```
## Contact
## 💬 Community & Support
> If you are interested in this project or have any issue, feel free to ask us.
> If you're interested in this project or have any questions, feel free to ask us.
**QQ Group: [1015048616](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=hTPlI5j6XB8pgk4sdx6RkjhBPGG1r4IR&authKey=pnu6uCKQP7Sja2CJWC15Qi3BeI%2FAsh8tU4m5muufMBjbB3zz%2BwHBZCTRRdSNKhld&noverify=0&group_code=1015048616)** | QQ Channel: [Click To Join](https://pd.qq.com/s/eq9krf9j) | Telegram: [Click To Join](https://t.me/LuminolMinecraft) | Discord: [Click To Join](https://discord.gg/Qd7m3V6eDx)
### Join Our Community
## About Issue
- **QQ Group**: [1020403749](https://qm.qq.com/cgi-bin/qm/qr?k=y_MA9UaN7PM9e9J1LIs9Eea3LK8C0h6J&jump_from=webapi&authKey=ap5f8MlbeezXYtnmpnT5ZOFljDuOyV6OAb2PIcViQ+Ilr60Ycq63FDDTsJOZDYtj)
- **Discord**: [Join Here](https://discord.gg/UXSgPZczcy)
When you meet any problems, just ask us, we will do our best to solve it, but remember to state your problem clear and provide enough logs etc.</br>
### Get Help
## Pull Requests
- 📋 [Submit Issues](https://github.com/LophineLabs/Lophine/issues)
- 💬 [GitHub Discussions](https://github.com/LophineLabs/Lophine/discussions)
- 📖 [Project Documentation](./docs/)
See [Contributing](./docs/CONTRIBUTING_EN.md)
## 🐛 Bug Reports
## BStats
When you encounter any issues, please ask us and we'll do our best to resolve them. Please remember to:
- 📝 **Describe the problem clearly** - Provide detailed information about the specific issue
- 📋 **Provide complete logs** - Include error logs and relevant configuration information
- 🔍 **Environment details** - Specify server version, plugin list, and other environment details
- 🔄 **Reproduction steps** - If possible, provide specific steps to reproduce the issue
## 🤝 Contributing
We welcome community contributions! For detailed contribution guidelines, please see:
- 📖 [Contributing Guide (English)](./docs/CONTRIBUTING_EN.md)
- 📖 [贡献指南 (中文)](./docs/CONTRIBUTING.md)
## 📊 Project Statistics
### BStats Data
![bStats](https://bstats.org/signatures/server-implementation/Lophine.svg "bStats")
## Special Thanks
## ⭐ Give Us a Star!
Thanks [LegacyLands](https://github.com/LegacyLands) for sponsoring this project.If you want to develop some crossing folia/non-folia platform plugins, [legacy-lands-library](https://github.com/LegacyLands/legacy-lands-library/) will be a nice choice for you
![legacy-lands-logo](public/image/legacy-lands-logo.png)
## Please ⭐star us!
<a href="https://star-history.com/#LuminolMC/Luminol&LuminolMC/LightingLuminol&LuminolMC/Lophine&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=LuminolMC/Luminol%2CLuminolMC/LightingLuminol%2CLuminolMC/Lophine&type=Date" />
</picture>
</a>
> Every free ⭐Star you give is the motivation for our every step forward.
+139
View File
@@ -0,0 +1,139 @@
<div align="center">
<img src="./public/image/lophine/lophine3.png" alt="Lophine Logo" width="300">
# Lophine
*Lophine 是一個基於 Folia 的 fork,具備許多好用的最佳化與可設定的原版特性,目標是在 Folia 上實現更多生電向的內容(完整生電支援請使用 Fabric)*
![Created At](https://img.shields.io/github/created-at/LophineLabs/Lophine?style=for-the-badge&color=blue)
[![License](https://img.shields.io/github/license/LophineLabs/Lophine?style=for-the-badge&color=green)](LICENSE.md)
[![Issues](https://img.shields.io/github/issues/LophineLabs/Lophine?style=for-the-badge&color=orange)](https://github.com/LophineLabs/Lophine/issues)
![Commit Activity](https://img.shields.io/github/commit-activity/w/LophineLabs/Lophine?style=for-the-badge&color=purple)
![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/LophineLabs/Lophine?style=for-the-badge&color=yellow)
![GitHub all releases](https://img.shields.io/github/downloads/LophineLabs/Lophine/total?style=for-the-badge&color=red)
![Repo contributors](https://img.shields.io/github/contributors/LophineLabs/Lophine?style=for-the-badge&color=brightgreen)
[English](./README_EN.md) | [中文(簡體)](./README.md) | **中文(繁體)**
</div>
---
## ✨ 核心特性
- 🔧 **可設定的原版特性** - 彈性調整遊戲機制,以符合不同伺服器的需求
- 📊 **Tpsbar 支援** - 即時顯示伺服器 TPS 狀態
- 🐛 **Folia Bug 修復** - 針對 Folia 已知問題的專項修復
- 💾 **多種存檔格式支援** - 支援 linear 與 b_linearlinear 重新實作)存檔格式
- 🔬 **生電功能強化** - 在 Folia 上實現更多生電內容(完整生電請使用 Fabric)
- 🛠️ **更多實用功能** - 持續新增有用的伺服器功能
### 額外啟動參數
- morninggloryclip.useMojangSource 強制伺服器端使用 Mojang 官方來源下載檔案
- morninggloryclip.enable.mixin 為伺服器插件啟用 mixin 支援
## 📥 下載
### 穩定版本
所有正式發布版本都可以在 [Releases](https://github.com/LophineLabs/Lophine/releases) 頁面找到。
### 開發版本
如果你想搶先體驗最新功能,可以照下面的步驟自行建置。
### 建置步驟
```bash
# Clone 這個專案
git clone https://github.com/LophineLabs/Lophine.git
cd Lophine
# 套用 patch 並建置 Paperclip JAR
./gradlew applyAllPatches && ./gradlew createPaperclipJar
```
建置完成後,你可以在 `lophine-server/build/libs` 目錄中找到產生的 JAR 檔案。
## 🔌 API 使用
### Gradle 設定
```kotlin
repositories {
maven {
url = "https://repo.bacteriawa.com/repository/maven-public/"
}
}
dependencies {
compileOnly("fun.bm.lophine:lophine-api:26.2.build.+")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
}
```
### Maven 設定
```xml
<repositories>
<repository>
<id>repository</id>
<url>https://repo.bacteriawa.com/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>fun.bm.lophine</groupId>
<artifactId>lophine-api</artifactId>
<version>[26.2.build,)</version>
<scope>provided</scope>
</dependency>
</dependencies>
```
## 💬 社群與支援
> 如果你對這個專案有興趣,或有任何問題,歡迎隨時來問我們。
### 加入我們的社群
- **QQ 群**: [1020403749](https://qm.qq.com/cgi-bin/qm/qr?k=y_MA9UaN7PM9e9J1LIs9Eea3LK8C0h6J&jump_from=webapi&authKey=ap5f8MlbeezXYtnmpnT5ZOFljDuOyV6OAb2PIcViQ+Ilr60Ycq63FDDTsJOZDYtj)
- **Discord**: [點我加入](https://discord.gg/UXSgPZczcy)
### 取得協助
- 📋 [提交 Issue](https://github.com/LophineLabs/Lophine/issues)
- 💬 [GitHub Discussions](https://github.com/LophineLabs/Lophine/discussions)
- 📖 [專案文件](./docs/)
## 🐛 問題回報
當你遇到任何問題時,歡迎來問我們,我們會盡力協助解決。請記得:
- 📝 **清楚描述問題** - 詳細說明問題的具體狀況
- 📋 **提供完整記錄檔** - 附上錯誤記錄與相關設定資訊
- 🔍 **環境資訊** - 說明伺服器版本、插件清單等環境細節
- 🔄 **重現步驟** - 如果可以,請提供重現問題的具體步驟
## 🤝 貢獻程式碼
我們歡迎社群貢獻!詳細的貢獻指南請參考:
- 📖 [貢獻指南(English](./docs/CONTRIBUTING_EN.md)
- 📖 [貢獻指南(簡體中文)](./docs/CONTRIBUTING.md)
- 📖 [貢獻指南(繁體中文)](./docs/CONTRIBUTING_ZH_TW.md)
- 📖 [貢獻指南(日本語)](./docs/CONTRIBUTING_JP.md)
## 📊 專案統計
### BStats 資料
![bStats](https://bstats.org/signatures/server-implementation/Lophine.svg "bStats")
## ⭐ 給我們一個 Star 吧!
> 你給的每一個免費 ⭐Star,都是我們前進的動力。
+114 -20
View File
@@ -1,23 +1,27 @@
import groovy.json.JsonSlurper
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java // TODO java launcher tasks
id("moe.luminolmc.hyacinthusweight.patcher") version "+" // Automatically pulls the latest
id("fun.bm.comfreyweight.patcher")
}
paperweight {
upstreams.register("luminol") {
repo = github("LuminolMC", "Luminol")
ref = providers.gradleProperty("luminolRef")
filterPatches = false
upstreams.register("folia") {
repo = github("PaperMC", "Folia")
ref = providers.gradleProperty("foliaRef")
println("Upstream commit ref: " + ref.get())
patchFile {
path = "luminol-server/build.gradle.kts"
path = "folia-server/build.gradle.kts"
outputFile = file("lophine-server/build.gradle.kts")
patchFile = file("lophine-server/build.gradle.kts.patch")
}
patchFile {
path = "luminol-api/build.gradle.kts"
path = "folia-api/build.gradle.kts"
outputFile = file("lophine-api/build.gradle.kts")
patchFile = file("lophine-api/build.gradle.kts.patch")
}
@@ -26,22 +30,17 @@ paperweight {
patchesDir = file("lophine-api/paper-patches")
outputDir = file("paper-api")
}
patchRepo("foliaApi") {
patchDir("foliaApi") {
upstreamPath = "folia-api"
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
patchesDir = file("lophine-api/folia-patches")
outputDir = file("folia-api")
}
patchDir("luminolApi") {
upstreamPath = "luminol-api"
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
patchesDir = file("lophine-api/luminol-patches")
outputDir = file("luminol-api")
}
}
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
val menthaMavenPublicUrl = "https://repo.menthamc.org/repository/maven-public/";
val bacteriawaMavenPublicUrl = "https://repo.bacteriawa.com/repository/maven-public/";
subprojects {
apply(plugin = "java-library")
@@ -49,14 +48,14 @@ subprojects {
extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(25)
}
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
maven(menthaMavenPublicUrl)
maven(bacteriawaMavenPublicUrl)
}
dependencies {
@@ -69,7 +68,7 @@ subprojects {
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release = 21
options.release = 25
options.isFork = true
}
tasks.withType<Javadoc>().configureEach {
@@ -88,8 +87,8 @@ subprojects {
extensions.configure<PublishingExtension> {
repositories {
maven("https://repo.menthamc.org/repository/maven-snapshots/") {
name = "MenthaMC"
maven("https://repo.bacteriawa.com/repository/maven-releases/") {
name = "Bacteriawa"
credentials(PasswordCredentials::class) {
username = System.getenv("PRIVATE_MAVEN_REPO_USERNAME")
password = System.getenv("PRIVATE_MAVEN_REPO_PASSWORD")
@@ -106,4 +105,99 @@ subprojects {
}
}
}
}
}
// Sort all JSON language files under the lang directory by key in ASCII order
val langDir = layout.projectDirectory.dir("lophine-server/src/main/resources/assets/lophine/lang")
tasks.register("sortLangKeys") {
group = "lophine"
description = "Sort all JSON language files by key in ASCII (ordinal) order"
notCompatibleWithConfigurationCache("Inline task action references build script class")
inputs.dir(langDir).optional()
outputs.dir(langDir)
doLast {
val dir = langDir.asFile
if (!dir.isDirectory) {
logger.warn("Lang directory not found: $dir")
return@doLast
}
val jsonFiles = dir.listFiles { f -> f.extension == "json" }?.sortedBy { it.name } ?: emptyList()
if (jsonFiles.isEmpty()) {
logger.lifecycle("No .json files found in: $dir")
return@doLast
}
val slurper = JsonSlurper()
for (file in jsonFiles) {
@Suppress("UNCHECKED_CAST")
val data = slurper.parse(file) as Map<String, Any?>
val sorted = data.toSortedMap()
val pretty = formatJson(sorted)
file.writeText(pretty + "\n", charset = Charsets.UTF_8)
logger.lifecycle("Processed: ${file.name} (${sorted.size} keys)")
}
logger.lifecycle("Done.")
}
}
// --- Pure-Kotlin JSON serializer that preserves non-ASCII characters (e.g. CJK) ---
fun formatJson(value: Any?, indent: Int = 2): String {
val sb = StringBuilder()
appendJson(sb, value, indent, 0)
return sb.toString()
}
private fun appendJson(sb: StringBuilder, value: Any?, indent: Int, level: Int) {
when (value) {
null -> sb.append("null")
is Boolean -> sb.append(value)
is Number -> sb.append(value)
is String -> sb.append('"').append(escapeJsonString(value)).append('"')
is List<*> -> {
if (value.isEmpty()) { sb.append("[]"); return }
sb.append("[\n")
value.forEachIndexed { i, v ->
sb.append(" ".repeat(indent * (level + 1)))
appendJson(sb, v, indent, level + 1)
if (i < value.size - 1) sb.append(',')
sb.append('\n')
}
sb.append(" ".repeat(indent * level)).append(']')
}
is Map<*, *> -> {
if (value.isEmpty()) { sb.append("{}"); return }
sb.append("{\n")
val entries = value.entries.toList()
entries.forEachIndexed { i, (k, v) ->
sb.append(" ".repeat(indent * (level + 1)))
sb.append('"').append(escapeJsonString(k.toString())).append('"')
sb.append(": ")
appendJson(sb, v, indent, level + 1)
if (i < entries.size - 1) sb.append(',')
sb.append('\n')
}
sb.append(" ".repeat(indent * level)).append('}')
}
else -> sb.append('"').append(escapeJsonString(value.toString())).append('"')
}
}
private fun escapeJsonString(s: String): String {
val sb = StringBuilder(s.length)
for (c in s) {
when (c) {
'"' -> sb.append("\\\"")
'\\' -> sb.append("\\\\")
'\b' -> sb.append("\\b")
'\u000C' -> sb.append("\\f")
'\n' -> sb.append("\\n")
'\r' -> sb.append("\\r")
'\t' -> sb.append("\\t")
else -> if (c.code < 0x20) {
sb.append("\\u").append(String.format("%04x", c.code))
} else {
sb.append(c) // preserve CJK and all other printable chars as-is
}
}
}
return sb.toString()
}
+14 -6
View File
@@ -1,7 +1,7 @@
为Lophine贡献代码
===============
[English](./CONTRIBUTING_EN.md) | **中文**
[English](./CONTRIBUTING_EN.md) | **中文(简体)** | [中文(繁體)](./CONTRIBUTING_ZH_TW.md) | [日本語](./CONTRIBUTING_JP.md)
我们很开心您想为我们的项目做出贡献!一般来说,我们对PR的审核是十分宽松的;
但是如果您可以遵守下列的规则,我们可以更快地完成审核。
@@ -21,7 +21,7 @@
在开始开发之前,您首先需要拥有以下软件作为开发环境:
- `git`
- `JDK 21 或更高版本`
- `JDK 25 或更高版本`
特别提醒:在操作前,您需要启用系统和Git的长路径支持,以下为部分平台的相关描述。
@@ -41,7 +41,7 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
1. 将你的仓库 clone 到本地;
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyAllPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyAllPatches`
3. 在执行操作后,仓库根目录下应该存在以下目录对: `lophine-api``lophine-server` `luminol-api``luminol-server` `folia-api``folia-server` 以及 `paper-api``paper-server`(下文称作 `*-api``*-server` );
3. 在执行操作后,仓库根目录下应该存在以下目录对: `lophine-api``lophine-server` , `folia-api``folia-server` 以及 `paper-api``paper-server`(下文称作 `*-api``*-server` );
4. 进入 仓库根目录下的 `*-api``*-server` 文件夹进行修改。
以下为对上述各个文件夹的简单描述,详细描述可以参考[这里](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md)
@@ -49,14 +49,12 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
1. API部分
- `lophine-api` :对新增API的修改
- `luminol-api` :对luminol-API的修改应当在此文件夹下进行
- `folia-api` :对folia-API的修改应当在此文件夹下进行
- `paper-api` :对paper-API/spigot-API/bukkit-API的修改应该在此文件夹下进行
2. Server部分
- `lophine-server` :对Minecraft原版服务器的修改和新增文件应当在此文件夹下进行
- `luminol-server` :对luminol-server的修改应当在此文件夹下进行
- `folia-server` :对folia-Server的修改应当在此文件夹下进行
- `paper-server` :对于paper对服务器逻辑的修改应当在此文件夹下进行
@@ -64,7 +62,7 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
- 在应用补丁前,基点将会指向未被更改的源码
- 在基点后的每一个提交都是一个补丁
- 只有在 Luminol 最后一个提交后的提交才会被视为 lophine 补丁
- 只有在 Folia 最后一个提交后的提交才会被视为 lophine 补丁
## 增加补丁
@@ -90,3 +88,13 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在lophine新建文件的补丁(注意不要提交);
5. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁;
6. 将修改后的补丁 PR 发回储存库。
## 为配置项提供本地化的注释支持
1.`lophine-server/src/main/resources/assets/lophine/lang` 目录下创建或修改相应的语言文件,添加本地化的注释;
- 文件的名字应当符合 `https://minecraft.wiki/w/Language` 页面下的格式,如 `en_us` `zh_cn` `zh_hk` `zh_tw`,文件以 `json` 为格式类型;
2. 运行 Gradle 任务 `sortLangKeys` 来对你的语言文件内容进行重排序;
3. 使用 `git commit -m <提交信息>` 进行提交;
4. 将你修改的文件进行推送。
这样做以后,你就可以将你的修改进行 PR 提交。
+14 -6
View File
@@ -1,7 +1,7 @@
Contributing to Lophine
=======================
**English** | [中文](./CONTRIBUTING.md)
**English** | [中文(简体)](./CONTRIBUTING.md) | [中文(繁體)](./CONTRIBUTING_ZH_TW.md) | [日本語](./CONTRIBUTING_JP.md)
We're glad that you want to contribute to our project!
In general, our review of pull requests is very lenient.
@@ -23,7 +23,7 @@ See also [This issue](https://github.com/isaacs/github/issues/1681), and then yo
Before coding, you need these pieces of software / tools as Dev Environment.
- `git`
- `JDK 21 or higher`
- `JDK 25 or higher`
PS: You need to enable long path support in your System and Git before start, some of the platform's resolution here.
@@ -44,7 +44,7 @@ If you have forked the main repository, then you should follow the steps below:
1. Clone your repository to local
2. Run Gradle's `applyAllPatches` task in your IDE or terminal (You can run `./gradlew applyAllPatches` directly in terminal.)
3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `lophine-api` and `lophine-server` , `luminol-api` and `luminol-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below)
3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `lophine-api` and `lophine-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below)
4. Enter `*-api` and `*-server` directory to carry out modifications.
The following is the simple description of the aforementioned folders, detailed description can be referred to [here](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md):
@@ -52,14 +52,12 @@ The following is the simple description of the aforementioned folders, detailed
1. API part
- `lophine-api` : Modifications to the new API
- `luminol-api` : Modifications to Luminol API should be carried out in this folder
- `folia-api` : Modifications to Folia API should be carried out in this folder
- `paper-api` : Modifications to Paper API/Spigot API/Bukkit API should be carried out in this folder
2. Server part
- `lophine-server` : Changes and new files to the Minecraft vanilla server should be made in this folder
- `luminol-server` : Changes to luminol-server should be made in this folder
- `folia-server` : Changes to folia-server should be made in this folder
- `paper-server` : Modifications to the server logic for paper should be made in this folder
@@ -67,7 +65,7 @@ BTW, `*-api` and `*-server` and are not normal git repositories.
- Before applying patches, the base will point to unmodified source code.
- Every commit after the base is a patch.
- Only commits after the last commit of Luminol will be considered as Lophine patches.
- Only commits after the last commit of Folia will be considered as Lophine patches.
## Adding new patches
@@ -93,3 +91,13 @@ You can modify an existing patch by following the steps below:
4. Run Gradle's task `fixupPaperApiFilePatches` to regenerate lophine-created files to patches (PS: do not commit again before you run this task)
5. Run Gradle's task `rebuildAllServerPatches` to modify existing patches
6. Push and PR again
## Providing localized comment support for configuration entries
1. Create or modify the corresponding language file under the `lophine-server/src/main/resources/assets/lophine/lang` directory to add localized comments;
- The file name should follow the format listed on the `https://minecraft.wiki/w/Language` page, such as `en_us`, `zh_cn`, `zh_hk`, `zh_tw`. The file format is `json`;
2. Run the Gradle task `sortLangKeys` to re-sort the keys in your language file;
3. Commit your changes using `git commit -m <Commit Message>`;
4. Push your modified files to your repository.
After pushing, you can open a PR to submit your changes.
+100
View File
@@ -0,0 +1,100 @@
Lophine への貢献
===============
[English](./CONTRIBUTING_EN.md) | [中文(簡體)](./CONTRIBUTING.md) | [中文(繁體)](./CONTRIBUTING_ZH_TW.md) | **日本語**
Lophine プロジェクトに貢献していただき、ありがとうございます!一般的に、PR(プルリクエスト)のレビュー基準は比較的緩やかです。
以下のルールに従っていただければ、よりスムーズにレビューを進めることができます。
## 個人アカウントでフォークしてください
定期的に既存の PR をマージしています。軽微な問題であれば、こちらで直接修正したうえでマージする場合があります。
しかし、組織(Organization)アカウントでフォークしたリポジトリから作成された PR の場合、直接変更を加えることができないため、一度クローズしてから手動で再マージする必要が生じます。
そのため、**組織アカウントを使用してこのプロジェクトをフォークしないでください**。
組織アカウントの PR に直接変更を加えられない理由については、[こちらの Issue](https://github.com/isaacs/github/issues/1681) をご参照ください。
## 開発環境
コードを書き始める前に、以下の開発ツールと環境を準備する必要があります。
- `git`
- `JDK 25` またはそれ以降のバージョン
注意: 作業を開始する前に、OS および Git で長いパス(Long Path)のサポートを有効にしてください。一部のプラットフォームの設定手順は以下をご参照ください。
[`Windows`](https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation)
[`Git for Windows`](https://gitforwindows.org/faq.html#i-get-errors-trying-to-check-out-files-with-long-path-names)
## パッチ(Patch)システムについて
Lophine は Folia と同じパッチシステムを採用しており、修正箇所に応じて以下の 2 つのディレクトリに分かれています。
- `lophine-api` - `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API` をベースにした修正。
- `lophine-server` - Minecraft のバニラサーバーの既存ロジックに対する修正。
このパッチシステムは Git をベースに動作します。Git の基本操作についてはこちらをご覧ください:<https://git-scm.com/docs/gittutorial>
メインのリポジトリをフォークしたら、以下の手順に従って操作してください:
1. フォークしたリポジトリをローカルにクローンします。
2. お使いの IDE またはターミナルで Gradle の `applyAllPatches` タスクを実行します。ターミナルで行う場合は、直接 `./gradlew applyAllPatches` を実行できます。
3. 実行が完了すると、リポジトリのルートディレクトリに `lophine-api``lophine-server``folia-api``folia-server``paper-api``paper-server` の各ディレクトリが生成されます。
4. リポジトリのルートディレクトリ下にある対応する `*-api``*-server` フォルダに移動し、そこで修正を行います。
上記各フォルダの簡単な説明は以下の通りです。より詳細な説明は[こちら](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md)をご参照ください:
1. API 部分
- `lophine-api`:新規 API の追加や変更はここで行ってください。
- `folia-api`:Folia API に対する修正はここで行ってください。
- `paper-api`Paper API / Spigot API / Bukkit API に対する修正はここで行ってください。
2. Server 部分
- `lophine-server`:Minecraft のバニラサーバーに対する修正、および新規作成したファイルはすべてこのフォルダに配置してください。
- `folia-server`Folia Server に対する修正はここで行ってください。
- `paper-server`:Paper サーバーのロジックに基づく修正はここで行ってください。
なお、リポジトリのルートディレクトリにある `*-api``*-server` は通常の Git リポジトリではありません:
- パッチを適用する前は、ベース(Base)は未修正のソースコードを指しています。
- ベース以降のすべてのコミットが、1 つのパッチとして扱われます。
- Folia の最後のコミット以降に追加されたコミットのみが、Lophine のパッチとして扱われます。
## 新規パッチの追加
新しいパッチを追加するのは非常に簡単です。以下の手順に従ってください:
1. `*-api``*-server` 内でコードを変更します。
2. Git を使用して変更をステージングエリアに追加します(例:`git add .`。新しく作成したファイルを同時に追加しないでください)。
3. `git commit -m <コミットメッセージ>` を実行してコミットします。
4. Gradle タスク `fixupPaperApiFilePatches` を実行し、新しく作成されたファイルに対応するパッチファイルを生成します(注意:実行が完了する前にコミットしないでください)。
5. Gradle タスク `rebuildAllServerPatches` を実行し、コミットをパッチに変換します。
6. 生成されたパッチファイルを Git にコミットし、プッシュします。
上記の手順が完了したら、これらのパッチファイルを元に PR を作成して提出できます。
## パッチの修正
既存のパッチを修正する場合は、以下の手順に従ってください:
1. HEAD で直接修正を行います。
2. `git commit -a --fixup <hash>` を実行して、fixup コミットを作成します(Lophine で新しく作成したファイルの変更を一緒にコミットしないでください)。
- コミットメッセージも同時に変更したい場合は、`--fixup` の代わりに `--squash` を使用してください。
3. `git rebase -i --autosquash base` を実行して、fixup コミットを自動的にまとめます。エディタが開いたら、`:q` と入力して終了します。
4. Gradle タスク `fixupPaperApiFilePatches` を実行し、Lophine で新しく作成したファイルのパッチを再生成します(注意:実行が完了する前にコミットしないでください)。
5. Gradle タスク `rebuildAllServerPatches` を実行し、修正を既存のパッチに反映させます。
6. 修正したパッチを再度プッシュし、PR を更新します。
## 設定項目に対するローカライズされたコメントサポートの提供
1. `lophine-server/src/main/resources/assets/lophine/lang` ディレクトリ下に、対応する言語のファイルを作成または修正し、各言語に対応したコメントを追加します。
- ファイル名は <https://minecraft.wiki/w/Language> ページに記載されている言語コード(例:`en_us``zh_cn``zh_hk``zh_tw``ja_jp` など)に従って命名してください。ファイル形式は `json` です。
2. Gradle タスク `sortLangKeys` を実行し、修正した言語ファイルのキーの内容を並べ替えます。
3. `git commit -m <コミットメッセージ>` を実行してコミットします。
4. 修正したファイルをプッシュします。
上記の手順が完了したら、修正した内容を元に PR を作成して提出できます。
+100
View File
@@ -0,0 +1,100 @@
為 Lophine 貢獻程式碼
===============
[English](./CONTRIBUTING_EN.md) | [中文(簡體)](./CONTRIBUTING.md) | **中文(繁體)** | [日本語](./CONTRIBUTING_JP.md)
很高興你願意為這個專案貢獻!一般來說,我們對 PR 的審核標準相當寬鬆;
如果你可以照著下面的規則來,我們就能更快完成審核。
## 請使用個人帳號進行 Fork
我們會定期嘗試合併現有的 PR,如果內容有一些小問題,我們會直接幫你修改後合併。
但如果你的 PR 是用組織(organization)帳號 fork 出來的,我們就沒辦法直接修改你的 PR,只能先關閉、再手動合併一次。
所以,請不要用組織帳號來 fork 這個專案!
你可以參考[這個 Issue](https://github.com/isaacs/github/issues/1681),了解為什麼我們沒辦法直接修改組織帳號的 PR。
## 開發環境
在開始寫程式之前,你需要先準備好以下開發工具與環境:
- `git`
- `JDK 25` 或更新版本
特別提醒:動手之前,請先在你的作業系統與 Git 裡啟用長路徑(long path)支援,以下是部分平台的設定說明。
[`Windows`](https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation)
[`Git for Windows`](https://gitforwindows.org/faq.html#i-get-errors-trying-to-check-out-files-with-long-path-names)
## 認識 Patch(補丁)系統
Lophine 沿用了和 Folia 相同的 patch 系統,並依照修改的部分分成了兩個目錄:
- `lophine-api` - 基於 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API` 所做出的修改。
- `lophine-server` - 針對 Minecraft 原版伺服器既有邏輯所做的修改。
這套 patch 系統是以 git 為基礎運作的,你可以在這裡了解 git 的基本操作:<https://git-scm.com/docs/gittutorial>
如果你已經 fork 了主要的 repository,接下來請照以下步驟操作:
1. 把你 fork 出來的 repository clone 到本機;
2. 在你的 IDE 或終端機(terminal)裡執行 Gradle 的 `applyAllPatches` 任務;如果是在終端機裡,可以直接執行 `./gradlew applyAllPatches`
3. 執行完成後,repository 的根目錄下應該會出現以下幾組目錄: `lophine-api``lophine-server``folia-api``folia-server` 以及 `paper-api``paper-server`(以下統稱為 `*-api``*-server`);
4. 進入 repository 根目錄下對應的 `*-api``*-server` 資料夾,在裡面進行修改。
以下是對上述各個資料夾的簡單說明,更詳細的說明可以參考[這裡](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md)
1. API 部分
- `lophine-api`:新增 API 的修改請放在這裡
- `folia-api`:針對 Folia API 的修改請放在這個資料夾
- `paper-api`:對於 Paper API / Spigot API / Bukkit API 的修改請放在這個資料夾
2. Server 部分
- `lophine-server`:針對 Minecraft 原版伺服器的修改、以及新增的檔案,都請放在這個資料夾
- `folia-server`:針對 folia-server 的修改請放在這個資料夾
- `paper-server`:根據 Paper 伺服器邏輯的修改請放在這個資料夾
順帶一提,repository 根目錄下的 `*-api``*-server` 並不是一般的 git repository
- 在套用 patch 之前,base(基準點)指向的是未經修改的原始程式碼;
- base 之後的每一個 commit,都會被視為一個 patch
- 只有在 Folia 最後一個 commit 之後的 commit,才會被視為是 Lophine 的 patch。
## 新增 Patch
依照以下步驟新增一個 patch 非常簡單:
1.`*-api``*-server` 裡進行修改;
2. 用 git 把你的修改加入暫存區,例如執行 `git add .`(請不要把新建立的檔案一併加入);
3. 執行 `git commit -m <提交訊息>` 進行 commit
4. 執行 Gradle 任務 `fixupPaperApiFilePatches`,用於新建立的檔案產生對應的 patch 檔(注意:執行完之前先不要 commit);
5. 執行 Gradle 任務 `rebuildAllServerPatches`,用於把你的 commit 轉換成一個 patch
6. 把產生出來的 patch 檔 push 上去。
完成以上步驟後,你就可以拿這些 patch 檔開 PR 提交了。
## 修改 Patch
你可以用以下方法來修改一個既有 patch 的內容:
1. 直接在 HEAD 上進行修改;
2. 執行 `git commit -a --fixup <hash>` ,做一個 fixup commit(請不要把 Lophine 新建立的檔案的修改一併 commit 進去);
- 如果你想順便修改 commit 訊息,可以用 `--squash` 取代 `--fixup`
3. 執行 `git rebase -i --autosquash base` ,進行自動 rebase,接著只要輸入 `:q` 關掉確認頁面即可;
4. 執行 Gradle 任務 `fixupPaperApiFilePatches`,用於重新產生 Lophine 新建立檔案的 patch(注意:執行完之前先不要 commit);
5. 執行 Gradle 任務 `rebuildAllServerPatches`,把修改套用到既有的 patch 上;
6. 把修改後的 patch 重新 push 回去,再開一次 PR。
## 為設定項目提供本地化的注解支援
1.`lophine-server/src/main/resources/assets/lophine/lang` 目錄下新增或修改對應語言的檔案,加入本地化的注解;
- 檔名請依照 <https://minecraft.wiki/w/Language> 頁面上列出的語言代碼來命名,例如 `en_us``zh_cn``zh_hk``zh_tw`,檔案格式為 `json`
2. 執行 Gradle 任務 `sortLangKeys`,把你修改的語言檔內容重新排序;
3. 執行 `git commit -m <提交訊息>` 進行 commit
4. 把你修改的檔案 push 上去。
完成以上步驟後,你就可以拿修改後的內容開 PR 提交了。
+89
View File
@@ -0,0 +1,89 @@
### Carpet 原版
| 规则 | 状态 | 说明 |
| --- | --- | --- |
| `language` | 已映射 | 转发到 `lophine.function.language.lang` |
| `commandTick` | 已映射 | 转发到现有的 tick 指令补丁 |
| `creativeNoClip` | 已映射 | 转发到 Lophine 的创造飞行穿墙实现 |
| `ctrlQCraftingFix` | 结构等价 | 当前的合成与切石机菜单已经自带修复后的 Ctrl+Q 结果槽丢弃行为 |
| `placementRotationFix` | 已移植 | 放置朝向判断可使用玩家身体朝向而不是头部旋转 |
| `tntDoNotUpdate` | 已移植 | 新放置的 TNT 不会再因放置时更新而自动点燃 |
| `explosionNoBlockDamage` | 已移植 | 爆炸仍会伤害实体,但不会破坏方块 |
| `interactionUpdates` | 已移植 | 玩家交互和破坏方块时可以在不触发邻居更新与形状更新的情况下运行 |
| `xpNoCooldown` | 已移植 | 经验球可以在同一 tick 内被连续吸收,不再有拾取冷却 |
| `viewDistance` | 已移植 | 专用服务器启动视距会被兼容配置覆盖 |
| `fastRedstoneDust` | 已移植 | 规则启用时,红石粉更新会统一走 Alternate Current 快速更新后端 |
| `lagFreeSpawning` | 已移植 | 自然生成会使用轻量碰撞检查与预构造实体路径 |
| `defaultLoggers` | 已移植 | 按 Carpet 默认订阅语义为玩家启用 HUD logger,当前支持 `tps``mobcaps``counter` |
| `commandPlayer` | 已映射 | 当前由同一套 `/bot` 假人能力承接 |
| `hopperCounters` | 已映射 | 转发到 Lophine 的羊毛漏斗计数器 |
### Carpet TIS Addition
| 规则 | 状态 | 说明 |
| --- | --- | --- |
| `yeetUpdateSuppressionCrash` | 已映射 | 转发到同一套 Lophine 崩溃修复逻辑 |
| `dustTrapdoorReintroduced` | 已映射 | 转发到 `lophine.experiment.redstone.redstone-ignore-upwards-update` |
| `shulkerBoxCCEReintroduced` | 已映射 | 转发到 `lophine.experiment.redstone.cce-update-suppression` |
| `instantBlockUpdaterReintroduced` | 已映射 | 转发到 `lophine.experiment.redstone.instant-block-updater` |
| `optimizedDragonRespawn` | 已映射 | 转发到 Luminol 的末影龙重生优化 |
| `antiSpamDisabled` | 已移植 | 在 `ServerGamePacketListenerImpl` 中关闭聊天和创造丢物防刷屏限制 |
| `blockPlacementIgnoreEntity` | 已移植 | 创造模式放置方块时忽略实体碰撞检查 |
| `creativeOpenContainerForcibly` | 已移植 | 创造玩家可以强制打开被阻挡的箱子、末影箱和潜影盒 |
| `observerNoDetection` | 已移植 | 观察者的检测触发会在发出脉冲前被取消 |
| `creativeNoItemCooldown` | 已移植 | 创造玩家不会应用物品冷却 |
| `totallyNoBlockUpdate` | 已移植 | 邻居更新和形状更新会在 `NeighborUpdater` 中被统一短路 |
| `tiscmNetworkProtocol` | 已移植 | 原生 `tiscm:network/v1` 握手与数据包协商已经通过专用 Leaves 协议接入 |
| `optimizedTNTHighPriority` | 结构等价 | 当前 `ServerExplosion` 路径已经运行在优化过的服务端爆炸实现上 |
| `tntIgnoreRedstoneSignal` | 已移植 | TNT 在自动点燃判断时忽略红石信号 |
| `tntDupingFix` | 已移植 | 活塞复制 TNT 的路径现在由 `PistonBaseBlock` 中的兼容规则直接控制 |
| `clientSettingsLostOnRespawnFix` | 已移植 | 玩家上一次的客户端设置会在 `ServerPlayer.restoreFrom` 中恢复 |
| `entityInstantDeathRemoval` | 已移植 | 已死亡生物不会再保留原版的 20gt 延迟,而是立即移除 |
| `farmlandTrampledDisabled` | 已移植 | 耕地不会再因实体踩踏而变回泥土 |
| `yeetOutOfOrderChatKick` | 已移植 | 乱序的签名聊天不会再破坏安全聊天链 |
| `tickCommandPermission` | 已移植 | `/tick` 的权限等级可通过兼容配置调整 |
| `tickFreezeCommandToggleable` | 已移植 | 已冻结时再次执行 `/tick freeze` 会切换回运行状态 |
| `syncServerMsptMetricsData` | 已移植 | 实时 MSPT 样本会通过原生 TISCM 协议通道广播 |
| `microTiming` | 结构等价 | 当前 Folia 的区块级性能分析与计时钩子已经提供对应的服务端观测能力 |
| `optimizedFastEntityMovement` | 结构等价 | Moonrise/Paper 的快速实体移动碰撞优化已经是基础运行时的一部分 |
| `optimizedHardHitBoxEntityCollision` | 结构等价 | Moonrise/Paper 的硬碰撞箱实体碰撞优化已经是基础运行时的一部分 |
| `tntFuseDuration` | 已移植 | 可配置的 TNT 引信时长已接入 NMS TNT 逻辑 |
| `fakePlayerTicksLikeRealPlayer` | 已映射 | 转发到 Leaves 的假人网络阶段 tick 行为 |
| `hopperCountersUnlimitedSpeed` | 已映射 | 转发到不限速计数器模式 |
### Carpet Org Addition
| 规则 | 状态 | 说明 |
| --- | --- | --- |
| `hopperNoItemCost` | 已移植 | 漏斗上方放置羊毛时,可在传输后恢复被推出的物品堆,实现零消耗供给线 |
| `simpleInGameCalculator` | 已移植 | 以 `=` 开头的聊天内容会作为简单计算表达式私聊回复 |
### Carpet AMS Addition
| 规则 | 状态 | 说明 |
| --- | --- | --- |
| `amsUpdateSuppressionCrashFix` | 已映射 | 转发到 Lophine 现有的更新抑制崩溃修复 |
| `creativeOneHitKill` | 已移植 | 创造玩家可通过 `Player.attack` 瞬间击杀附近符合条件的目标 |
| `bambooModelNoOffset` | 已移植 | 竹子和竹笋始终返回零模型偏移 |
| `carpetAlwaysSetDefault` | 结构等价 | 兼容配置默认值已经会在 `ConfigsInstance.preLoadConfig` 中被写入 |
| `powerfulExpMending` | 已移植 | 经验拾取会修复玩家整个背包内所有受损的经验修补物品 |
| `sensibleEnderman` | 已移植 | 末影人仅会在规则开启时拾取南瓜和西瓜 |
| `shulkerGolem` | 已移植 | 潜影盒上方放置雕刻南瓜时可以召唤潜影贝 |
| `preventEndSpikeRespawn` | 已移植 | 末影龙重生时会跳过黑曜石柱重建和柱顶水晶重建 |
| `betterCraftableBoneBlock` | 已移植 | 向配方管理器注入 AMS 的替代骨块配方 |
| `betterCraftableDispenser` | 已移植 | 向配方管理器注入 AMS 的替代发射器配方 |
| `fakePlayerDefaultSurvivalMode` | 已移植 | 新创建的假人可以被强制设为生存模式,而不是沿用服务器默认游戏模式 |
| `fakePlayerInteractLikeClient` | 已移植 | 假人与盔甲架交互时会先按真实客户端方式回退,再进入普通实体交互 |
| `fakePlayerAutoReplenishmentFormShulkerBox` | 已移植 | 假人自动补货现在可以从背包里的潜影盒中抽取匹配物品 |
### Lophine 扩展承接
| 规则 | 状态 | 说明 |
| --- | --- |----------------------------------|
| `commandBot` | 已映射 | 启用 Lophine `/bot` |
| `fakePlayerResident` | 已映射 | 转发到 Lophine 的假人常驻模式 |
| `openFakePlayerInventory` | 已映射 | 转发到 Lophine 的假人背包打开功能 |
| `fakePlayerAutoReplaceTool` | 已映射 | 为现有自动换工具逻辑增加了新开关 |
| `fakePlayerAutoReplenishment` | 已映射 | 为现有自动补货逻辑增加了新开关 |
| `fakePlayerReloadAction` | 已映射 | 为假人动作持久化增加了新开关 |
| `fakePlayerAutoFish` | 已移植 | 手持鱼竿的假人会自动抛竿和收杆,除非显式执行 `fish` 动作 |
+10 -5
View File
@@ -1,10 +1,15 @@
group=fun.bm.lophine
version=1.21.8-R0.1-SNAPSHOT
mcVersion=1.21.8
release=2
# 0 for skip release, 1 for pre-release, 2 for release
mcVersion=26.2
apiVersion=26.2
channel=STABLE
clipVersion=1.0.1
weightVersion=1.0.0
# true for release, false for skip release, pre for pre-release
release=true
# true for push to repo, false for skip push repo, auto for detect by release value
pushRepo=auto
luminolRef=750a7acb9c0076c069b9abc1919f7695665f1abf
foliaRef=57f643f10e0a9d01024773232d38ae666067d593
org.gradle.configuration-cache=true
org.gradle.caching=true
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+36 -11
View File
@@ -1,27 +1,52 @@
--- a/luminol-api/build.gradle.kts
+++ b/luminol-api/build.gradle.kts
@@ -103,20 +_,24 @@
--- a/folia-api/build.gradle.kts
+++ b/folia-api/build.gradle.kts
@@ -53,6 +_,7 @@
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
api("org.slf4j:slf4j-api:$slf4jVersion")
api("com.mojang:brigadier:1.3.10")
+ api("io.sentry:sentry:8.0.0-rc.2") // Pufferfish
// Deprecate bungeecord-chat in favor of adventure
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") {
@@ -105,17 +_,21 @@
java {
srcDir(generatedDir)
srcDir(file("../paper-api/src/main/java"))
srcDir(file("../folia-api/src/main/java"))
+ srcDir(file("../luminol-api/src/main/java"))
+ srcDir(file("../folia-api/src/main/java"))
}
resources {
srcDir(file("../paper-api/src/main/resources"))
srcDir(file("../folia-api/src/main/resources"))
+ srcDir(file("../luminol-api/src/main/resources"))
+ srcDir(file("../folia-api/src/main/resources"))
}
}
test {
java {
srcDir(file("../paper-api/src/test/java"))
srcDir(file("../folia-api/src/test/java"))
+ srcDir(file("../luminol-api/src/test/java"))
+ srcDir(file("../folia-api/src/test/java"))
}
resources {
srcDir(file("../paper-api/src/test/resources"))
srcDir(file("../folia-api/src/test/resources"))
+ srcDir(file("../luminol-api/src/test/resources"))
+ srcDir(file("../folia-api/src/test/resources"))
}
}
}
@@ -259,3 +_,19 @@
tasks.check {
dependsOn(scanJarForBadCalls)
}
+
+// Pufferfish Start
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
+// Pufferfish End
+
+// Lophine start - Hide unnecessary warnings
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("-Xlint:-module")
+ compilerArgs.add("-Xlint:-removal")
+ compilerArgs.add("-Xlint:-dep-ann")
+}
+// Lophine end
@@ -5,14 +5,24 @@ Subject: [PATCH] Rebrand to Lophine
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index db5e2f10278c20286779362cfdfadb2f42c724e0..c18c0cb45a193883aa12b5d1abe690e95d289f82 100644
index 56a5877181e8d37518b178c95155e892c442e96d..ebe0290bf0235af2ba353ac1f74b29080daebba4 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -29,6 +29,7 @@ public interface ServerBuildInfo {
@@ -19,6 +19,17 @@ public interface ServerBuildInfo {
*/
Key BRAND_LUMINOL_ID = Key.key("luminolmc", "luminol");
// Luminol end
+ Key BRAND_LOPHINE_ID = Key.key("luminolmc", "lophine"); // Lophine
Key BRAND_PAPER_ID = Key.key("papermc", "paper");
+ // Lophine start
+ /**
+ * The brand id for folia
+ */
+ Key BRAND_FOLIA_ID = Key.key("papermc", "folia");
+ /**
+ * The brand id for Lophine.
+ */
+ Key BRAND_LOPHINE_ID = Key.key("lophinelabs", "lophine");
+ // Lophine end
+
/**
* Gets the {@code ServerBuildInfo}.
*
@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sun, 14 Jun 2026 18:10:20 +0800
Subject: [PATCH] Luminol Config System
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 067d901c69a54c4b6ae5a00488f0dacc5fde7961..209d1968f4bff3b33785fd8bfbeea5ae231e581a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2774,6 +2774,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
// Paper end - API to check if the server is sleeping
+
+ // Luminol start - Luminol Config API
+ me.earthme.luminol.api.config.LuminolConfigsInstance getLuminolConfigs(String name);
+ me.earthme.luminol.api.config.LuminolConfigBuilder getLuminolConfigBuilder();
+ // Luminol end - Luminol Config API
+
// Folia start - region TPS API
/**
* Gets the TPS from the region which owns the specified location, or {@code null} if no region owns
@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bacteriawa <A3167717663@hotmail.com>
Date: Sat, 8 Aug 2026 01:25:33 +0800
Subject: [PATCH] KioCG Chunk API
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
index d873b78f6935a23ff8f6092b80968267b182cc0f..b4323370859dd4d9e86614484cdb9d2e35c45b40 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -392,4 +392,6 @@ public interface Chunk extends PersistentDataHolder {
*/
UNLOADED;
}
+
+ long getChunkHotAvg(); // KioCG
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 65e83e171ab4c514662b9344e08f7065fa9efaa1..274af6397b5f7c0b6787e2669de80e54858950a2 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -4050,4 +4050,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* clearing any fixed pose in the process.
*/
void unsetFixedPose();
+
+ long getNearbyChunkHot(); // KioCG
}
@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 12:22:53 +0800
Subject: [PATCH] Disable timings warn msg and commands
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
index 89017af09ce32e7a66014fc3aeb50155921252a5..b862779b48176dd7e67a2f1a3e7f24bc8c84e993 100644
--- a/src/main/java/co/aikar/timings/Timings.java
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -147,7 +147,7 @@ public final class Timings {
public static void setTimingsEnabled(boolean enabled) {
enabled = false; // Folia - region threading - disable timings
if (enabled && !warnedAboutDeprecationOnEnable) {
- Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
+ // Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage())); // Luminol - Disable timings warn msg and commands
warnedAboutDeprecationOnEnable = true;
}
}
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index ad1330d87223dfcf3c9da40aa5ece8c21141f0d6..22edf161ba1ca8c31140e25e8c4fe1503c44dba8 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -34,7 +34,7 @@ public class SimpleCommandMap implements CommandMap {
final ReloadCommand reload = new ReloadCommand("reload");
this.knownCommands.put("bukkit:reload", reload);
this.knownCommands.put("bukkit:rl", reload);
- register("bukkit", new co.aikar.timings.TimingsCommand("timings"));
+ //register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Luminol - Disable timings warn msg and commands
}
public void setFallbackCommands() {
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 457e75bbecb70ac3da4c21382f97d68de5a00547..cf22ea227f6dcc13702fb5f6f94bba5b6e326b97 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -960,7 +960,7 @@ public final class SimplePluginManager implements PluginManager {
*/
@Deprecated(forRemoval = true)
public void useTimings(boolean use) {
- co.aikar.timings.Timings.setTimingsEnabled(use); // Paper
+ // co.aikar.timings.Timings.setTimingsEnabled(use); // Paper // Luminol - Disable timings warn msg and commands
}
// Paper start
@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Thu, 23 Jan 2025 12:04:04 +0800
Subject: [PATCH] Force disable reload command
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index 22edf161ba1ca8c31140e25e8c4fe1503c44dba8..50384eb221ad96e766b91335ff57b082410885e9 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -31,9 +31,9 @@ public class SimpleCommandMap implements CommandMap {
}
private void setDefaultCommands() {
- final ReloadCommand reload = new ReloadCommand("reload");
- this.knownCommands.put("bukkit:reload", reload);
- this.knownCommands.put("bukkit:rl", reload);
+ //final ReloadCommand reload = new ReloadCommand("reload"); // Luminol - Force disable reload command
+ //this.knownCommands.put("bukkit:reload", reload); // Luminol - Force disable reload command
+ //this.knownCommands.put("bukkit:rl", reload); // Luminol - Force disable reload command
//register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Luminol - Disable timings warn msg and commands
}
@@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 13:27:38 +0800
Subject: [PATCH] Pufferfish: Sentry
As part of: Pufferfish
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index cf22ea227f6dcc13702fb5f6f94bba5b6e326b97..71ef6055df30506bb0d6648a2300d1cab7b0d026 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -596,7 +596,9 @@ public final class SimplePluginManager implements PluginManager {
// Paper start
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, msg, ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
}
// Paper end
@@ -666,9 +668,11 @@ public final class SimplePluginManager implements PluginManager {
));
}
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setEventContext(event, registration); // Pufferfish
// Paper start - error reporting
String msg = "Could not pass event " + event.getEventName() + " to " + registration.getPlugin().getDescription().getFullName();
server.getLogger().log(Level.SEVERE, msg, ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removeEventContext(); // Pufferfish
if (!(event instanceof com.destroystokyo.paper.event.server.ServerExceptionEvent)) { // We don't want to cause an endless event loop
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 9023a39c6481710478747482f0b16c21274afd15..0755065f86aba3ef5ecdf045620878eb045f4999 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -329,7 +329,13 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(true);
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
+ // Paper start - Disable plugins that fail to load
+ this.server.getPluginManager().disablePlugin(jPlugin);
+ return;
+ // Paper end
}
// Perhaps abort here, rather than continue going, but as it stands,
@@ -354,7 +360,9 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(false);
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, "Error occurred while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
}
if (cloader instanceof PluginClassLoader) {
@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 14:00:28 +0800
Subject: [PATCH] Pufferfish: SIMD Utilities
As part of: Pufferfish
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index 76ae2750ff7b04a281d4b794dc1f48dd832db2b6..fc9cd106b1ed2e92aced783e9cb0bc8867828df3 100644
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
@@ -35,7 +35,7 @@ public final class MapPalette {
}
@NotNull
- static final Color[] colors = {
+ public static final Color[] colors = { // Luminol - package-private -> public
// Start generate - MapPalette#colors
new Color(0x00000000, true),
new Color(0x00000000, true),
@@ -394,9 +394,11 @@ public final class MapPalette {
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
+ if ((mapColorCache != null && mapColorCache.isCached()) || !gg.pufferfish.pufferfish.simd.SIMDDetection.isEnabled) { // Luminol - Pufferfish - vectorized map color conversion
for (int i = 0; i < pixels.length; i++) {
result[i] = matchColor(new Color(pixels[i], true));
}
+ } else gg.pufferfish.pufferfish.simd.VectorMapPalette.matchColorVectorized(pixels, result); // Luminol - Pufferfish - vectorized map color conversion
return result;
}
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Mon, 27 Jan 2025 13:01:59 +0800
Subject: [PATCH] Tick regions api
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index bf2f7c4959f9f2cd43bbd4d4310e7eedf10cf892..bccb33456d84384bd90887822e16cbad65986106 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4719,4 +4719,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
}
}
+
+ // Luminol start - Tick regions api
+ me.earthme.luminol.api.ThreadedRegionizer getThreadedRegionizer();
+ // Luminol end - Tick regions api
}
@@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Wed, 22 Apr 2026 12:59:08 +0800
Subject: [PATCH] Leaves: Leaves plugin
Co-authored by: MC_XiaoHei <xiaohei.xor7@outlook.com>
As part of: Leaves (https://github.com/HyacinthHaru/Leaves/blob/90080d238e2fcfc14a9293150dc351a4f0f696e6/leaves-api/paper-patches/features/0009-Leaves-Plugin.patch)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 325d797766de527268eb18bcf9db594ca3a0c519..e922a0eefb03db5e33f3306aaea558b6ed61b42a 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -3045,4 +3045,10 @@ public final class Bukkit {
public static void restart() {
server.restart();
}
+
+ // Leaves start - Feature API
+ public static org.leavesmc.leaves.plugin.FeatureManager getFeatureManager() {
+ return server.getFeatureManager();
+ }
+ // Leaves end - Feature API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 209d1968f4bff3b33785fd8bfbeea5ae231e581a..ac19fd1b6b8e48313c79d9fb26c3df50f67b64b8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2780,6 +2780,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
me.earthme.luminol.api.config.LuminolConfigBuilder getLuminolConfigBuilder();
// Luminol end - Luminol Config API
+ // Leaves start - Feature API
+ org.leavesmc.leaves.plugin.FeatureManager getFeatureManager();
+ // Leaves End - Feature API
+
// Folia start - region TPS API
/**
* Gets the TPS from the region which owns the specified location, or {@code null} if no region owns
@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Thu, 12 Jun 2025 08:00:15 +0800
Subject: [PATCH] Purpur: Lobotomize stuck villagers
Co-authored by: William Blake Galbreath <Blake.Galbreath@GMail.com>
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/minecraft-patches/features/0001-Ridables.patch)
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index a2024b5dda030a7724c13b2446224903ae837339..71f34a40b136f7f08a4820056c00692b986f63bd 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -405,4 +405,13 @@ public interface Villager extends AbstractVillager {
* Demand is still updated even if all events are canceled.
*/
public void restock();
+ // Purpur start
+
+ /**
+ * Check if villager is currently lobotomized
+ *
+ * @return True if lobotomized
+ */
+ boolean isLobotomized();
+ // Purpur end
}
@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Fri, 5 Jun 2026 09:12:20 +0800
Subject: [PATCH] World load/unload APIs
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index ac19fd1b6b8e48313c79d9fb26c3df50f67b64b8..c037307f926d64bac3b51a91aa61f63d0357770c 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -775,6 +775,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @throws IllegalStateException when {@link #isTickingWorlds() isTickingWorlds} is true
*/
public boolean unloadWorld(@NotNull World world, boolean save);
+ // Luminol start - Async world unloading api
+
+ /**
+ * Unloads the given world asynchronously
+ *
+ * @param world the world to unload
+ * @param save whether to save the chunks before unloading
+ * @param callback the callback to accept the result, true if successful, false otherwise
+ */
+ public void unloadWorld(World world, boolean save, java.util.concurrent.CompletableFuture<Boolean> callback);
+ // Luminol end
/**
* Gets the world that players respawn in.
@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Mon, 11 May 2026 10:47:42 +0800
Subject: [PATCH] Add cancel task by task id in FoliaGlobalRegionScheduler
diff --git a/src/main/java/io/papermc/paper/threadedregions/scheduler/GlobalRegionScheduler.java b/src/main/java/io/papermc/paper/threadedregions/scheduler/GlobalRegionScheduler.java
index 57455aca80ecc458b96b44c086cea94ddcecae47..763d27d303b9a588526445c453e07f5886534e82 100644
--- a/src/main/java/io/papermc/paper/threadedregions/scheduler/GlobalRegionScheduler.java
+++ b/src/main/java/io/papermc/paper/threadedregions/scheduler/GlobalRegionScheduler.java
@@ -55,4 +55,10 @@ public interface GlobalRegionScheduler {
* @param plugin Specified plugin.
*/
void cancelTasks(@NotNull Plugin plugin);
+
+ /**
+ * Attempts to cancel the specified task.
+ * @param taskId The task id.
+ */
+ void cancelTask(final int taskId);
}
@@ -0,0 +1,47 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bacteriawa <A3167717663@hotmail.com>
Date: Sat, 30 Aug 2025 16:51:26 +0800
Subject: [PATCH] Leaves: Add fakeplayer api
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As a part of : Leaves (https://github.com/LeavesMC/Leaves)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index e922a0eefb03db5e33f3306aaea558b6ed61b42a..7120bbea89c1c240b09562c73833f21a9980886f 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -3051,4 +3051,15 @@ public final class Bukkit {
return server.getFeatureManager();
}
// Leaves end - Feature API
+
+ // Leaves start - Bot API
+ /**
+ * Returns a bot manager.
+ *
+ * @return Bot Manager
+ */
+ public static @NotNull org.leavesmc.leaves.entity.bot.BotManager getBotManager() {
+ return server.getBotManager();
+ }
+ // Leaves end - Bot API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c037307f926d64bac3b51a91aa61f63d0357770c..6c91cabdcacf7a9bf6421fbb7d52aa17516100f8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2825,4 +2825,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
double @Nullable [] getRegionTPS(@NotNull World world, int chunkX, int chunkZ);
// Folia end - region TPS API
+
+ // Leaves start - Bot API
+ /**
+ * Returns a bot manager.
+ *
+ * @return Bot Manager
+ */
+ @NotNull org.leavesmc.leaves.entity.bot.BotManager getBotManager();
+ // Leaves end - Bot API
}
@@ -0,0 +1,37 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sun, 16 Nov 2025 15:50:28 +0800
Subject: [PATCH] Leaves: Replay Mod API
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As a part of : Leaves (https://github.com/LeavesMC/Leaves)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 7120bbea89c1c240b09562c73833f21a9980886f..b114df0dde2e5bede7bb2956359fdd4ca25ac3da 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -3062,4 +3062,10 @@ public final class Bukkit {
return server.getBotManager();
}
// Leaves end - Bot API
+
+ // Leaves start - Photographer API
+ public static @NotNull org.leavesmc.leaves.entity.photographer.PhotographerManager getPhotographerManager() {
+ return server.getPhotographerManager();
+ }
+ // Leaves end - Photographer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 6c91cabdcacf7a9bf6421fbb7d52aa17516100f8..e6295c4bb86286aa893b55b77ddbfb2f63fdd05c 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2834,4 +2834,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull org.leavesmc.leaves.entity.bot.BotManager getBotManager();
// Leaves end - Bot API
+
+ // Leaves start - Photographer API
+ @NotNull org.leavesmc.leaves.entity.photographer.PhotographerManager getPhotographerManager();
+ // Leaves end - Photographer API
}
@@ -0,0 +1,181 @@
/*
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
*
* Pufferfish is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pufferfish is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
*/
package gg.pufferfish.pufferfish.sentry;
import com.google.gson.Gson;
import org.apache.logging.log4j.ThreadContext;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredListener;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Map;
import java.util.TreeMap;
public class SentryContext {
private static final Gson GSON = new Gson();
public static void setPluginContext(@Nullable Plugin plugin) {
if (plugin != null) {
ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
ThreadContext.put("pufferfishsentry_pluginversion", plugin.getPluginMeta().getVersion());
}
}
public static void removePluginContext() {
ThreadContext.remove("pufferfishsentry_pluginname");
ThreadContext.remove("pufferfishsentry_pluginversion");
}
public static void setSenderContext(@Nullable CommandSender sender) {
if (sender != null) {
ThreadContext.put("pufferfishsentry_playername", sender.getName());
if (sender instanceof Player player) {
ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
}
}
}
public static void removeSenderContext() {
ThreadContext.remove("pufferfishsentry_playername");
ThreadContext.remove("pufferfishsentry_playerid");
}
public static void setEventContext(Event event, RegisteredListener registration) {
setPluginContext(registration.getPlugin());
try {
// Find the player that was involved with this event
Player player = null;
if (event instanceof PlayerEvent) {
player = ((PlayerEvent) event).getPlayer();
} else {
Class<? extends Event> eventClass = event.getClass();
Field playerField = null;
for (Field field : eventClass.getDeclaredFields()) {
if (field.getType().equals(Player.class)) {
playerField = field;
break;
}
}
if (playerField != null) {
playerField.setAccessible(true);
player = (Player) playerField.get(event);
}
}
if (player != null) {
setSenderContext(player);
}
} catch (Exception ignored) {
} // We can't really safely log exceptions.
ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
}
public static void removeEventContext() {
removePluginContext();
removeSenderContext();
ThreadContext.remove("pufferfishsentry_eventdata");
}
private static Map<String, String> serializeFields(Object object) {
Map<String, String> fields = new TreeMap<>();
fields.put("_class", object.getClass().getName());
for (Field declaredField : object.getClass().getDeclaredFields()) {
try {
if (Modifier.isStatic(declaredField.getModifiers())) {
continue;
}
String fieldName = declaredField.getName();
if (fieldName.equals("handlers")) {
continue;
}
declaredField.setAccessible(true);
Object value = declaredField.get(object);
if (value != null) {
fields.put(fieldName, value.toString());
} else {
fields.put(fieldName, "<null>");
}
} catch (Exception ignored) {
} // We can't really safely log exceptions.
}
return fields;
}
public static class State {
private Plugin plugin;
private Command command;
private String commandLine;
private Event event;
private RegisteredListener registeredListener;
public Plugin getPlugin() {
return plugin;
}
public void setPlugin(Plugin plugin) {
this.plugin = plugin;
}
public Command getCommand() {
return command;
}
public void setCommand(Command command) {
this.command = command;
}
public String getCommandLine() {
return commandLine;
}
public void setCommandLine(String commandLine) {
this.commandLine = commandLine;
}
public Event getEvent() {
return event;
}
public void setEvent(Event event) {
this.event = event;
}
public RegisteredListener getRegisteredListener() {
return registeredListener;
}
public void setRegisteredListener(RegisteredListener registeredListener) {
this.registeredListener = registeredListener;
}
}
}
@@ -0,0 +1,53 @@
/*
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
*
* Pufferfish is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pufferfish is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
*/
package gg.pufferfish.pufferfish.simd;
import jdk.incubator.vector.FloatVector;
import jdk.incubator.vector.IntVector;
import jdk.incubator.vector.VectorSpecies;
import org.slf4j.Logger;
/**
* Basically, java is annoying, and we have to push this out to its own class.
*/
@Deprecated
public class SIMDChecker {
@Deprecated
public static boolean canEnable(Logger logger) {
try {
SIMDDetection.testRun = true;
VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
logger.info("Max SIMD vector size on this system is {} bits (int)", ISPEC.vectorBitSize());
logger.info("Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
logger.warn("SIMD is not properly supported on this system!");
return false;
}
return true;
} catch (NoClassDefFoundError | Exception ignored) {
} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
return false;
}
}
@@ -0,0 +1,53 @@
/*
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
*
* Pufferfish is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pufferfish is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
*/
package gg.pufferfish.pufferfish.simd;
import org.slf4j.Logger;
@Deprecated
public class SIMDDetection {
public static boolean isEnabled = false;
public static boolean testRun = false;
@Deprecated
public static boolean canEnable(Logger logger) {
try {
return SIMDChecker.canEnable(logger);
} catch (NoClassDefFoundError | Exception ignored) {
return false;
}
}
@Deprecated
public static int getJavaVersion() {
// https://stackoverflow.com/a/2591122
String version = System.getProperty("java.version");
if (version.startsWith("1.")) {
version = version.substring(2, 3);
} else {
int dot = version.indexOf(".");
if (dot != -1) {
version = version.substring(0, dot);
}
}
version = version.split("-")[0]; // Azul is stupid
return Integer.parseInt(version);
}
}
@@ -0,0 +1,101 @@
/*
* This file is part of Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
*
* Pufferfish is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pufferfish is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Pufferfish. If not, see <https://www.gnu.org/licenses/>.
*/
package gg.pufferfish.pufferfish.simd;
import jdk.incubator.vector.FloatVector;
import jdk.incubator.vector.IntVector;
import jdk.incubator.vector.VectorMask;
import jdk.incubator.vector.VectorSpecies;
import org.bukkit.map.MapPalette;
import java.awt.*;
@Deprecated
public class VectorMapPalette {
private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
@Deprecated
public static void matchColorVectorized(int[] in, byte[] out) {
int speciesLength = I_SPEC.length();
int i;
for (i = 0; i < in.length - speciesLength; i += speciesLength) {
float[] redsArr = new float[speciesLength];
float[] bluesArr = new float[speciesLength];
float[] greensArr = new float[speciesLength];
int[] alphasArr = new int[speciesLength];
for (int j = 0; j < speciesLength; j++) {
alphasArr[j] = (in[i + j] >> 24) & 0xFF;
redsArr[j] = (in[i + j] >> 16) & 0xFF;
greensArr[j] = (in[i + j] >> 8) & 0xFF;
bluesArr[j] = (in[i + j] >> 0) & 0xFF;
}
IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
IntVector resultIndex = IntVector.zero(I_SPEC);
VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
modificationMask = modificationMask.and(alphas.lt(128).not());
FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
for (int c = 4; c < MapPalette.colors.length; c++) {
// We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
// For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
FloatVector rMean = reds.add(compReds).div(2.0f);
FloatVector rDiff = reds.sub(compReds);
FloatVector gDiff = greens.sub(compGreens);
FloatVector bDiff = blues.sub(compBlues);
FloatVector weightR = rMean.div(256.0f).add(2);
FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
// Now we compare to the best distance we've found.
// This mask contains a "1" if better, and a "0" otherwise.
VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
// Update the result array
// We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
}
for (int j = 0; j < speciesLength; j++) {
int index = resultIndex.lane(j);
out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
}
}
// For the final ones, fall back to the regular method
for (; i < in.length; i++) {
out[i] = MapPalette.matchColor(new Color(in[i], true));
}
}
}
@@ -0,0 +1,28 @@
package me.earthme.luminol.api;
/**
* A simple package of folia's tick region state.It linked to the RegionStats of the nms part so that</br>
* You could call these methods to get the status of this tick region</br>
*/
public interface RegionStats {
/**
* Get the entity count in this tick region
*
* @return the entity count
*/
int getEntityCount();
/**
* Get the player count in this tick region
*
* @return the player count
*/
int getPlayerCount();
/**
* Get the chunk count in this tick region
*
* @return the chunk count
*/
int getChunkCount();
}
@@ -0,0 +1,61 @@
package me.earthme.luminol.api;
import org.bukkit.Location;
import org.bukkit.World;
import org.jetbrains.annotations.Nullable;
/**
* A mirror of folia's ThreadedRegion</br>
* Including some handy methods to get the information of the tick region</br>
* Note: You should call these methods inside this tick region's thread context
*/
public interface ThreadedRegion {
/**
* Get the center chunk pos of this tick region</br>
* Note:</br>
* 1.Global region will return a null value(But we don't finish the global region yet()</br>
* 2.You should call these methods inside this tick region's thread context
*
* @return The center chunk pos
*/
@Nullable
Location getCenterChunkPos();
/**
* Get the dead section percent of this tick region
* Note: </br>
* 1.Dead percent is mean the percent of the unloaded chunk count of this tick region, which is also used for determine
* that the tick region should or not check for splitting</br>
* 2.You should call these methods inside this tick region's thread context
*
* @return The dead section percent
*/
double getDeadSectionPercent();
/**
* Get the tick region data of this tick region</br>
* Note:</br>
* 1.You should call this method inside this tick region's thread context</br>
* 2.You should call these methods inside this tick region's thread context
*
* @return The tick region data
*/
TickRegionData getTickRegionData();
/**
* Get the world of this tick region</br>
* Note: Global region will return a null value too
*
* @return The world of this tick region
*/
@Nullable
World getWorld();
/**
* Get the id of the tick region</br>
*
* @return The id of the tick region
*/
long getId();
}
@@ -0,0 +1,61 @@
package me.earthme.luminol.api;
import org.bukkit.Location;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
/**
* A mirror of folia's ThreadedRegionizer
*/
public interface ThreadedRegionizer {
/**
* Get all the tick regions
*
* @return Temporary copied collection of all tick regions
*/
Collection<ThreadedRegion> getAllRegions();
/**
* Get the tick region at the given chunk coordinates
*
* @param chunkX Chunk X
* @param chunkZ Chunk Z
* @return The tick region at the given chunk coordinates
*/
@Nullable
ThreadedRegion getAtSynchronized(int chunkX, int chunkZ);
/**
* Get the tick region at the given chunk coordinates
*
* @param chunkX Chunk X
* @param chunkZ Chunk Z
* @return The tick region at the given chunk coordinates
*/
@Nullable
ThreadedRegion getAtUnSynchronized(int chunkX, int chunkZ);
/**
* Get the tick region at the given location
*
* @param pos The location
* @return The tick region at the given location
*/
@Nullable
default ThreadedRegion getAtSynchronized(@NotNull Location pos) {
return this.getAtSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
}
/**
* Get the tick region at the given location
*
* @param pos The location
* @return The tick region at the given location
*/
@Nullable
default ThreadedRegion getAtUnSynchronized(@NotNull Location pos) {
return this.getAtUnSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
}
}
@@ -0,0 +1,29 @@
package me.earthme.luminol.api;
import org.bukkit.World;
/**
* A mirror of folia's tick region data
*/
public interface TickRegionData {
/**
* Get the world it's currently holding
*
* @return the world
*/
World getWorld();
/**
* Get the current tick count
*
* @return the current tick count
*/
long getCurrentTickCount();
/**
* Get the region stats
*
* @return the region stats
*/
RegionStats getRegionStats();
}
@@ -0,0 +1,11 @@
package me.earthme.luminol.api.config;
import org.jspecify.annotations.Nullable;
public record ConfigDataPair(
String key,
Object value,
@Nullable String comment,
@Nullable String[] suggestions
) {
}
@@ -0,0 +1,82 @@
package me.earthme.luminol.api.config;
import org.jetbrains.annotations.NotNull;
import java.io.File;
/**
* Builder interface for creating {@link LuminolConfigsInstance} instances.
* <p>
* Provides multiple overloaded factory methods to construct configuration instances
* with varying levels of customization, including custom base directories,
* file names, and command names.
*/
public interface LuminolConfigBuilder {
/**
* Creates a configuration instance using the default base directory and file name.
*
* @param loader the class loader used to load configuration resources
* @param name the configuration name identifier
* @param pack the package path where configuration classes are located
* @return a new {@link LuminolConfigsInstance}
*/
LuminolConfigsInstance of(
@NotNull ClassLoader loader,
@NotNull String name,
@NotNull String pack
);
/**
* Creates a configuration instance with a custom base directory.
*
* @param loader the class loader used to load configuration resources
* @param base the base directory where the configuration file is stored
* @param name the configuration name identifier
* @param pack the package path where configuration classes are located
* @return a new {@link LuminolConfigsInstance}
*/
LuminolConfigsInstance of(
@NotNull ClassLoader loader,
@NotNull File base,
@NotNull String name,
@NotNull String pack
);
/**
* Creates a configuration instance with a custom base directory and file name.
*
* @param loader the class loader used to load configuration resources
* @param base the base directory where the configuration file is stored
* @param name the configuration name identifier
* @param file_name the configuration file name (without extension)
* @param pack the package path where configuration classes are located
* @return a new {@link LuminolConfigsInstance}
*/
LuminolConfigsInstance of(
@NotNull ClassLoader loader,
@NotNull File base,
@NotNull String name,
@NotNull String file_name,
@NotNull String pack
);
/**
* Creates a configuration instance with full customization options.
*
* @param loader the class loader used to load configuration resources
* @param base the base directory where the configuration file is stored
* @param name the configuration name identifier
* @param file_name the configuration file name (without extension)
* @param command_name the command name associated with this configuration
* @param pack the package path where configuration classes are located
* @return a new {@link LuminolConfigsInstance}
*/
LuminolConfigsInstance of(
@NotNull ClassLoader loader,
@NotNull File base,
@NotNull String name,
@NotNull String file_name,
@NotNull String command_name,
@NotNull String pack
);
}
@@ -0,0 +1,203 @@
package me.earthme.luminol.api.config;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
/**
* Interface for managing configuration instances and operations.
* Provides methods for loading, saving, modifying, and querying configuration values.
*/
public interface LuminolConfigsInstance {
/**
* Initialize the configuration subsystem for this instance.
* Implementations should load configuration files, apply defaults and
* prepare any internal caches or state needed for subsequent operations.
* This method may perform I/O and therefore can throw an {@link IOException}
* if initialization fails.
*
* @throws IOException if an I/O error occurs while initializing
*/
void initialize() throws IOException;
/**
* Reloads all configurations asynchronously
*
* @param keepComments whether to preserve existing comments in the config file
* @return CompletableFuture that completes when reload is finished
*/
@NotNull CompletableFuture<Void> reloadAsync(boolean keepComments);
/**
* Sets a configuration value by key
*
* @param key the configuration key (dot-separated path)
* @param value the value to set
* @return true if the key exists and value was set, false otherwise
*/
boolean setConfig(String key, Object value);
/**
* Saves all pending configuration changes to disk
*/
void saveConfigs();
/**
* Resets a configuration value to its default
*
* @param key the configuration key to reset
*/
void resetConfig(String key);
/**
* Gets the default value of a configuration as string
*
* @param key the configuration key
* @return the default value as string
*/
String getDefaultConfig(String key);
/**
* Gets the current value of a configuration as string
*
* @param key the configuration key
* @return the current value as string
*/
String getConfig(String key);
/**
* Gets the original (untransformed) value of a configuration
*
* @param key the configuration key
* @param <T> the expected type of the value
* @return the original configuration value
*/
<T> T getConfigOrigin(String key);
/**
* Gets available suggestions for a configuration key
*
* @param key the configuration key
* @return array of suggestion strings, or null if no suggestions available
*/
String[] getConfigSuggestions(String key);
/**
* Completes a partial configuration path by finding matching keys
*
* @param partialPath the partial path to complete
* @return list of possible completions
*/
List<String> completeConfigPath(String partialPath);
/**
* Completes a partial configuration path with specific depth
*
* @param partialPath the partial path to complete
* @param dotIndex the maximum number of dots (depth) in the result
* @return list of possible completions
*/
List<String> completeConfigPath(String partialPath, int dotIndex);
/**
* Gets all configuration paths that start with the given prefix
*
* @param currentPath the prefix to search for
* @return list of matching configuration paths
*/
List<String> getAllConfigPaths(String currentPath);
/**
* Gets all configuration data pairs without prefix filter
*
* @return set of all configuration data
*/
Set<ConfigDataPair> getAllData();
/**
* Gets configuration data pairs filtered by prefix
*
* @param prefix the prefix to filter by
* @return set of matching configuration data
*/
Set<ConfigDataPair> getData(String prefix);
/**
* Gets all configuration data pairs with full information (comments and suggestions)
*
* @return set of all configuration data with full details
*/
Set<ConfigDataPair> getAllDataFull();
/**
* Gets configuration data pairs with full information filtered by prefix
*
* @param prefix the prefix to filter by
* @return set of matching configuration data with full details
*/
Set<ConfigDataPair> getDataFull(String prefix);
/**
* Gets configuration data pairs with optional comments and suggestions
*
* @param prefix the prefix to filter by
* @param _comment whether to include comments
* @param _withSuggestions whether to include suggestions
* @return set of matching configuration data
*/
Set<ConfigDataPair> getData(String prefix, boolean _comment, boolean _withSuggestions);
/**
* Gets configuration data pairs for specified keys
*
* @param list list of configuration keys
* @return set of configuration data for the specified keys
*/
Set<ConfigDataPair> getData(List<String> list);
/**
* Gets configuration data pairs with comments for specified keys
*
* @param list list of configuration keys
* @return set of configuration data with comments
*/
Set<ConfigDataPair> getDataWithComment(List<String> list);
/**
* Gets configuration data pairs with full information for specified keys
*
* @param list list of configuration keys
* @return set of configuration data with full details
*/
Set<ConfigDataPair> getDataFull(List<String> list);
/**
* Gets configuration data pairs for specified keys with optional features
*
* @param list list of configuration keys
* @param _comment whether to include comments
* @param _withSuggestions whether to include suggestions
* @return set of configuration data
*/
Set<ConfigDataPair> getData(List<String> list, boolean _comment, boolean _withSuggestions);
/**
* Remove a configuration entry by its key.
* If the key does not exist this should be a no-op.
*
* @param key the configuration key to remove
*/
void removeConfig(String key);
/**
* Remove multiple configuration entries by their keys.
* Implementations should attempt to remove each key provided. If some
* keys do not exist they may be ignored.
*
* @param keys an array of configuration keys to remove
*/
void removeConfig(String[] keys);
}
@@ -0,0 +1,71 @@
package me.earthme.luminol.api.entity;
import org.apache.commons.lang3.Validate;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.jetbrains.annotations.NotNull;
/**
* A simple event fired when a teleportAsync was called
*
* @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause)
* @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location)
* (Also fired when teleportAsync called from nms)
*/
public class EntityTeleportAsyncEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
private final Entity entity;
private final PlayerTeleportEvent.TeleportCause teleportCause;
private final Location destination;
public EntityTeleportAsyncEvent(Entity entity, PlayerTeleportEvent.TeleportCause teleportCause, Location destination) {
Validate.notNull(entity, "entity cannot be a null value!");
Validate.notNull(teleportCause, "teleportCause cannot be a null value!");
Validate.notNull(destination, "destination cannot be a null value!");
this.entity = entity;
this.teleportCause = teleportCause;
this.destination = destination;
}
/**
* Get the entity is about to be teleported
*
* @return that entity
*/
public @NotNull Entity getEntity() {
return this.entity;
}
/**
* Get the cause of the teleport
*
* @return the cause
*/
public @NotNull PlayerTeleportEvent.TeleportCause getTeleportCause() {
return this.teleportCause;
}
/**
* Get the destination of the teleport
*
* @return the destination
*/
public @NotNull Location getDestination() {
return this.destination;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
@NotNull
public static HandlerList getHandlerList() {
return HANDLERS;
}
}
@@ -0,0 +1,42 @@
package me.earthme.luminol.api.entity;
import org.apache.commons.lang3.Validate;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A simple event created for missing teleport events api of folia
* This event is fired when the entity portal process has been done
*/
public class PostEntityPortalEvent extends Event {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final Entity teleportedEntity;
public PostEntityPortalEvent(Entity teleportedEntity) {
Validate.notNull(teleportedEntity, "teleportedEntity cannot be null!");
this.teleportedEntity = teleportedEntity;
}
/**
* Get the entity which was teleported
*
* @return the entity which was teleported
*/
public Entity getTeleportedEntity() {
return this.teleportedEntity;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLER_LIST;
}
@NotNull
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}
@@ -0,0 +1,81 @@
package me.earthme.luminol.api.entity;
import org.apache.commons.lang3.Validate;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A simple event created for missing teleport events api of folia
* This event will be fired when a portal teleportation is about to happen
*/
public class PreEntityPortalEvent extends Event implements Cancellable {
private static final HandlerList HANDLERS = new HandlerList();
private final Entity entity;
private final Location portalPos;
private final World destination;
private boolean cancelled = false;
public PreEntityPortalEvent(Entity entity, Location portalPos, World destination) {
Validate.notNull(entity, "entity cannot be null!");
Validate.notNull(portalPos, "portalPos cannot be null!");
Validate.notNull(destination, "destination cannot be null!");
this.entity = entity;
this.portalPos = portalPos;
this.destination = destination;
}
/**
* Get the entity that is about to teleport
*
* @return the entity
*/
public @NotNull Entity getEntity() {
return this.entity;
}
/**
* Get the location of the portal
*
* @return the portal location
*/
public @NotNull Location getPortalPos() {
return this.portalPos;
}
/**
* Get the destination world
*
* @return the destination world
*/
public @NotNull World getDestination() {
return this.destination;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
@NotNull
public static HandlerList getHandlerList() {
return HANDLERS;
}
}
@@ -0,0 +1,41 @@
package me.earthme.luminol.api.entity.player;
import org.apache.commons.lang3.Validate;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A simple event fired when the respawn process of player is done
*/
public class PostPlayerRespawnEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
private final Player player;
public PostPlayerRespawnEvent(Player player) {
Validate.notNull(player, "Player cannot be a null value!");
this.player = player;
}
/**
* Get the respawned player
*
* @return the player
*/
public @NotNull Player getPlayer() {
return this.player;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
@NotNull
public static HandlerList getHandlerList() {
return HANDLERS;
}
}
@@ -0,0 +1,35 @@
package me.earthme.luminol.api.portal;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A event fired when an end platform is created.
*/
public class EndPlatformCreateEvent extends Event implements Cancellable {
private static final HandlerList HANDLERS = new HandlerList();
private boolean cancelled = false;
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
@NotNull
public static HandlerList getHandlerList() {
return HANDLERS;
}
}
@@ -0,0 +1,55 @@
package me.earthme.luminol.api.portal;
import org.apache.commons.lang3.Validate;
import org.bukkit.Location;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A event fired when the portal process started locating the destination position
* Notice: If you changed the destination to an another position in end teleportation.The end platform won't create under the entity and won't create
* if the position is out of current tick region
*/
public class PortalLocateEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
private final Location original;
private final Location destination;
public PortalLocateEvent(Location original, Location destination) {
Validate.notNull(original, "original couldn't be null!");
Validate.notNull(destination, "destination couldn't be null!");
this.original = original;
this.destination = destination;
}
/**
* Get the destination position of this teleportation
*
* @return the destination position
*/
public Location getDestination() {
return this.destination;
}
/**
* Get the original portal position of this teleportation
*
* @return the original portal position
*/
public Location getOriginal() {
return this.original;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
@NotNull
public static HandlerList getHandlerList() {
return HANDLERS;
}
}
@@ -0,0 +1,103 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.action.BotAction;
import java.util.UUID;
/**
* Represents a fakeplayer
*/
public interface Bot extends Player {
/**
* Gets the fakeplayer skin
*
* @return fakeplayer skin name
*/
@Nullable String getSkinName();
/**
* Gets the fakeplayer name without prefix and suffix
*
* @return fakeplayer raw name
*/
@NotNull String getRawName();
/**
* Gets the creator's UUID of the fakeplayer
*
* @return creator's UUID
*/
@Nullable UUID getCreatePlayerUUID();
/**
* Add an action to the fakeplayer
*
* @param action bot action
*/
<T extends BotAction<T>> void addAction(@NotNull T action);
/**
* Get the copy action in giving index
*
* @param index index of actions
* @return Action of that index
*/
BotAction<?> getAction(int index);
/**
* Get action size
*
* @return size
*/
int getActionSize();
/**
* Stop the action in giving index
*
* @param index index of actions
*/
void stopAction(int index);
/**
* Stop all the actions of the fakeplayer
*/
void stopAllActions();
/**
* Remove the fakeplayer
*
* @param save should save
* @return success
*/
boolean remove(boolean save);
/**
* Remove the fakeplayer
*
* @param save should save
* @param resume should resume at next server start
* @return success
*/
boolean remove(boolean save, boolean resume);
}
@@ -0,0 +1,69 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.function.Consumer;
public interface BotCreator {
static BotCreator of(String rawName, Location location) {
return Bukkit.getBotManager().botCreator(rawName, location);
}
BotCreator name(String name);
BotCreator skinName(String skinName);
BotCreator skin(String[] skin);
/**
* Sets the skin of the bot using the Mojang API based on the provided skin name.
* <p>
* Need Async.
*
* @return BotCreator
*/
BotCreator mojangAPISkin();
BotCreator location(@NotNull Location location);
BotCreator creator(@Nullable CommandSender creator);
/**
* Create a bot directly
*
* @return a bot, null spawn fail
*/
@Nullable Bot spawn();
/**
* Create a bot and apply skin of player names `skinName` from MojangAPI
* just like `mojangAPISkin().spawn()`, but async
* <p>
* you can not get the bot instance instantly because get skin in on async thread
*
* @param consumer Consumer
*/
void spawnWithSkin(Consumer<Bot> consumer);
}
@@ -0,0 +1,65 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot;
import org.bukkit.Location;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.action.BotAction;
import java.util.Collection;
import java.util.UUID;
/**
* Simple fakeplayer manager
*/
public interface BotManager {
/**
* Gets a fakeplayer object by the given uuid.
*
* @param uuid the uuid to look up
* @return a fakeplayer if one was found, null otherwise
*/
@Nullable Bot getBot(@NotNull UUID uuid);
/**
* Gets a fakeplayer object by the given name.
*
* @param name the name to look up
* @return a fakeplayer if one was found, null otherwise
*/
@Nullable Bot getBot(@NotNull String name);
/**
* Gets a view of all currently logged in fakeplayers. This view is a reused object, making some operations like Collection.size() zero-allocation.
*
* @return a view of fakeplayers.
*/
Collection<Bot> getBots();
/**
* Create a bot action by class.
*
* @param type action class
* @return a bot action instance if one was found, null otherwise
*/
<T extends BotAction<T>> T newAction(@NotNull Class<T> type);
BotCreator botCreator(@NotNull String rawName, @NotNull Location location);
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to attack entities.
*/
public interface AttackAction extends TimerBotAction<AttackAction> {
static AttackAction create() {
return Bukkit.getBotManager().newAction(AttackAction.class);
}
}
@@ -0,0 +1,102 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import java.util.UUID;
import java.util.function.Consumer;
/**
* Represents an action that can be performed by a Bot.
* <p>
* This interface defines the basic properties of an action (such as name and UUID)
* and lifecycle event callbacks (success, failure, stop).
*
* @param <T> the type of the callback parameter, usually a context object related to the action
*/
public interface BotAction<T> {
/**
* Gets the name of this action.
*
* @return the action name
*/
String getName();
/**
* Gets the UUID of this action.
*
* @return the UUID of the action
*/
UUID getUUID();
/**
* Sets whether this action is cancelled.
*
* @param cancel true to cancel the action, false otherwise
*/
void setCancelled(boolean cancel);
/**
* Checks whether this action has been cancelled.
*
* @return true if cancelled, false otherwise
*/
boolean isCancelled();
/**
* Sets the callback to be executed when the action fails.
*
* @param onFail the callback to execute on failure, with a parameter of type T
*/
void setOnFail(Consumer<T> onFail);
/**
* Gets the callback to be executed when the action fails.
*
* @return the failure callback
*/
Consumer<T> getOnFail();
/**
* Sets the callback to be executed when the action succeeds.
*
* @param onSuccess the callback to execute on success, with a parameter of type T
*/
void setOnSuccess(Consumer<T> onSuccess);
/**
* Gets the callback to be executed when the action succeeds.
*
* @return the success callback
*/
Consumer<T> getOnSuccess();
/**
* Sets the callback to be executed when the action is stopped.
*
* @param onStop the callback to execute on stop, with a parameter of type T
*/
void setOnStop(Consumer<T> onStop);
/**
* Gets the callback to be executed when the action is stopped.
*
* @return the stop callback
*/
Consumer<T> getOnStop();
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to break a block.
*/
public interface BreakBlockAction extends TimerBotAction<BreakBlockAction> {
static BreakBlockAction create() {
return Bukkit.getBotManager().newAction(BreakBlockAction.class);
}
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to drop all items in its inventory.
*/
public interface DropAction extends TimerBotAction<DropAction> {
static DropAction create() {
return Bukkit.getBotManager().newAction(DropAction.class);
}
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to perform auto fishing.
*/
public interface FishAction extends TimerBotAction<FishAction> {
static FishAction create() {
return Bukkit.getBotManager().newAction(FishAction.class);
}
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to perform a jump.
*/
public interface JumpAction extends TimerBotAction<JumpAction> {
static JumpAction create() {
return Bukkit.getBotManager().newAction(JumpAction.class);
}
}
@@ -0,0 +1,71 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
/**
* Represents an action for a bot to look at a specific position or player.
* <p>
* If both a position and a player are set, the player target takes precedence.
*/
public interface LookAction extends BotAction<LookAction> {
/**
* Sets the position in the world for the bot to look at.
* <p>
* If a player target is set via {@link #setTarget(Player)}, the bot will look at the player instead of this position.
*
* @param pos the {@link Vector} representing the position to look at
* @return this {@code LookAction} instance for method chaining
*/
LookAction setPos(Vector pos);
/**
* Gets the position in the world that the bot is set to look at.
* <p>
* If a player target is set, this value may be ignored.
*
* @return the {@link Vector} position to look at, or {@code null} if not set
*/
Vector getPos();
/**
* Sets the player for the bot to look at.
* <p>
* When a player is set as the target, the bot will continuously look at the player's current position,
* overriding any position set by {@link #setPos(Vector)}.
*
* @param player the {@link Player} to look at, or {@code null} to clear the target
* @return this {@code LookAction} instance for method chaining
*/
LookAction setTarget(Player player);
/**
* Gets the player that the bot is set to look at.
*
* @return the {@link Player} target, or {@code null} if not set
*/
Player getTarget();
static LookAction create() {
return Bukkit.getBotManager().newAction(LookAction.class);
}
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to mount to nearby vehicles.
*/
public interface MountAction extends BotAction<MountAction> {
static MountAction create() {
return Bukkit.getBotManager().newAction(MountAction.class);
}
}
@@ -0,0 +1,61 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to move to a specific direction.
*/
public interface MoveAction extends StateBotAction<MoveAction> {
/**
* Gets the direction of the move action.
*
* @return the direction of the move action
*/
MoveDirection getDirection();
/**
* Sets the direction of the move action.
*
* @param direction the direction to set
* @return this action instance
*/
MoveAction setDirection(MoveDirection direction);
/**
* Represents possible movement directions for the bot.
*/
enum MoveDirection {
FORWARD("forward"),
BACKWARD("backward"),
LEFT("left"),
RIGHT("right");
public final String name;
MoveDirection(String name) {
this.name = name;
}
}
static MoveAction create() {
return Bukkit.getBotManager().newAction(MoveAction.class);
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to rotate to a specific yaw and pitch.
*/
public interface RotationAction extends BotAction<RotationAction> {
/**
* Sets the yaw of the rotation.
*
* @param yaw the yaw to set
* @return this action instance
*/
RotationAction setYaw(float yaw);
/**
* Sets the pitch of the rotation.
*
* @param pitch the pitch to set
* @return this action instance
*/
RotationAction setPitch(float pitch);
/**
* Gets the yaw of the rotation.
*
* @return the yaw
*/
float getYaw();
/**
* Gets the pitch of the rotation.
*
* @return the pitch
*/
float getPitch();
static RotationAction create() {
return Bukkit.getBotManager().newAction(RotationAction.class);
}
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to sneak.
*/
public interface SneakAction extends StateBotAction<SneakAction> {
static SneakAction create() {
return Bukkit.getBotManager().newAction(SneakAction.class);
}
}
@@ -0,0 +1,27 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
/**
* Represents a type of bot action that places the bot in a specific state while the action is active.
* When the action is stopped, the associated state is removed from the bot.
*
* @param <E> The type of entity that this action operates on.
*/
public interface StateBotAction<E> extends BotAction<E> {
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to swap items between the main hand and off-hand.
*/
public interface SwapAction extends BotAction<SwapAction> {
static SwapAction create() {
return Bukkit.getBotManager().newAction(SwapAction.class);
}
}
@@ -0,0 +1,29 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action for a bot to float up in water.
*/
public interface SwimAction extends StateBotAction<SwimAction> {
static SwimAction create() {
return Bukkit.getBotManager().newAction(SwimAction.class);
}
}
@@ -0,0 +1,85 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
/**
* Represents a scheduled bot task that runs periodically.
* <p>
* TimerBotAction allows configuration of start delay, execution interval, and the number of executions.
* It is intended for bot actions that need to be triggered at regular intervals.
*
* @param <E> the type of entity this action operates on
*/
public interface TimerBotAction<E> extends BotAction<E> {
/**
* Sets the delay in ticks before the task starts for the first time.
*
* @param delayTick the number of ticks to delay before the first execution
*/
void setStartDelayTick(int delayTick);
/**
* Gets the delay in ticks before the task starts for the first time.
*
* @return the number of ticks to delay before the first execution
*/
int getStartDelayTick();
/**
* Sets the interval in ticks between each execution of the task.
*
* @param intervalTick the number of ticks between executions
*/
void setDoIntervalTick(int intervalTick);
/**
* Gets the interval in ticks between each execution of the task.
*
* @return the number of ticks between executions
*/
int getDoIntervalTick();
/**
* Sets the total number of times the task should be executed.
*
* @param doNumber the total number of executions
*/
void setDoNumber(int doNumber);
/**
* Gets the total number of times the task should be executed.
*
* @return the total number of executions
*/
int getDoNumber();
/**
* Gets the number of ticks remaining until the next execution.
*
* @return the number of ticks until the next execution
*/
int getTickToNext();
/**
* Gets the number of executions remaining for this task.
*
* @return the number of executions remaining
*/
int getDoNumberRemaining();
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot only uses an item, without using it on blocks or entities.
*/
public interface UseItemAction extends TimerBotAction<UseItemAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemAction setUseTickTimeout(int timeout);
static UseItemAction create() {
return Bukkit.getBotManager().newAction(UseItemAction.class);
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot uses an item, fully simulating the effect of a player right-clicking.
*/
public interface UseItemAutoAction extends TimerBotAction<UseItemAutoAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemAutoAction setUseTickTimeout(int timeout);
static UseItemAutoAction create() {
return Bukkit.getBotManager().newAction(UseItemAutoAction.class);
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot only uses the item in its offhand, without using it on blocks or entities.
*/
public interface UseItemOffhandAction extends TimerBotAction<UseItemOffhandAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemOffhandAction setUseTickTimeout(int timeout);
static UseItemOffhandAction create() {
return Bukkit.getBotManager().newAction(UseItemOffhandAction.class);
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot uses an item on a block.
*/
public interface UseItemOnAction extends TimerBotAction<UseItemOnAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemOnAction setUseTickTimeout(int timeout);
static UseItemOnAction create() {
return Bukkit.getBotManager().newAction(UseItemOnAction.class);
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot uses an item in its offhand on a block.
*/
public interface UseItemOnOffhandAction extends TimerBotAction<UseItemOnOffhandAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemOnOffhandAction setUseTickTimeout(int timeout);
static UseItemOnOffhandAction create() {
return Bukkit.getBotManager().newAction(UseItemOnOffhandAction.class);
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot uses an item to an entity.
*/
public interface UseItemToAction extends TimerBotAction<UseItemToAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemToAction setUseTickTimeout(int timeout);
static UseItemToAction create() {
return Bukkit.getBotManager().newAction(UseItemToAction.class);
}
}
@@ -0,0 +1,46 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.bot.action;
import org.bukkit.Bukkit;
/**
* Represents an action where a bot uses an item in its offhand to an entity.
*/
public interface UseItemToOffhandAction extends TimerBotAction<UseItemToOffhandAction> {
/**
* Gets the equivalent right-click hold duration timeout in ticks.
* Default is -1, which means no timeout.
*
* @return the equivalent right-click hold duration timeout
*/
int getUseTickTimeout();
/**
* Sets the equivalent right-click hold duration timeout in ticks.
*
* @param timeout the equivalent right-click hold duration timeout
* @return this action instance
*/
UseItemToOffhandAction setUseTickTimeout(int timeout);
static UseItemToOffhandAction create() {
return Bukkit.getBotManager().newAction(UseItemToOffhandAction.class);
}
}
@@ -0,0 +1,43 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.photographer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
public interface Photographer extends Player {
@NotNull String getId();
void setRecordFile(@NotNull File file);
void stopRecording();
void stopRecording(boolean async);
void stopRecording(boolean async, boolean save);
void pauseRecording();
void resumeRecording();
void setFollowPlayer(@Nullable Player player);
}
@@ -0,0 +1,44 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.entity.photographer;
import org.bukkit.Location;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.replay.BukkitRecorderOption;
import java.util.Collection;
import java.util.UUID;
public interface PhotographerManager {
@Nullable Photographer getPhotographer(@NotNull UUID uuid);
@Nullable Photographer getPhotographer(@NotNull String id);
@Nullable Photographer createPhotographer(@NotNull String id, @NotNull Location location);
@Nullable Photographer createPhotographer(@NotNull String id, @NotNull Location location, @NotNull BukkitRecorderOption recorderOption);
void removePhotographer(@NotNull String id);
void removePhotographer(@NotNull UUID uuid);
void removeAllPhotographers();
Collection<Photographer> getPhotographers();
}
@@ -0,0 +1,44 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.entity.bot.Bot;
import java.util.UUID;
public abstract class BotActionEvent extends BotEvent {
private final String actionName;
private final UUID actionUUID;
public BotActionEvent(@NotNull Bot who, String actionName, UUID actionUUID) {
super(who);
this.actionName = actionName;
this.actionUUID = actionUUID;
}
@NotNull
public String getActionName() {
return actionName;
}
public UUID getActionUUID() {
return actionUUID;
}
}
@@ -0,0 +1,68 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.entity.bot.Bot;
import java.util.UUID;
public class BotActionExecuteEvent extends BotActionEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private Result result = Result.PASS;
public BotActionExecuteEvent(@NotNull Bot who, String actionName, UUID actionUUID) {
super(who, actionName, actionUUID);
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return result != Result.PASS;
}
@Override
public void setCancelled(boolean cancel) {
this.result = cancel ? Result.SOFT_CANCEL : Result.PASS;
}
public void hardCancel() {
this.result = Result.HARD_CANCEL;
}
public Result getResult() {
return this.result;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
public enum Result {
PASS, SOFT_CANCEL, HARD_CANCEL
}
}
@@ -0,0 +1,46 @@
package org.leavesmc.leaves.event.bot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
public class BotActionGuiOpenEvent extends BotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Player player;
private boolean cancel = false;
public BotActionGuiOpenEvent(@NotNull Bot who, @Nullable Player player) {
super(who);
this.player = player;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Nullable
public Player getOpenPlayer() {
return player;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,64 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
import java.util.UUID;
public class BotActionScheduleEvent extends BotActionEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final CommandSender sender;
private boolean cancel = false;
public BotActionScheduleEvent(@NotNull Bot who, String actionName, UUID actionUUID, CommandSender sender) {
super(who, actionName, actionUUID);
this.sender = sender;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Nullable
public CommandSender getSender() {
return sender;
}
@Override
@NotNull
public HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,72 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
import java.util.UUID;
public class BotActionStopEvent extends BotActionEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final CommandSender sender;
private final Reason reason;
private boolean cancel = false;
public BotActionStopEvent(@NotNull Bot who, String actionName, UUID actionUUID, Reason stopReason, CommandSender sender) {
super(who, actionName, actionUUID);
this.reason = stopReason;
this.sender = sender;
}
public static HandlerList getHandlerList() {
return handlers;
}
public Reason getReason() {
return reason;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Nullable
public CommandSender getSender() {
return sender;
}
public enum Reason {
DONE, COMMAND, PLUGIN, INTERNAL
}
}
@@ -0,0 +1,70 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.entity.bot.Bot;
public class BotConfigModifyEvent extends BotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final String configName;
private final String[] configValue;
private final CommandSender sender;
private boolean cancel;
public BotConfigModifyEvent(@NotNull Bot who, String configName, String[] configValue, CommandSender sender) {
super(who);
this.configName = configName;
this.configValue = configValue;
this.sender = sender;
}
public static HandlerList getHandlerList() {
return handlers;
}
@NotNull
public String getConfigName() {
return configName;
}
@NotNull
public String[] getConfigValue() {
return configValue;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,135 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Call when a fakeplayer created
*/
public class BotCreateEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final String bot;
private final String skin;
private final CreateReason reason;
private final CommandSender creator;
private Location createLocation;
private boolean cancel = false;
public BotCreateEvent(@NotNull final String who, @NotNull final String skin, @NotNull final Location createLocation, @NotNull CreateReason reason, @Nullable CommandSender creator) {
this.bot = who;
this.skin = skin;
this.createLocation = createLocation;
this.reason = reason;
this.creator = creator;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Gets the fakeplayer name
*
* @return fakeplayer name
*/
public String getBot() {
return bot;
}
/**
* Gets the location to create the fakeplayer
*
* @return Location to create the fakeplayer
*/
@NotNull
public Location getCreateLocation() {
return createLocation;
}
/**
* Sets the location to create the fakeplayer
*
* @param createLocation location to create the fakeplayer
*/
public void setCreateLocation(@NotNull Location createLocation) {
this.createLocation = createLocation;
}
/**
* Gets the fakeplayer skin
*
* @return fakeplayer skin name
*/
@Nullable
public String getSkin() {
return skin;
}
/**
* Gets the create reason of the bot
*
* @return create reason
*/
@NotNull
public CreateReason getReason() {
return reason;
}
/**
* Gets the creator of the bot
* if the create reason is not COMMAND, the creator might be null
*
* @return An optional of creator
*/
@Nullable
public CommandSender getCreator() {
return creator;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Override
@NotNull
public HandlerList getHandlers() {
return handlers;
}
public enum CreateReason {
COMMAND,
PLUGIN,
INTERNAL,
UNKNOWN,
}
}
@@ -0,0 +1,86 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
public class BotDeathEvent extends BotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancel = false;
private boolean sendDeathMessage;
private Component deathMessage;
public BotDeathEvent(@NotNull Bot who, @Nullable Component deathMessage, boolean sendDeathMessage) {
super(who);
this.deathMessage = deathMessage;
this.sendDeathMessage = sendDeathMessage;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
public Component deathMessage() {
return deathMessage;
}
public void deathMessage(Component deathMessage) {
this.deathMessage = deathMessage;
}
@Nullable
public String getDeathMessage() {
return this.deathMessage == null ? null : LegacyComponentSerializer.legacySection().serialize(this.deathMessage);
}
public void setDeathMessage(@Nullable String deathMessage) {
this.deathMessage = deathMessage != null ? LegacyComponentSerializer.legacySection().deserialize(deathMessage) : null;
}
public boolean isSendDeathMessage() {
return sendDeathMessage;
}
public void setSendDeathMessage(boolean sendDeathMessage) {
this.sendDeathMessage = sendDeathMessage;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}
@@ -0,0 +1,49 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.event.Event;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.entity.bot.Bot;
/**
* Represents a fakeplayer related event
*/
public abstract class BotEvent extends Event {
protected Bot bot;
public BotEvent(@NotNull final Bot who) {
bot = who;
}
public BotEvent(@NotNull final Bot who, boolean async) {
super(async);
bot = who;
}
/**
* Returns the fakeplayer involved in this event
*
* @return Fakeplayer who is involved in this event
*/
@NotNull
public final Bot getBot() {
return bot;
}
}
@@ -0,0 +1,63 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
public class BotInventoryOpenEvent extends BotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Player player;
private boolean cancel = false;
public BotInventoryOpenEvent(@NotNull Bot who, @Nullable Player player) {
super(who);
this.player = player;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Nullable
public Player getOpenPlayer() {
return player;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,84 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
/**
* Called when a fakeplayer joins a server
*/
public class BotJoinEvent extends BotEvent {
private static final HandlerList handlers = new HandlerList();
private Component joinMessage;
public BotJoinEvent(@NotNull final Bot who, @Nullable final Component joinMessage) {
super(who);
this.joinMessage = joinMessage;
}
public BotJoinEvent(@NotNull final Bot who, @Nullable final String joinMessage) {
super(who);
this.joinMessage = joinMessage != null ? LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
public void joinMessage(@Nullable final Component joinMessage) {
this.joinMessage = joinMessage;
}
@Nullable
public Component joinMessage() {
return joinMessage;
}
/**
* Gets the join message to send to all online players
*
* @return string join message. Can be null
*/
@Nullable
public String getJoinMessage() {
return this.joinMessage == null ? null : LegacyComponentSerializer.legacySection().serialize(this.joinMessage);
}
/**
* Sets the join message to send to all online players
*
* @param joinMessage join message. If null, no message will be sent
*/
public void setJoinMessage(@Nullable String joinMessage) {
this.joinMessage = joinMessage != null ? LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null;
}
@Override
@NotNull
public HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,76 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import java.util.UUID;
/**
* Call when a fakeplayer loaded
*/
public class BotLoadEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final String bot;
private final UUID botUUID;
private boolean cancel = false;
public BotLoadEvent(@NotNull final String who, @NotNull final UUID uuid) {
this.bot = who;
this.botUUID = uuid;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Gets the fakeplayer name
*
* @return fakeplayer name
*/
public String getBot() {
return bot;
}
public UUID getBotUUID() {
return botUUID;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
@Override
@NotNull
public HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,122 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.bot.Bot;
/**
* Call when a fakeplayer removed
*/
public class BotRemoveEvent extends BotEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final RemoveReason reason;
private final CommandSender remover;
private Component removeMessage;
private boolean save;
private boolean cancel = false;
public BotRemoveEvent(@NotNull final Bot who, @NotNull RemoveReason reason, @Nullable CommandSender remover, @Nullable Component removeMessage, boolean save) {
super(who);
this.reason = reason;
this.remover = remover;
this.removeMessage = removeMessage;
this.save = save;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Gets the remove reason of the bot
*
* @return remove reason
*/
@NotNull
public RemoveReason getReason() {
return reason;
}
/**
* Gets the remover of the bot
* if the remove reason is not COMMAND, the creator might be null
*
* @return An optional of remover
*/
@Nullable
public CommandSender getRemover() {
return remover;
}
public Component removeMessage() {
return removeMessage;
}
public void removeMessage(Component removeMessage) {
this.removeMessage = removeMessage;
}
@Nullable
public String getRemoveMessage() {
return this.removeMessage == null ? null : LegacyComponentSerializer.legacySection().serialize(this.removeMessage);
}
public void setRemoveMessage(@Nullable String removeMessage) {
this.removeMessage = removeMessage != null ? LegacyComponentSerializer.legacySection().deserialize(removeMessage) : null;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
public boolean shouldSave() {
return save;
}
public void setSave(boolean save) {
this.save = save;
}
@Override
@NotNull
public HandlerList getHandlers() {
return handlers;
}
public enum RemoveReason {
COMMAND,
PLUGIN,
DEATH,
INTERNAL
}
}
@@ -0,0 +1,55 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.bot;
import org.bukkit.Location;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.leavesmc.leaves.entity.bot.Bot;
public class BotSpawnLocationEvent extends BotEvent {
private static final HandlerList handlers = new HandlerList();
private Location spawnLocation;
public BotSpawnLocationEvent(@NotNull final Bot who, @NotNull Location spawnLocation) {
super(who);
this.spawnLocation = spawnLocation;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
@NotNull
public Location getSpawnLocation() {
return spawnLocation;
}
public void setSpawnLocation(@NotNull Location location) {
this.spawnLocation = location;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
}
@@ -0,0 +1,73 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.player;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
/**
* Called when a player operation is limited
*/
public class PlayerOperationLimitEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();
private final Block block;
private final Operation operation;
public PlayerOperationLimitEvent(@NotNull Player who, Operation operation, Block block) {
super(who);
this.block = block;
this.operation = operation;
}
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Gets the operated block
*
* @return block
*/
public Block getBlock() {
return block;
}
/**
* Gets the type of operation
*
* @return operation type
*/
public Operation getOperation() {
return operation;
}
@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}
public enum Operation {
MINE, PLACE
}
}
@@ -0,0 +1,63 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.event.player;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class UpdateSuppressionEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final @Nullable Player player;
private final @Nullable Location position;
private final @Nullable Material material;
private final @NotNull Throwable throwable;
public UpdateSuppressionEvent(@Nullable Player player, @Nullable Location position, @Nullable Material material, @NotNull Throwable throwable) {
this.player = player;
this.position = position;
this.material = material;
this.throwable = throwable;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
public @Nullable Player getPlayer() {
return player;
}
public @NotNull Throwable getThrowable() {
return throwable;
}
public @Nullable Location getPosition() {
return position;
}
public @Nullable Material getMaterial() {
return material;
}
}
@@ -0,0 +1,14 @@
/*
* This file is licensed under the MIT license.
* Origin : Leaves (https://github.com/LeavesMC/Leaves)
*/
package org.leavesmc.leaves.plugin;
import java.util.Set;
public interface FeatureManager {
Set<String> getAvailableFeatures();
boolean isFeatureAvailable(String feature);
}
@@ -0,0 +1,15 @@
/*
* This file is licensed under the MIT license.
* Origin : Leaves (https://github.com/LeavesMC/Leaves)
*/
package org.leavesmc.leaves.plugin;
public class Features {
public static final String MIXIN = "mixin";
public static final String FAKEPLAYER = "fakeplayer";
public static final String PHOTOGRAPHER = "photographer";
public static final String RECORDER = "recorder";
public static final String BYTEBUF = "bytebuf";
public static final String UPDATE_SUPPRESSION_EVENT = "update_suppression_event";
}
@@ -0,0 +1,35 @@
/*
* This file is part of Leaves (https://github.com/LeavesMC/Leaves)
*
* Leaves is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Leaves is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Leaves. If not, see <https://www.gnu.org/licenses/>.
*/
package org.leavesmc.leaves.replay;
public class BukkitRecorderOption {
// public int recordDistance = -1;
public String serverName = "Lophine"; // Lophine - rebrand to Lophine to avoid confusion
public BukkitRecordWeather forceWeather = BukkitRecordWeather.NULL;
public int forceDayTime = -1;
public boolean ignoreChat = false;
// public boolean ignoreItem = false;
public enum BukkitRecordWeather {
CLEAR,
RAIN,
THUNDER,
NULL
}
}
+113 -43
View File
@@ -1,81 +1,151 @@
--- a/luminol-server/build.gradle.kts
+++ b/luminol-server/build.gradle.kts
@@ -52,7 +_,23 @@
--- a/folia-server/build.gradle.kts
+++ b/folia-server/build.gradle.kts
@@ -7,15 +_,16 @@
`java-library`
`maven-publish`
idea
- id("io.papermc.paperweight.core")
+ id("fun.bm.comfreyweight.core")
id("io.papermc.fill.gradle") version "1.0.12"
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
+val bacteriawaMavenPublicUrl = "https://repo.bacteriawa.com/repository/maven-public/"
dependencies {
mache("io.papermc:mache:26.2+build.1")
- paperclip("io.papermc:paperclip:3.0.4")
+ morninggloryclip("fun.bm:morninggloryclip:${providers.gradleProperty("clipVersion").get()}")
}
paperweight {
@@ -23,7 +_,8 @@
filterPatches = false
gitFilePatches = false
- val fork = forks.register("folia") {
+ val folia = forks.register("folia") {
+ rootDirectory = upstreamsDirectory().map { it.dir("folia") }
upstream.patchDir("paperServer") {
upstreamPath = "paper-server"
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
@@ -32,7 +_,23 @@
}
}
- activeFork = luminol
- activeFork = fork
+ val lophine = forks.register("lophine") {
+ forks = luminol
+ forks = folia
+ upstream.patchRepo("paperServer") {
+ upstreamRepo = luminol.patchedRepo("paperServer")
+ upstreamRepo = folia.patchedRepo("paperServer")
+ patchesDir = rootDirectory.dir("lophine-server/paper-patches")
+ outputDir = rootDirectory.dir("paper-server")
+ }
+
+ upstream.patchDir("luminolServer") {
+ upstreamPath = "luminol-server"
+ upstream.patchDir("foliaServer") {
+ upstreamPath = "folia-server"
+ excludes = setOf("src/minecraft", "paper-patches", "minecraft-patches", "build.gradle.kts", "build.gradle.kts.patch")
+ patchesDir = rootDirectory.dir("lophine-server/luminol-patches")
+ outputDir = rootDirectory.dir("luminol-server")
+ patchesDir = rootDirectory.dir("lophine-server/folia-patches")
+ outputDir = rootDirectory.dir("folia-server")
+ }
+ }
+
+ activeFork = lophine
spigot {
@@ -142,12 +_,16 @@
updatingMinecraft {
@@ -44,6 +_,7 @@
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
+ bacteriawaMavenPublicUrl
)
}
@@ -103,10 +_,14 @@
main {
java { srcDir("../paper-server/src/main/java"); srcDir("../paper-server/src/generated/java") }
resources { srcDir("../paper-server/src/main/resources") }
java { srcDir("../folia-server/src/main/java") }
resources { srcDir("../folia-server/src/main/resources") }
+ java { srcDir("../luminol-server/src/main/java") }
+ resources { srcDir("../luminol-server/src/main/resources") }
+ java { srcDir("../folia-server/src/main/java") }
+ resources { srcDir("../folia-server/src/main/resources") }
}
test {
java { srcDir("../paper-server/src/test/java") }
resources { srcDir("../paper-server/src/test/resources") }
java { srcDir("../folia-server/src/test/java") }
resources { srcDir("../folia-server/src/test/resources") }
+ java { srcDir("../luminol-server/src/main/java") }
+ resources { srcDir("../luminol-server/src/main/resources") }
+ java { srcDir("../folia-server/src/test/java") }
+ resources { srcDir("../folia-server/src/test/resources") }
}
}
val log4jPlugins = sourceSets.create("log4jPlugins") {
@@ -174,7 +_,7 @@
@@ -134,7 +_,21 @@
}
dependencies {
- implementation(project(":luminol-api")) // Luminol
+ implementation(project(":lophine-api")) // Lophine
// Luminol start - Dependenices insert
implementation("com.electronwill.night-config:toml:3.8.2") // Night config
implementation("com.github.luben:zstd-jni:1.5.4-1")
@@ -276,14 +_,14 @@
- implementation(project(":folia-api"))
+ implementation(project(":lophine-api")) // Lophine - api update
+ // Lophine start - Dependenices insert
+ implementation("net.objecthunter:exp4j:0.4.8")
+ implementation("com.electronwill.night-config:toml:3.8.4") // Night config
+ implementation("com.github.luben:zstd-jni:1.5.4-1")
+ implementation("net.openhft:zero-allocation-hashing:0.16")
+ implementation("io.github.classgraph:classgraph:4.8.158")
+ implementation("net.openhft:affinity:3.23.3")
+ // Leaves start - leaves plugin
+ implementation("org.spongepowered:configurate-gson:4.2.0-SNAPSHOT") {
+ exclude(group = "com.google.code.gson", module = "gson")
+ exclude(group = "com.google.guava", module = "guava")
+ }
+ // Leaves end - leaves plugin
+ // Lophine end
implementation("ca.spottedleaf:leafpile:1.0.0")
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
@@ -189,21 +_,21 @@
val git = Git(rootProject.layout.projectDirectory.path)
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
val build = System.getenv("BUILD_NUMBER") ?: null
- val buildTime = providers.environmentVariable("BUILD_STARTED_AT").map(Instant::parse).orElse(Instant.EPOCH).get()
+ val buildTime = Instant.now() // Always use current as build time
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
- "Implementation-Title" to "Luminol",
+ "Implementation-Title" to "Lophine",
- "Implementation-Title" to "Folia",
+ "Implementation-Title" to "Lophine", // Lophine - Rebrand
"Implementation-Version" to implementationVersion,
"Implementation-Vendor" to date,
- "Specification-Title" to "Luminol",
+ "Specification-Title" to "Lophine",
- "Specification-Title" to "Folia",
+ "Specification-Title" to "Lophine", // Lophine - Rebrand
"Specification-Version" to project.version,
"Specification-Vendor" to "LuminolMC org",
- "Brand-Id" to "luminolmc:luminol",
- "Brand-Name" to "Luminol",
+ "Brand-Id" to "luminolmc:lophine",
+ "Brand-Name" to "Lophine",
- "Specification-Vendor" to "Paper Team",
- "Brand-Id" to "papermc:folia",
- "Brand-Name" to "Folia",
+ "Specification-Vendor" to "LophineLabs", // Lophine - Rebrand
+ "Brand-Id" to "lophinelabs:lophine", // Lophine - Rebrand
+ "Brand-Name" to "Lophine", // Lophine - Rebrand
"Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch,
@@ -447,7 +_,7 @@
@@ -214,6 +_,20 @@
}
}
}
+// Pufferfish Start
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
+// Pufferfish End
+// Lophine start - Hide unnecessary warnings
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("-Xlint:-module")
+ compilerArgs.add("-Xlint:-removal")
+ compilerArgs.add("-Xlint:-dep-ann")
+}
+// Lophine end
fill {
- project("luminol")
+ project("lophine")
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
version(paperweight.minecraftVersion)
// Compile tests with -parameters for better junit parameterized test names
tasks.compileTestJava {
@@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sun, 8 Jun 2025 00:58:13 +0800
Subject: [PATCH] Rebrand to Lophine
diff --git a/src/main/java/me/earthme/luminol/config/ConfigManager.java b/src/main/java/me/earthme/luminol/config/ConfigManager.java
index a67fc80eb3182415557b4bdf7f146aefb43103da..52fec4c88fee3c027c954365538516aaa8335c7f 100644
--- a/src/main/java/me/earthme/luminol/config/ConfigManager.java
+++ b/src/main/java/me/earthme/luminol/config/ConfigManager.java
@@ -21,6 +21,7 @@ public class ConfigManager {
public static void initConfigs() {
configfiles.put("luminol", ConfigsInstance.of(new File("luminol_config"), "luminol", "me.earthme.luminol.config.modules"));
+ configfiles.put("lophine", ConfigsInstance.of(new File("lophine_config"), "lophine", "fun.bm.lophine.config.modules")); // add lophine config to global config
preLoad();
}
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
index ded1f0667327a70a923ebda55c41b1c9094d3e37..57ddc0832b919b115b85c81ac30f136e32f1e77e 100644
--- a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
@@ -6,7 +6,7 @@ import me.earthme.luminol.config.flags.ConfigInfo;
public class ServerModNameConfig implements IConfigModule {
@ConfigInfo(baseName = "name")
- public static String serverModName = "Luminol";
+ public static String serverModName = "Lophine";
@ConfigInfo(baseName = "vanilla_spoof")
public static boolean fakeVanilla = false;
@@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Mon, 28 Jul 2025 23:02:47 +0800
Subject: [PATCH] Transformed Configs
diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java
index 531214d7ab28ece4bf84e82b39d1c9f983f0fb0c..b68fa0427bb975e91e76f73ab4cc089a424937a3 100644
--- a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java
@@ -5,6 +5,7 @@ import me.earthme.luminol.config.IConfigModule;
import me.earthme.luminol.config.flags.ConfigInfo;
public class CommandBlockExecutionConfig implements IConfigModule {
+ @me.earthme.luminol.config.flags.TransformedConfig(name = "command_block_enabled", category = {"experiment", "command"}, originInstance = "lophine")
@ConfigInfo(baseName = "enabled")
public static boolean enabled = false;
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
index c269446dda05cfc848407f80f53820c8fcd0c7b4..e69ffae53aa24496a29a4c4890cdcb366d2bec12 100644
--- a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java
@@ -5,6 +5,7 @@ import me.earthme.luminol.config.IConfigModule;
import me.earthme.luminol.config.flags.ConfigInfo;
public class PaperPacketLimiterConfig implements IConfigModule {
+ @me.earthme.luminol.config.flags.TransformedConfig(name = "unlimit-packet", category = {"misc", "network"}, originInstance = "lophine")
@ConfigInfo(baseName = "force_disable")
public static boolean forceDisable = false;
@@ -1,188 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Wed, 13 Aug 2025 22:23:46 +0800
Subject: [PATCH] Leaves: Item overstack util
Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com>
As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/d93e9766d3797d130f66179e70a1b374c546fef7/leaves-server/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java b/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java
index 102de78be0eb82d6898b4104fad1bf5e8366f993..11891a66fe3232287238ea87289444586fbc9717 100644
--- a/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java
+++ b/src/main/java/org/leavesmc/leaves/util/ItemOverstackUtils.java
@@ -17,12 +17,173 @@
package org.leavesmc.leaves.util;
+import fun.bm.lophine.config.modules.misc.ContainerExpansionConfig;
+import net.minecraft.core.component.DataComponents;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.component.CustomData;
+import net.minecraft.world.item.component.ItemContainerContents;
+import net.minecraft.world.level.block.ShulkerBoxBlock;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
// Only the used part is retained
public class ItemOverstackUtils {
+ private static final List<ItemUtil> overstackUtils = List.of(
+ new ShulkerBox()
+ );
+
+ public static int getItemStackMaxCount(ItemStack stack) {
+ int size;
+ for (ItemUtil util : overstackUtils) {
+ if ((size = util.getMaxServerStackCount(stack)) != -1) {
+ return size;
+ }
+ }
+ return stack.getMaxStackSize();
+ }
+
+ public static int getNetworkMaxCount(ItemStack stack) {
+ int size;
+ for (ItemUtil util : overstackUtils) {
+ if ((size = util.getMaxClientStackCount(stack)) != -1) {
+ return size;
+ }
+ }
+ return stack.getMaxStackSize();
+ }
+
+ public static boolean tryStackItems(ItemEntity self, ItemEntity other) {
+ for (ItemUtil util : overstackUtils) {
+ if (util.tryStackItems(self, other)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean hasOverstackingItem() {
+ return overstackUtils.stream().anyMatch(ItemUtil::isEnabled);
+ }
+
+ public static int getItemStackMaxCountReal(ItemStack stack) {
+ CompoundTag nbt = Optional.ofNullable(stack.get(DataComponents.CUSTOM_DATA)).orElse(CustomData.EMPTY).copyTag();
+ return nbt.getInt("Leaves.RealStackSize").orElse(stack.getMaxStackSize());
+ }
+
+ public static ItemStack encodeMaxStackSize(ItemStack itemStack) {
+ int realMaxStackSize = getItemStackMaxCountReal(itemStack);
+ int modifiedMaxStackSize = getNetworkMaxCount(itemStack);
+ if (itemStack.getMaxStackSize() != modifiedMaxStackSize) {
+ itemStack.set(DataComponents.MAX_STACK_SIZE, modifiedMaxStackSize);
+ CompoundTag nbt = itemStack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY).copyTag();
+ nbt.putInt("Leaves.RealStackSize", realMaxStackSize);
+ itemStack.set(DataComponents.CUSTOM_DATA, CustomData.of(nbt));
+ }
+ return itemStack;
+ }
+
+ public static ItemStack decodeMaxStackSize(ItemStack itemStack) {
+ int realMaxStackSize = getItemStackMaxCountReal(itemStack);
+ if (itemStack.getMaxStackSize() != realMaxStackSize) {
+ itemStack.set(DataComponents.MAX_STACK_SIZE, realMaxStackSize);
+ CompoundTag nbt = itemStack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY).copyTag();
+ nbt.remove("Leaves.RealStackSize");
+ if (nbt.isEmpty()) {
+ itemStack.remove(DataComponents.CUSTOM_DATA);
+ } else {
+ itemStack.set(DataComponents.CUSTOM_DATA, CustomData.of(nbt));
+ }
+ }
+ return itemStack;
+ }
+
public static float getItemStackSignalStrength(int maxStackSize, ItemStack itemStack) {
float result = (float) itemStack.getCount() / Math.min(maxStackSize, itemStack.getMaxStackSize());
return Math.clamp(result, 0f, 1f);
}
+
+ public static boolean isStackable(ItemStack itemStack) {
+ return getItemStackMaxCount(itemStack) > 1 && (!itemStack.isDamageableItem() || !itemStack.isDamaged());
+ }
+
+
+ private interface ItemUtil {
+ boolean isEnabled();
+
+ boolean tryStackItems(ItemEntity self, ItemEntity other);
+
+ // number -> modified count, -1 -> I don't care
+ int getMaxServerStackCount(ItemStack stack);
+
+ // number -> modified count, -1 -> I don't care
+ default int getMaxClientStackCount(ItemStack stack) {
+ return getMaxServerStackCount(stack);
+ }
+ }
+
+ private static class ShulkerBox implements ItemUtil {
+ public static boolean shulkerBoxCheck(@NotNull ItemStack stack1, @NotNull ItemStack stack2) {
+ if (ContainerExpansionConfig.nbtShulkerStackable) {
+ return Objects.equals(stack1.getComponents(), stack2.getComponents());
+ }
+ return shulkerBoxNoItem(stack1) && shulkerBoxNoItem(stack2) && Objects.equals(stack1.getComponents(), stack2.getComponents());
+ }
+
+ public static boolean shulkerBoxNoItem(@NotNull ItemStack stack) {
+ return stack.getComponents().getOrDefault(DataComponents.CONTAINER, ItemContainerContents.EMPTY).stream().findAny().isEmpty();
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return ContainerExpansionConfig.shulkerCount > 1;
+ }
+
+ @Override
+ public boolean tryStackItems(ItemEntity self, ItemEntity other) {
+ ItemStack selfStack = self.getItem();
+ if (!isEnabled() ||
+ !(selfStack.getItem() instanceof BlockItem blockItem) ||
+ !(blockItem.getBlock() instanceof ShulkerBoxBlock)
+ ) {
+ return false;
+ }
+
+ ItemStack otherStack = other.getItem();
+ if (selfStack.getItem() == otherStack.getItem()
+ && shulkerBoxCheck(selfStack, otherStack)
+ && selfStack.getCount() != ContainerExpansionConfig.shulkerCount) {
+ int amount = Math.min(otherStack.getCount(), ContainerExpansionConfig.shulkerCount - selfStack.getCount());
+
+ selfStack.grow(amount);
+ self.setItem(selfStack);
+
+ self.pickupDelay = Math.max(other.pickupDelay, self.pickupDelay);
+ self.age = Math.min(other.getAge(), self.age);
+
+ otherStack.shrink(amount);
+ if (otherStack.isEmpty()) {
+ other.discard();
+ } else {
+ other.setItem(otherStack);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxServerStackCount(ItemStack stack) {
+ if (isEnabled() && stack.getItem() instanceof BlockItem bi &&
+ bi.getBlock() instanceof ShulkerBoxBlock && (ContainerExpansionConfig.nbtShulkerStackable || shulkerBoxNoItem(stack))) {
+ return ContainerExpansionConfig.shulkerCount;
+ }
+ return -1;
+ }
+ }
}
\ No newline at end of file

Some files were not shown because too many files have changed in this diff Show More