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

Allow non-static final constant values #10

Open
liach opened this issue Apr 3, 2021 · 0 comments
Open

Allow non-static final constant values #10

liach opened this issue Apr 3, 2021 · 0 comments

Comments

@liach
Copy link

liach commented Apr 3, 2021

Yes, in Java, constant values can be non-static, and they exist in Minecraft (and are optimized by javac). Examples:
SpawnGroup.despawnStartRange
ServerLoginNetworkHandler.serverId

Technically, to generate bytecode, instead of just using getstatic to replace ldc, you might need a bit more instructions, like aload_0 and then getfield (might need to expand maxs as a result), and check to ensure the method is non-static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant