Fix outdated code which would make huge problems because of previous fix
This commit is contained in:
parent
841dab296d
commit
5bfd6c5541
@ -1,5 +1,7 @@
|
|||||||
package me.libraryaddict.disguise.disguisetypes;
|
package me.libraryaddict.disguise.disguisetypes;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.LibsProfileLookup;
|
import me.libraryaddict.disguise.utilities.LibsProfileLookup;
|
||||||
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
||||||
@ -58,7 +60,7 @@ public class PlayerDisguise extends TargetedDisguise {
|
|||||||
}
|
}
|
||||||
return ReflectionManager.getGameProfile(null, getName());
|
return ReflectionManager.getGameProfile(null, getName());
|
||||||
} else {
|
} else {
|
||||||
return DisguiseUtilities.getProfileFromMojang(getName());
|
return DisguiseUtilities.getProfileFromMojang(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +102,9 @@ public class PlayerDisguise extends TargetedDisguise {
|
|||||||
setGameProfile(gameProfile);
|
setGameProfile(gameProfile);
|
||||||
if (DisguiseUtilities.isDisguiseInUse(PlayerDisguise.this)) {
|
if (DisguiseUtilities.isDisguiseInUse(PlayerDisguise.this)) {
|
||||||
DisguiseUtilities.refreshTrackers(PlayerDisguise.this);
|
DisguiseUtilities.refreshTrackers(PlayerDisguise.this);
|
||||||
|
if (getEntity() instanceof Player && isSelfDisguiseVisible()) {
|
||||||
|
DisguiseUtilities.sendSelfDisguise((Player) getEntity(), PlayerDisguise.this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,23 +294,19 @@ public class DisguiseUtilities {
|
|||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object getProfileFromMojang(final String playerName) {
|
public static Object getProfileFromMojang(final PlayerDisguise disguise) {
|
||||||
return getProfileFromMojang(playerName, new LibsProfileLookup() {
|
return getProfileFromMojang(disguise.getName(), new LibsProfileLookup() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLookup(Object gameProfile) {
|
public void onLookup(Object gameProfile) {
|
||||||
getAddedByPlugins().remove(playerName);
|
getAddedByPlugins().remove(disguise.getName());
|
||||||
for (HashSet<TargetedDisguise> disguises : DisguiseUtilities.getDisguises().values()) {
|
if (DisguiseAPI.isDisguiseInUse(disguise)) {
|
||||||
for (TargetedDisguise disguise : disguises) {
|
|
||||||
if (disguise.getType() == DisguiseType.PLAYER && ((PlayerDisguise) disguise).getName().equals(playerName)) {
|
|
||||||
DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise);
|
DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise);
|
||||||
if (disguise.getEntity() instanceof Player && disguise.isSelfDisguiseVisible()) {
|
if (disguise.getEntity() instanceof Player && disguise.isSelfDisguiseVisible()) {
|
||||||
DisguiseUtilities.sendSelfDisguise((Player) disguise.getEntity(), disguise);
|
DisguiseUtilities.sendSelfDisguise((Player) disguise.getEntity(), disguise);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user