Add rollLootTable method for loot generation and update version#367
Merged
Conversation
- implement rollLootTable to generate loot based on entity and damage source - utilize LootParams for contextual loot generation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new NMS bridge API for rolling an entity’s own loot table (rather than a replacement type’s loot table), with version-specific implementations for the supported Paper NMS baselines. This expands the Paper platform’s loot-generation capabilities while keeping the API/impl split intact.
Changes:
- Added
rollLootTable(entity, damageSource, causedByPlayer)toSurfPaperNmsLootTableBridge. - Implemented
rollLootTablefor bothv1_21_11andv26_1NMS bridge implementations using NMSLootParams+LootTable#getRandomItems. - Bumped project version to
3.18.0to reflect the new public API surface.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| surf-api-paper/surf-api-paper/src/main/kotlin/dev/slne/surf/api/paper/nms/bridges/SurfPaperNmsLootTableBridge.kt | Adds the new rollLootTable method to the public Paper NMS loot table bridge interface. |
| surf-api-paper/surf-api-paper/api/surf-api-paper.api | Updates the Kotlin ABI dump to include the newly added method. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v26-1/.../V26_1SurfPaperNmsLootTableBridgeImpl.kt | Implements loot table rolling for the v26_1 NMS baseline. |
| surf-api-paper/surf-api-paper-nms/surf-api-paper-nms-v1-21-11/.../V1_21_11SurfPaperNmsLootTableBridgeImpl.kt | Implements loot table rolling for the v1_21_11 NMS baseline. |
| gradle.properties | Bumps library version from 3.17.2 to 3.18.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new method for rolling loot tables to the NMS loot table bridge interface and its implementations, and bumps the project version. The main focus is on expanding loot table functionality for both v1_21_11 and v26_1 server versions.
API Additions:
rollLootTablemethod to theSurfPaperNmsLootTableBridgeinterface, allowing loot tables to be rolled with a given entity, damage source, and player-caused flag. [1] [2]Implementation Updates:
rollLootTablemethod in bothV1_21_11SurfPaperNmsLootTableBridgeImplandV26_1SurfPaperNmsLootTableBridgeImpl, providing the logic to roll loot tables using NMS internals for each respective server version. [1] [2]Project Versioning:
gradle.propertiesfrom3.17.2to3.18.0to reflect the new API addition.