diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitLoginSession.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitLoginSession.java index b8e70835..dc458373 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitLoginSession.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitLoginSession.java @@ -1,6 +1,6 @@ package com.github.games647.fastlogin.bukkit; -import com.github.games647.craftapi.model.skin.Property; +import com.github.games647.craftapi.model.skin.SkinProperty; import com.github.games647.fastlogin.core.StoredProfile; import com.github.games647.fastlogin.core.shared.LoginSession; @@ -20,7 +20,7 @@ public class BukkitLoginSession extends LoginSession { private boolean verified; - private Property skinProperty; + private SkinProperty skinProperty; public BukkitLoginSession(String username, String serverId, byte[] verifyToken, boolean registered , StoredProfile profile) { @@ -54,7 +54,7 @@ public class BukkitLoginSession extends LoginSession { /** * @return premium skin if available */ - public synchronized Optional getSkin() { + public synchronized Optional getSkin() { return Optional.ofNullable(skinProperty); } @@ -62,7 +62,7 @@ public class BukkitLoginSession extends LoginSession { * Sets the premium skin property which was retrieved by the session server * @param skinProperty premium skin */ - public synchronized void setSkinProperty(Property skinProperty) { + public synchronized void setSkinProperty(SkinProperty skinProperty) { this.skinProperty = skinProperty; } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/SkinApplyListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/SkinApplyListener.java index 0de8bed4..4306ce4d 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/SkinApplyListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/SkinApplyListener.java @@ -6,7 +6,7 @@ import com.comphenix.protocol.reflect.accessors.MethodAccessor; import com.comphenix.protocol.utility.MinecraftReflection; import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.comphenix.protocol.wrappers.WrappedSignedProperty; -import com.github.games647.craftapi.model.skin.Property; +import com.github.games647.craftapi.model.skin.Textures; import com.github.games647.fastlogin.bukkit.BukkitLoginSession; import com.github.games647.fastlogin.bukkit.FastLoginBukkit; @@ -54,14 +54,14 @@ public class SkinApplyListener implements Listener { private void applySkin(Player player, String skinData, String signature) { WrappedGameProfile gameProfile = WrappedGameProfile.fromPlayer(player); - WrappedSignedProperty skin = WrappedSignedProperty.fromValues(Property.TEXTURE_KEY, skinData, signature); + WrappedSignedProperty skin = WrappedSignedProperty.fromValues(Textures.KEY, skinData, signature); try { - gameProfile.getProperties().put(Property.TEXTURE_KEY, skin); + gameProfile.getProperties().put(Textures.KEY, skin); } catch (ClassCastException castException) { //Cauldron, MCPC, Thermos, ... Object map = GET_PROPERTIES.invoke(gameProfile.getHandle()); try { - MethodUtils.invokeMethod(map, "put", new Object[]{Property.TEXTURE_KEY, skin.getHandle()}); + MethodUtils.invokeMethod(map, "put", new Object[]{Textures.KEY, skin.getHandle()}); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { plugin.getLog().error("Error setting premium skin of: {}", player, ex); } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java index fa456287..149d231f 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java @@ -9,7 +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.Property; +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; @@ -108,7 +108,7 @@ public class VerifyResponseTask implements Runnable { if (response.isPresent()) { plugin.getLog().info("GameProfile {} has a verified premium account", username); - Property[] properties = response.get().getProperties(); + SkinProperty[] properties = response.get().getProperties(); if (properties.length > 0) { session.setSkinProperty(properties[0]); } diff --git a/core/pom.xml b/core/pom.xml index fdb81815..e62083af 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -67,7 +67,7 @@ com.github.games647 craftapi - 0.1.3-SNAPSHOT + 0.2