Forward skin from ProtocolLib verification response

This commit is contained in:
games647
2018-03-16 16:40:12 +01:00
parent 78f8fa1f05
commit 8b613a48cc

View File

@ -9,6 +9,7 @@ import com.comphenix.protocol.reflect.FuzzyReflection;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.github.games647.craftapi.model.auth.Verification;
import com.github.games647.craftapi.model.skin.SkinProperty;
import com.github.games647.craftapi.resolver.MojangResolver;
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
import com.github.games647.fastlogin.bukkit.EncryptionUtil;
@ -107,8 +108,14 @@ public class VerifyResponseTask implements Runnable {
if (response.isPresent()) {
plugin.getLog().info("GameProfile {} has a verified premium account", username);
SkinProperty[] properties = response.get().getProperties();
if (properties.length > 0) {
session.setSkinProperty(properties[0]);
}
session.setVerified(true);
setPremiumUUID(session.getUuid());
receiveFakeStartPacket(username);
} else {
//user tried to fake a authentication