I am referencing PlayerUtil.getMovementSpeed(player);
in my Speed class, and in my PlayerUtil class, I have the method defined as:
public static double getMovementSpeed(Player player) {
//my code here
}
But whenever the getMovementSpeed method is referenced in my other classes, it throws this error:
java.lang.NoSuchMethodError: net.Swedz.util.PlayerUtil.getMovementSpeed(Lorg/bukkit/entity/Player;)D
I thought it may be that Eclipse was exporting incorrectly, but I rebooted it and tried again with no avail.
EDIT: I did try decompiling the exported jar, and the public static double getMovementSpeed(Player player)
method does exist in the exported jar.
EDIT: My friend is also having a similar issue, and is using IntelliJ, so Eclipse is not the issue.
EDIT: Class definition for PlayerUtil:
package net.Swedz.util;
public class PlayerUtil implements Listener {
//getMovementSpeed is defined in here
}
Class definition for Speed:
package net.Swedz.hack.detect.move;
public class Speed implements Hack, Listener {
//my detection methods and method containing PlayerUtil.getMovementSpeed(player);
}
SOLUTION: I found on my own that I had classes conflicting between two plugins on my server. I had one jar with net.Swedz.util.PlayerUtil
and another with net.Swedz.util.PlayerUtil
both with different contents. I added my project name in all lower case after the net.Swedz
and it seems to have fixed it!
Thanks!
import net.Swedz.util.PlayerUtil;
– FrangiblePlayer
actually inpackage org.bukkit.entity
? – SdPlayer
inPlayerUtil.java
?Speed
expects to sendorg.bukkit.entity.Player
is that whatPlayerUtil
is expecting to receive? – Tambergimport org.bukkit.entity.Player;
in PlayerUtil – Frangible