mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-08-22 22:53:01 +02:00
My bad.. Didn't know GameProfiles were like this in 1.7
This commit is contained in:
parent
a588e06e46
commit
d4d657e53b
|
@ -16,18 +16,14 @@ import org.bukkit.inventory.ItemStack;
|
|||
|
||||
public class ReflectionManager {
|
||||
public enum LibVersion {
|
||||
V1_6, V1_7, V1_7_3;
|
||||
V1_6, V1_7;
|
||||
private static LibVersion currentVersion;
|
||||
static {
|
||||
if (getBukkitVersion().startsWith("v1_")) {
|
||||
try {
|
||||
int version = Integer.parseInt(getBukkitVersion().split("_")[1]);
|
||||
if (version == 7) {
|
||||
if (Integer.parseInt(getBukkitVersion().split("_")[1]) < 3) {
|
||||
currentVersion = LibVersion.V1_7;
|
||||
} else {
|
||||
currentVersion = LibVersion.V1_7_3;
|
||||
}
|
||||
currentVersion = LibVersion.V1_7;
|
||||
} else {
|
||||
if (version < 7) {
|
||||
currentVersion = LibVersion.V1_6;
|
||||
|
@ -50,11 +46,7 @@ public class ReflectionManager {
|
|||
}
|
||||
|
||||
public static boolean is1_7() {
|
||||
return getGameVersion() == V1_7 || getGameVersion() == V1_7_3;
|
||||
}
|
||||
|
||||
public static boolean is1_7_3() {
|
||||
return getGameVersion() == V1_7_3;
|
||||
return getGameVersion() == V1_7;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +207,7 @@ public class ReflectionManager {
|
|||
}
|
||||
|
||||
public static Object getGameProfile(Player player) {
|
||||
if (LibVersion.is1_7_3()) {
|
||||
if (LibVersion.is1_7()) {
|
||||
try {
|
||||
return getNmsClass("EntityHuman").getMethod("getProfile").invoke(getNmsEntity(player));
|
||||
} catch (Exception ex) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user