Skip to content

Commit

Permalink
Add key for item model
Browse files Browse the repository at this point in the history
  • Loading branch information
avaruus1 committed Nov 7, 2024
1 parent e11e9df commit 7137791
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SpongeAPI
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ public static void register(final DataProviderRegistrator registrator) {
return true;
})
.supports(h -> !h.has(DataComponents.MAX_DAMAGE))
.create(Keys.MODEL)
.get(stack -> (ResourceKey) (Object) stack.get(DataComponents.ITEM_MODEL))
.set((stack, model) -> stack.set(DataComponents.ITEM_MODEL, (ResourceLocation) (Object) model))
.create(Keys.ITEM_DURABILITY)
.get(stack -> stack.getMaxDamage() - stack.getDamageValue())
.set((stack, durability) -> stack.setDamageValue(stack.getMaxDamage() - durability))
Expand Down

0 comments on commit 7137791

Please sign in to comment.