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

Refactor/JavaNative: Ability to override a class' ZenCode-Name #160

Open
kindlich opened this issue Jul 24, 2024 · 0 comments
Open

Refactor/JavaNative: Ability to override a class' ZenCode-Name #160

kindlich opened this issue Jul 24, 2024 · 0 comments
Labels
CraftTweaker All Issues that are needed by CraftTweaker JavaIntegration All issues that relate to integrating ZenCode with existing Java Code
Milestone

Comments

@kindlich
Copy link
Member

In CraftTweaker, we add a special NativeTypeRegistration to allow registering of Types from Minecraft where we cannot just add @Name.

In order for this approach to work, we need to be able to hook into the process that resolves a Class<?> from Java into a ZC-specific name.

In this example code:

@NativeTypeRegistration(value = ItemStack.class, zenCodeName = "crafttweaker.api.item.ItemStack")
public class ExpandItemStack {
}

We want ZenCode to resolve ItemStack's name in the same way as if @Name("crafttweaker.api.item.ItemStack") had been applied to the ItemStack class.

@kindlich kindlich added CraftTweaker All Issues that are needed by CraftTweaker JavaIntegration All issues that relate to integrating ZenCode with existing Java Code labels Jul 24, 2024
@kindlich kindlich added this to the Refactor milestone Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CraftTweaker All Issues that are needed by CraftTweaker JavaIntegration All issues that relate to integrating ZenCode with existing Java Code
Projects
None yet
Development

No branches or pull requests

1 participant