use of org.spongepowered.common.data.manipulator.immutable.item.ImmutableSpongeEnchantmentData in project SpongeCommon by SpongePowered.
the class ImmutableItemEnchantmentDataBuilder method buildContent.
@Override
protected Optional<ImmutableEnchantmentData> buildContent(DataView container) throws InvalidDataException {
checkDataExists(container, Keys.ITEM_ENCHANTMENTS.getQuery());
final List<Enchantment> enchantments = container.getSerializableList(Keys.ITEM_ENCHANTMENTS.getQuery(), Enchantment.class).get();
return Optional.of(new ImmutableSpongeEnchantmentData(enchantments));
}
Aggregations