mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-04 08:59:47 +01:00
Fix calling saveGameProfile ignored
This commit is contained in:
parent
e76f4f4ae6
commit
7045c5998c
@ -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)) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user