SkriptLang / skript-reflect

Powerful reflection utilities for Skript.
MIT License
56 stars 19 forks source link

Vector with decimal is broken randomly #87

Open eiqq opened 4 months ago

eiqq commented 4 months ago

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

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 commented 4 months ago

++ 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 commented 3 months ago

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.