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

AnyTyped #7343

Closed
wants to merge 1 commit into from
Closed

Conversation

sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Jan 1, 2025

Description

AnyProvider for typed classes, to support extensions of ExprTypeOf.

Supersedes #7340 if it works.


Target Minecraft Versions: any
Requirements: none
Related Issues: none

@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jan 1, 2025
Comment on lines 54 to 60
return EntityData.class.isAssignableFrom(returnType) ? EntityData.class
: ItemType.class.isAssignableFrom(returnType) ? ItemType.class
: PotionEffectType.class.isAssignableFrom(returnType) ? PotionEffectType.class
: BlockData.class.isAssignableFrom(returnType) ? ItemType.class : Object.class;
: BlockData.class.isAssignableFrom(returnType) ? ItemType.class
: EnchantmentType.class.isAssignableFrom(returnType) ? Enchantment.class
: Object.class;
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this still safe? Won't the expression type just be the converted AnyTyped for BlockData and potions?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah this draft basically needs to be redone, I think I'll be closing it for now

@sovdeeth sovdeeth closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants