The name to fetch is either the skin or name. Not both. Move the runnables down to make it accessible and prevent the invalid names using it
This commit is contained in:
parent
3173ceec77
commit
af9dfb8d6e
@ -337,17 +337,19 @@ public class DisguiseUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static WrappedGameProfile getProfileFromMojang(final PlayerDisguise disguise) {
|
public static WrappedGameProfile getProfileFromMojang(final PlayerDisguise disguise) {
|
||||||
final boolean remove = getAddedByPlugins().contains(disguise.getName().toLowerCase());
|
final String nameToFetch = disguise.getSkin() != null ? disguise.getSkin() : disguise.getName();
|
||||||
return getProfileFromMojang(disguise.getName(), new LibsProfileLookup() {
|
final boolean remove = getAddedByPlugins().contains(nameToFetch.toLowerCase());
|
||||||
|
return getProfileFromMojang(nameToFetch, new LibsProfileLookup() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLookup(WrappedGameProfile gameProfile) {
|
public void onLookup(WrappedGameProfile gameProfile) {
|
||||||
if (remove) {
|
if (remove) {
|
||||||
getAddedByPlugins().remove(disguise.getName().toLowerCase());
|
getAddedByPlugins().remove(nameToFetch.toLowerCase());
|
||||||
}
|
}
|
||||||
if (DisguiseAPI.isDisguiseInUse(disguise)
|
if (DisguiseAPI.isDisguiseInUse(disguise)
|
||||||
&& (!gameProfile.getName().equals(disguise.getName()) || (LibVersion.is1_7_6() && !gameProfile
|
&& (!gameProfile.getName().equals(
|
||||||
.getProperties().isEmpty()))) {
|
disguise.getSkin() != null && LibVersion.is1_7_6() ? disguise.getSkin() : disguise.getName()) || (LibVersion
|
||||||
|
.is1_7_6() && !gameProfile.getProperties().isEmpty()))) {
|
||||||
// TODO Resend for UUID? Might need to in the future.
|
// TODO Resend for UUID? Might need to in the future.
|
||||||
DisguiseUtilities.refreshTrackers(disguise);
|
DisguiseUtilities.refreshTrackers(disguise);
|
||||||
}
|
}
|
||||||
@ -411,12 +413,14 @@ public class DisguiseUtilities {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (runnable != null) {
|
} else {
|
||||||
if (!runnables.containsKey(playerName)) {
|
return ReflectionManager.getGameProfile(null, origName);
|
||||||
runnables.put(playerName, new ArrayList<Object>());
|
}
|
||||||
}
|
if (runnable != null) {
|
||||||
runnables.get(playerName).add(runnable);
|
if (!runnables.containsKey(playerName)) {
|
||||||
|
runnables.put(playerName, new ArrayList<Object>());
|
||||||
}
|
}
|
||||||
|
runnables.get(playerName).add(runnable);
|
||||||
}
|
}
|
||||||
return ReflectionManager.getGameProfile(null, origName);
|
return ReflectionManager.getGameProfile(null, origName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user