Fix calling saveGameProfile ignored

This commit is contained in:
libraryaddict 2017-07-11 04:41:04 +12:00
parent e76f4f4ae6
commit 7045c5998c
2 changed files with 15 additions and 4 deletions

View File

@ -735,7 +735,9 @@ public class DisguiseUtilities {
WrappedGameProfile gameProfile = ReflectionManager.getGameProfile(player);
if (!gameProfile.getProperties().isEmpty()) {
addGameProfile(playerName, gameProfile);
if (DisguiseConfig.isSaveGameProfiles()) {
addGameProfile(playerName, gameProfile);
}
return gameProfile;
}
@ -755,7 +757,9 @@ public class DisguiseUtilities {
return;
}
addGameProfile(playerName, gameProfile);
if (DisguiseConfig.isSaveGameProfiles()) {
addGameProfile(playerName, gameProfile);
}
if (runnables.containsKey(playerName)) {
for (Object obj : runnables.remove(playerName)) {

View File

@ -449,7 +449,7 @@ public class ReflectionManager {
public static Object getNmsItem(ItemStack itemstack) {
try {
return craftItemClass.getDeclaredMethod("asNMSCopy", ItemStack.class).invoke(null, itemstack);
return craftItemClass.getMethod("asNMSCopy", ItemStack.class).invoke(null, itemstack);
}
catch (Exception e) {
e.printStackTrace();
@ -784,6 +784,13 @@ public class ReflectionManager {
catch (Exception ex) {
ex.printStackTrace();
}
} else if (val instanceof ItemStack) {
val = getNmsItem((ItemStack) val);
if (val == null)
return Optional.absent();
else
return Optional.of(val);
}
} else if (value instanceof Vector3F) {
Vector3F angle = (Vector3F) value;
@ -797,7 +804,7 @@ public class ReflectionManager {
}
} else if (value instanceof Direction) {
try {
return (Enum) getNmsMethod("EnumDirection", "fromType1", int.class)
return getNmsMethod("EnumDirection", "fromType1", int.class)
.invoke(null, ((Direction) value).ordinal());
}
catch (Exception ex) {