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

Vector with decimal is broken randomly #87

Open
eiqq opened this issue Jan 18, 2024 · 2 comments
Open

Vector with decimal is broken randomly #87

eiqq opened this issue Jan 18, 2024 · 2 comments

Comments

@eiqq
Copy link

eiqq commented Jan 18, 2024

Describe the bug
A clear and concise description of what the bug is.

The Vector class(org.bukkit.util.Vector) 's random XYZ value, which contains decimal, becomes an integer value permantly.
Which value becomes an integer is changes randomly every time the server is run.

To reproduce
Steps to reproduce the behavior. If applicable, add a script or code snippet here.
0
it is code i used

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
1
case 1, Z is integer forever
2
case 2, all XYZ is integer
3
case 3,everything is fine

Server information

  • skript-reflect: 2.4
  • Skript: 2.8.0
  • Bukkit: Purpur 1.20.2
  • Minecraft: 1.20.2
  • Java: jdk-17
  • OS: Window 11

Additional context
Add any other context about the problem here.

I found this bug when im using Skript 2.6.4 + Skript-reflect 2.3

@eiqq
Copy link
Author

eiqq commented Jan 18, 2024

++
I Tested by logging.
i expect this bug is from "Optional method = findCompatibleMethod(descriptor, argumentsCopy);" in "ExprJavaCall" class's "private T invoke(Object target, Object[] arguments, Descriptor baseDescriptor)" method. every time server restarts, X Y Z values set to int,float,double randomly.

a

@Pesekjak
Copy link

I believe this is not a bug, there are multiple overloaded methods in the Vector class. You have to specify the method descriptor in this case.

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

2 participants