aadnk / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
287 stars 92 forks source link

TinyProtocol Reflection Error #103

Closed mastergberry closed 8 years ago

mastergberry commented 8 years ago

Found this when doing some TinyProtocol stuff on my own system. Wasted some time trying to figure out why the Reflection was not working properly and picking the wrong method.

Missing a pair of partheneses around

(returnType == null) || method.getReturnType().equals(returnType)

Should be

((returnType == null) || method.getReturnType().equals(returnType))

https://github.com/aadnk/ProtocolLib/blob/master/modules/TinyProtocol/src/main/java/com/comphenix/tinyprotocol/Reflection.java#L218

As a result the order of operations is ignoring the Arrays.equals() call in some cases.

Could be wrong, but i'm 99% sure this just fixed my issue with the wrong method being found.