Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom model data support for kits #5433

Merged
merged 4 commits into from
Aug 5, 2023

Conversation

YanisBft
Copy link
Contributor

@YanisBft YanisBft commented Jul 17, 2023

Information

This PR closes #5426

Details

Proposed feature:

This PR adds support for CustomModelData tag in kits, which can be used with all items. This tag can be defined with either custom-model-data or cmd, as the whole name can be too long.
Because this tag only exists since Minecraft 1.14, a version check is done.

Environments tested:

OS: Ubuntu 22.04

Java version: OpenJDK 18

  • Most recent Paper version (1.20.1, git-Paper-83)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

In kits.yml:

kits:
  test1: #without custom model data
    delay: 0
    items:
      - bow 1 name:Test_1
  test2: #with custom model data
    delay: 0
    items:
      - bow 1 name:Test_2 custom-model-data:623
  test3: #with custom model data, but short key
    delay: 0
    items:
      - bow 1 name:Test_3 cmd:623

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

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

this looks good but AbstractItemDb should also serialize custom model data as well if we're adding this here.

@YanisBft YanisBft requested a review from JRoy July 18, 2023 00:11
@JRoy JRoy changed the title Support CustomModelData in kits Add custom model data support for kits Aug 5, 2023
@JRoy JRoy merged commit 2b993d5 into EssentialsX:2.x Aug 5, 2023
1 check passed
@YanisBft YanisBft deleted the kits-custom-model-data branch August 15, 2023 18:29
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.

Accept model-data on kits config
2 participants