Skip to content

Conversation

@Zorbatron
Copy link
Member

@Zorbatron Zorbatron commented Sep 16, 2025

What

Adds a method to MetaValueItem to create an ItemStacks capabilities with a certain NBT tag.
Idk why forge decided to have capabilities act on a separate NBT tag than the one of the item stack.

@Zorbatron Zorbatron requested a review from a team as a code owner September 16, 2025 20:40
@Zorbatron Zorbatron added the type: feature New feature or request label Sep 16, 2025
@Zorbatron Zorbatron closed this Sep 16, 2025
@Zorbatron Zorbatron deleted the zb/meta-item-with-nbt branch September 16, 2025 21:10
@Zorbatron Zorbatron restored the zb/meta-item-with-nbt branch September 16, 2025 21:17
@Zorbatron Zorbatron reopened this Sep 16, 2025
@Zorbatron Zorbatron changed the title Add method to MetaValueItem to create an ItemStack with NBT Add method to MetaValueItem to create an ItemStack with capability NBT Sep 17, 2025
Comment on lines +52 to +57
int index = 0;
for (ICapabilityProvider provider : providers) {
if (provider instanceof INBTSerializable<?>serializable) {
tag.setTag(String.valueOf(index++), serializable.serializeNBT());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd probably use an indexed for loop since that's basically what you're doing anyways

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

Labels

type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants