Skip to content

Add rollLootTable method for loot generation and update version#367

Merged
twisti-dev merged 3 commits into
version/26.1from
feat/loottable
Jun 6, 2026
Merged

Add rollLootTable method for loot generation and update version#367
twisti-dev merged 3 commits into
version/26.1from
feat/loottable

Conversation

@twisti-dev
Copy link
Copy Markdown
Contributor

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:

  • Added a new rollLootTable method to the SurfPaperNmsLootTableBridge interface, allowing loot tables to be rolled with a given entity, damage source, and player-caused flag. [1] [2]

Implementation Updates:

  • Implemented the new rollLootTable method in both V1_21_11SurfPaperNmsLootTableBridgeImpl and V26_1SurfPaperNmsLootTableBridgeImpl, providing the logic to roll loot tables using NMS internals for each respective server version. [1] [2]

Project Versioning:

  • Bumped the project version in gradle.properties from 3.17.2 to 3.18.0 to reflect the new API addition.

- implement rollLootTable to generate loot based on entity and damage source
- utilize LootParams for contextual loot generation
🔧 chore: update version to 3.18.0
```
@twisti-dev twisti-dev self-assigned this Jun 6, 2026
Copilot AI review requested due to automatic review settings June 6, 2026 20:40
@twisti-dev twisti-dev merged commit a68d724 into version/26.1 Jun 6, 2026
5 of 8 checks passed
@twisti-dev twisti-dev deleted the feat/loottable branch June 6, 2026 20:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) to SurfPaperNmsLootTableBridge.
  • Implemented rollLootTable for both v1_21_11 and v26_1 NMS bridge implementations using NMS LootParams + LootTable#getRandomItems.
  • Bumped project version to 3.18.0 to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants