From 2bba64e521668140d0ab1e6c86b0de8c85176d6c Mon Sep 17 00:00:00 2001 From: aro Date: Tue, 31 Jan 2023 18:11:05 +0100 Subject: [PATCH] feat(global): downgrade project to jre1.8 for compatibility reasons also fixed the impossibility to compile 1.13 to 1.16 because the PlayerInfoData class is NOT static toying with NMS is not recommended and i can see why but this is on another level --- core/dependency-reduced-pom.xml | 10 ---- core/pom.xml | 2 - .../nicko/bukkit/BungeeCordSupport.java | 4 +- .../artelnatif/nicko/bukkit/NickoBukkit.java | 6 +- .../nicko/bukkit/command/NickoCommand.java | 23 +++++--- .../bukkit/command/sub/NickoCheckSubCmd.java | 2 +- .../bukkit/command/sub/NickoDebugSubCmd.java | 2 +- .../nicko/bukkit/gui/SettingsGUI.java | 2 +- .../gui/items/settings/LanguageCycling.java | 2 +- .../artelnatif/nicko/bukkit/i18n/I18N.java | 4 +- .../nicko/bukkit/i18n/I18NDict.java | 10 +++- .../bukkit/placeholder/NickoExpansion.java | 14 ++--- .../nicko/config/Configuration.java | 55 ++++++++++++++++--- .../artelnatif/nicko/mojang/MojangAPI.java | 14 ++--- .../artelnatif/nicko/mojang/MojangSkin.java | 21 ++++++- .../nicko/storage/PlayerDataStore.java | 2 +- .../nicko/storage/sql/SQLStorage.java | 7 +-- .../nicko/storage/sql/SQLStorageProvider.java | 22 +++----- pom.xml | 4 +- .../net/artelnatif/nicko/impl/v1_13_R1.java | 36 +++++++++--- .../net/artelnatif/nicko/impl/v1_13_R2.java | 36 +++++++++--- .../net/artelnatif/nicko/impl/v1_14_R1.java | 36 +++++++++--- .../net/artelnatif/nicko/impl/v1_15_R1.java | 38 ++++++++++--- .../net/artelnatif/nicko/impl/v1_16_R1.java | 38 ++++++++++--- .../net/artelnatif/nicko/impl/v1_16_R2.java | 36 +++++++++--- .../net/artelnatif/nicko/impl/v1_16_R3.java | 43 ++++++++++++--- .../net/artelnatif/nicko/impl/v1_17_R1.java | 2 +- .../net/artelnatif/nicko/impl/v1_18_R1.java | 2 +- .../net/artelnatif/nicko/impl/v1_18_R2.java | 2 +- .../net/artelnatif/nicko/impl/v1_19_R1.java | 2 +- .../net/artelnatif/nicko/impl/v1_19_R2.java | 2 +- 31 files changed, 337 insertions(+), 142 deletions(-) diff --git a/core/dependency-reduced-pom.xml b/core/dependency-reduced-pom.xml index e35d9f3..cb568d5 100644 --- a/core/dependency-reduced-pom.xml +++ b/core/dependency-reduced-pom.xml @@ -40,14 +40,6 @@ org.mariadb.jdbc - - - net.artelnatif:* - - META-INF/*.MF - - - net.wesjd.anvilgui @@ -170,8 +162,6 @@ - 17 - 17 UTF-8 diff --git a/core/pom.xml b/core/pom.xml index 00a217c..8cf7eec 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -14,8 +14,6 @@ - 17 - 17 UTF-8 diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/BungeeCordSupport.java b/core/src/main/java/net/artelnatif/nicko/bukkit/BungeeCordSupport.java index df7a21a..744893e 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/BungeeCordSupport.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/BungeeCordSupport.java @@ -13,7 +13,7 @@ public class BungeeCordSupport { public void warnNickoNotHookedToBungeeCord() { final Server server = instance.getServer(); final YamlConfiguration config = server.spigot().getConfig(); - if (config.getConfigurationSection("settings").getBoolean("bungeecord") && !instance.getNicko().getConfig().bungeecord()) { + if (config.getConfigurationSection("settings").getBoolean("bungeecord") && !instance.getNicko().getConfig().isBungeecord()) { instance.getLogger().warning("Hummm. Your server is hooked to BungeeCord, but it seems"); instance.getLogger().warning("that BungeeCord support is not enabled inside Nicko."); instance.getLogger().warning("If this is intentional, you can safely ignore this message."); @@ -24,7 +24,7 @@ public class BungeeCordSupport { public boolean stopIfBungeeCordIsNotEnabled() { final Server server = instance.getServer(); final YamlConfiguration config = server.spigot().getConfig(); - if (!config.getConfigurationSection("settings").getBoolean("bungeecord") && instance.getNicko().getConfig().bungeecord()) { + if (!config.getConfigurationSection("settings").getBoolean("bungeecord") && instance.getNicko().getConfig().isBungeecord()) { instance.getLogger().severe("Hummm. You have enabled BungeeCord support inside Nicko,"); instance.getLogger().severe("but it seems that your server is not hooked to your BungeeCord instance."); instance.getLogger().severe("Please enable BungeeCord support inside your spigot.yml as well."); diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/NickoBukkit.java b/core/src/main/java/net/artelnatif/nicko/bukkit/NickoBukkit.java index 91ede9d..dc6d7b1 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/NickoBukkit.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/NickoBukkit.java @@ -87,7 +87,7 @@ public class NickoBukkit extends JavaPlugin { mojangAPI = new MojangAPI(nicko); localeFileManager = new LocaleFileManager(); - if (nicko.getConfig().customLocale()) { + if (nicko.getConfig().isCustomLocale()) { if (localeFileManager.dumpFromLocale(Locale.ENGLISH)) { getLogger().info("Successfully loaded custom language file."); } else { @@ -111,7 +111,7 @@ public class NickoBukkit extends JavaPlugin { final BungeeCordSupport support = new BungeeCordSupport(this); support.warnNickoNotHookedToBungeeCord(); - if (nicko.getConfig().bungeecord()) { + if (nicko.getConfig().isBungeecord()) { if (support.stopIfBungeeCordIsNotEnabled()) { getLogger().info("Enabling BungeeCord support..."); getServer().getMessenger().registerIncomingPluginChannel(this, NickoBungee.PROXY_UPDATE, new PluginMessageHandler()); @@ -133,7 +133,7 @@ public class NickoBukkit extends JavaPlugin { } } - if (nicko.getConfig().bungeecord()) { + if (nicko.getConfig().isBungeecord()) { getServer().getMessenger().unregisterIncomingPluginChannel(this); getServer().getMessenger().unregisterOutgoingPluginChannel(this); } diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/command/NickoCommand.java b/core/src/main/java/net/artelnatif/nicko/bukkit/command/NickoCommand.java index 6f75adb..98fe35e 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/command/NickoCommand.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/command/NickoCommand.java @@ -10,20 +10,25 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class NickoCommand implements CommandExecutor { - private String helpMessage = """ - §cNicko §8§o[{version}] §f- §2Help: - §6/nicko §f- §7Open the GUI. - §6/nicko help §f- §7Print this help message. - """; + private String helpMessage = "§cNicko §8§o[{version}] §f- §2Help:\n" + + "§6/nicko §f- §7Open the GUI.\n" + + "§6/nicko help §f- §7Print this help message.\n"; @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (sender instanceof Player player) { + if (sender instanceof Player) { + Player player = (Player) sender; if (args.length >= 1) { switch (args[0]) { - case "debug" -> new NickoDebugSubCmd().execute(sender, args); - case "check" -> new NickoCheckSubCmd().execute(player, args); - default -> sendHelpMessage(sender); + case "debug": + new NickoDebugSubCmd().execute(player, args); + break; + case "check": + new NickoCheckSubCmd().execute(player, args); + break; + default: + sendHelpMessage(sender); + break; } return false; } diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoCheckSubCmd.java b/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoCheckSubCmd.java index 4569eec..6c9ac80 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoCheckSubCmd.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoCheckSubCmd.java @@ -28,7 +28,7 @@ public class NickoCheckSubCmd { } final StringJoiner builder = new StringJoiner("\n"); - builder.add("§c" + NickoBukkit.getInstance().getNicko().getConfig().prefix() + "§6Check for: §f§o" + targetName); + builder.add("§c" + NickoBukkit.getInstance().getNicko().getConfig().getPrefix() + "§6Check for: §f§o" + targetName); if (!appearanceManager.hasData()) { builder.add("§cThis player has not data."); } else { diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoDebugSubCmd.java b/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoDebugSubCmd.java index 51f51e2..e318d2d 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoDebugSubCmd.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/command/sub/NickoDebugSubCmd.java @@ -10,7 +10,7 @@ import org.bukkit.entity.Player; public class NickoDebugSubCmd { public void execute(CommandSender sender, String[] args) { - final String prefix = NickoBukkit.getInstance().getNicko().getConfig().prefix(); + final String prefix = NickoBukkit.getInstance().getNicko().getConfig().getPrefix(); Player target; String name, skin; diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/gui/SettingsGUI.java b/core/src/main/java/net/artelnatif/nicko/bukkit/gui/SettingsGUI.java index 5ae2aff..9588e63 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/gui/SettingsGUI.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/gui/SettingsGUI.java @@ -24,7 +24,7 @@ public class SettingsGUI { }; final Nicko nicko = NickoBukkit.getInstance().getNicko(); - if (!nicko.getConfig().bungeecord() && nicko.isBungeecord()) { + if (!nicko.getConfig().isBungeecord() && nicko.isBungeecord()) { dynamicStructure[1] = dynamicStructure[1].replace("T", "U"); } diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/gui/items/settings/LanguageCycling.java b/core/src/main/java/net/artelnatif/nicko/bukkit/gui/items/settings/LanguageCycling.java index 6c1df4e..32f24e3 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/gui/items/settings/LanguageCycling.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/gui/items/settings/LanguageCycling.java @@ -52,7 +52,7 @@ public class LanguageCycling { final ArrayList localesToGenerate = new ArrayList<>(); Collections.addAll(localesToGenerate, Locale.values()); - if (!instance.getNicko().getConfig().customLocale()) { + if (!instance.getNicko().getConfig().isCustomLocale()) { localesToGenerate.remove(Locale.CUSTOM); } localesToGenerate.forEach(locale -> items.add(generateItem(locale, localesToGenerate))); diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18N.java b/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18N.java index 77b1a67..093f965 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18N.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18N.java @@ -29,9 +29,9 @@ public class I18N { try { formatter.applyPattern(translation); - return instance.getNicko().getConfig().prefix() + formatter.format(arguments); + return instance.getNicko().getConfig().getPrefix() + formatter.format(arguments); } catch (Exception e) { - return instance.getNicko().getConfig().prefix() + key.key(); + return instance.getNicko().getConfig().getPrefix() + key.key(); } } diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18NDict.java b/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18NDict.java index b2a2d66..0d321f3 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18NDict.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/i18n/I18NDict.java @@ -1,6 +1,10 @@ package net.artelnatif.nicko.bukkit.i18n; -public record I18NDict(String key) { +public class I18NDict { + private final String key; + + public I18NDict(String key) { this.key = key; } + public static class Event { public static class Admin { public static final I18NDict CACHE_CLEAN = new I18NDict("event.admin.cache_clear"); @@ -33,4 +37,8 @@ public record I18NDict(String key) { public static final I18NDict SQL_ERROR = new I18NDict("error.sql"); public static final I18NDict JSON_ERROR = new I18NDict("error.json"); } + + public String key() { + return key; + } } diff --git a/core/src/main/java/net/artelnatif/nicko/bukkit/placeholder/NickoExpansion.java b/core/src/main/java/net/artelnatif/nicko/bukkit/placeholder/NickoExpansion.java index eb9460d..4058733 100644 --- a/core/src/main/java/net/artelnatif/nicko/bukkit/placeholder/NickoExpansion.java +++ b/core/src/main/java/net/artelnatif/nicko/bukkit/placeholder/NickoExpansion.java @@ -59,12 +59,12 @@ public class NickoExpansion extends PlaceholderExpansion { bungeecord = profile.isBungeecordTransfer(); } - return switch (params) { - case "name" -> name; - case "skin" -> skin; - case "locale" -> locale; - case "bungeecord" -> String.valueOf(bungeecord); - default -> null; - }; + switch (params) { + case "name": return name; + case "skin": return skin; + case "locale": return locale; + case "bungeecord": return String.valueOf(bungeecord); + default: return null; + } } } diff --git a/core/src/main/java/net/artelnatif/nicko/config/Configuration.java b/core/src/main/java/net/artelnatif/nicko/config/Configuration.java index cba7486..4ac7bb8 100644 --- a/core/src/main/java/net/artelnatif/nicko/config/Configuration.java +++ b/core/src/main/java/net/artelnatif/nicko/config/Configuration.java @@ -1,14 +1,53 @@ package net.artelnatif.nicko.config; -public record Configuration( - String address, - String username, - String password, - String prefix, - Boolean local, - Boolean bungeecord, - Boolean customLocale) { +public class Configuration { + private final String address; + private final String username; + private final String password; + private final String prefix; + private final Boolean local; + private final Boolean bungeecord; + private final Boolean customLocale; + + public Configuration(String address, String username, String password, String prefix, Boolean local, Boolean bungeecord, Boolean customLocale) { + this.address = address; + this.username = username; + this.password = password; + this.prefix = prefix; + this.local = local; + this.bungeecord = bungeecord; + this.customLocale = customLocale; + } + public Configuration() { this("", "", "", "", false, false, false); } + + public String getAddress() { + return address; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } + + public String getPrefix() { + return prefix; + } + + public Boolean isLocal() { + return local; + } + + public Boolean isBungeecord() { + return bungeecord; + } + + public Boolean isCustomLocale() { + return customLocale; + } } diff --git a/core/src/main/java/net/artelnatif/nicko/mojang/MojangAPI.java b/core/src/main/java/net/artelnatif/nicko/mojang/MojangAPI.java index ba29006..67d2013 100644 --- a/core/src/main/java/net/artelnatif/nicko/mojang/MojangAPI.java +++ b/core/src/main/java/net/artelnatif/nicko/mojang/MojangAPI.java @@ -23,7 +23,7 @@ public class MojangAPI { public static final String URL_NAME = "https://api.mojang.com/users/profiles/minecraft/{name}"; public static final String URL_SKIN = "https://sessionserver.mojang.com/session/minecraft/profile/{uuid}?unsigned=false"; - private final CacheLoader> loader = new CacheLoader<>() { + private final CacheLoader> loader = new CacheLoader>() { @Nonnull public Optional load(@Nonnull String uuid) throws Exception { return getSkinFromMojang(uuid); @@ -77,15 +77,13 @@ public class MojangAPI { con.setRequestMethod("GET"); switch (con.getResponseCode()) { - case 400 -> { + case 400: nicko.getLogger().warning("Failed to parse request: Invalid Name"); return getErrorObject(); - } - case 429 -> { + case 429: nicko.getLogger().warning("Failed to parse request: The connection is throttled."); return getErrorObject(); - } - case 200 -> { + case 200: final BufferedReader input = new BufferedReader(new InputStreamReader(con.getInputStream())); final StringBuilder builder = new StringBuilder(); String line; @@ -100,11 +98,9 @@ public class MojangAPI { nicko.getLogger().warning("Failed to parse request (" + parametrizedUrl + ")!"); return getErrorObject(); } - } - default -> { + default: nicko.getLogger().warning("Unhandled response code from Mojang: " + con.getResponseCode()); return getErrorObject(); - } } } diff --git a/core/src/main/java/net/artelnatif/nicko/mojang/MojangSkin.java b/core/src/main/java/net/artelnatif/nicko/mojang/MojangSkin.java index 4d1ad1b..8980bcb 100644 --- a/core/src/main/java/net/artelnatif/nicko/mojang/MojangSkin.java +++ b/core/src/main/java/net/artelnatif/nicko/mojang/MojangSkin.java @@ -2,12 +2,27 @@ package net.artelnatif.nicko.mojang; import com.google.gson.JsonObject; -public record MojangSkin(String name, String value, String signature) { +public class MojangSkin { + private final String value; + private final String signature; + + public MojangSkin(String value, String signature) { + this.value = value; + this.signature = signature; + } + public static MojangSkin buildFromJson(JsonObject object) { - final String name = object.get("name").getAsString(); final JsonObject properties = object.get("properties").getAsJsonArray().get(0).getAsJsonObject(); final String value = properties.get("value").getAsString(); final String signature = properties.get("signature").getAsString(); - return new MojangSkin(name, value, signature); + return new MojangSkin(value, signature); + } + + public String getValue() { + return value; + } + + public String getSignature() { + return signature; } } diff --git a/core/src/main/java/net/artelnatif/nicko/storage/PlayerDataStore.java b/core/src/main/java/net/artelnatif/nicko/storage/PlayerDataStore.java index edb6465..233f1bf 100644 --- a/core/src/main/java/net/artelnatif/nicko/storage/PlayerDataStore.java +++ b/core/src/main/java/net/artelnatif/nicko/storage/PlayerDataStore.java @@ -20,7 +20,7 @@ public class PlayerDataStore { public PlayerDataStore(Nicko nicko) { this.nicko = nicko; - this.storage = nicko.getConfig().local() && !nicko.isBungeecord() ? new JSONStorage(nicko) : new SQLStorage(nicko); + this.storage = nicko.getConfig().isLocal() && !nicko.isBungeecord() ? new JSONStorage(nicko) : new SQLStorage(nicko); } public void storeName(Player player) { diff --git a/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorage.java b/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorage.java index f6972d3..2d82ece 100644 --- a/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorage.java +++ b/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorage.java @@ -37,12 +37,7 @@ public class SQLStorage extends Storage { if (connection == null) return new ActionResult<>(I18NDict.Error.SQL_ERROR); try { - final String sql = """ - INSERT IGNORE INTO nicko.DATA - (`uuid`, `name`, `skin`, `bungeecord`) - VALUES - (?, ?, ?, ?) - """; + final String sql = "INSERT IGNORE INTO nicko.DATA (`uuid`, `name`, `skin`, `bungeecord`) VALUES (?, ?, ?, ?)"; final PreparedStatement statement = connection.prepareStatement(sql); statement.setObject(1, uuidToBin(uuid)); diff --git a/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorageProvider.java b/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorageProvider.java index 3d03203..060c37d 100644 --- a/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorageProvider.java +++ b/core/src/main/java/net/artelnatif/nicko/storage/sql/SQLStorageProvider.java @@ -25,9 +25,9 @@ public class SQLStorageProvider implements StorageProvider { try { final Configuration config = nicko.getConfig(); dataSource = new MariaDbDataSource(); - dataSource.setUrl("jdbc:mariadb://" + config.address()); - dataSource.setUser(config.username()); - dataSource.setPassword(config.password()); + dataSource.setUrl("jdbc:mariadb://" + config.getAddress()); + dataSource.setUser(config.getUsername()); + dataSource.setPassword(config.getPassword()); connection = dataSource.getConnection(); final boolean initialized = connection != null && !connection.isClosed(); @@ -59,15 +59,8 @@ public class SQLStorageProvider implements StorageProvider { private void createTable() { final Connection connection = getConnection(); - final String query = """ - CREATE TABLE IF NOT EXISTS %s.DATA ( - uuid binary(16) NOT NULL, - name varchar(16) NOT NULL, - skin varchar(16) NOT NULL, - bungeecord boolean NOT NULL, - PRIMARY KEY (UUID) - ) - """.formatted(schemaName); + String query = "CREATE TABLE IF NOT EXISTS %s.DATA (uuid binary(16) NOT NULL,name varchar(16) NOT NULL,skin varchar(16) NOT NULL,bungeecord boolean NOT NULL,PRIMARY KEY (UUID))"; + query = query.replace("%s", schemaName); try { final PreparedStatement statement = connection.prepareStatement(query); @@ -82,9 +75,8 @@ public class SQLStorageProvider implements StorageProvider { private void createDatabase() { final Connection connection = getConnection(); - final String query = """ - CREATE DATABASE IF NOT EXISTS %s - """.formatted(schemaName); + String query = "CREATE DATABASE IF NOT EXISTS %s"; + query = query.replace("%s", schemaName); try { final PreparedStatement statement = connection.prepareStatement(query); diff --git a/pom.xml b/pom.xml index fa15b26..b6d2b56 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ - 17 - 17 + 1.8 + 1.8 \ No newline at end of file diff --git a/v1_13_R1/src/main/java/net/artelnatif/nicko/impl/v1_13_R1.java b/v1_13_R1/src/main/java/net/artelnatif/nicko/impl/v1_13_R1.java index 659d147..637a3d7 100644 --- a/v1_13_R1/src/main/java/net/artelnatif/nicko/impl/v1_13_R1.java +++ b/v1_13_R1/src/main/java/net/artelnatif/nicko/impl/v1_13_R1.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -13,8 +14,9 @@ import org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_13_R1 implements Internals { @Override @@ -69,7 +71,7 @@ public class v1_13_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -78,12 +80,14 @@ public class v1_13_R1 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, + final Object infoData = yes( + add, + gameProfile, entityPlayer.ping, - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -103,4 +107,22 @@ public class v1_13_R1 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_13_R1.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_13_R2/src/main/java/net/artelnatif/nicko/impl/v1_13_R2.java b/v1_13_R2/src/main/java/net/artelnatif/nicko/impl/v1_13_R2.java index 735a8cd..ed84dd9 100644 --- a/v1_13_R2/src/main/java/net/artelnatif/nicko/impl/v1_13_R2.java +++ b/v1_13_R2/src/main/java/net/artelnatif/nicko/impl/v1_13_R2.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -13,8 +14,9 @@ import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_13_R2 implements Internals { @Override @@ -69,7 +71,7 @@ public class v1_13_R2 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -78,12 +80,14 @@ public class v1_13_R2 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, + final Object infoData = yes( + add, + gameProfile, entityPlayer.ping, - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -103,4 +107,22 @@ public class v1_13_R2 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_13_R2.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_14_R1/src/main/java/net/artelnatif/nicko/impl/v1_14_R1.java b/v1_14_R1/src/main/java/net/artelnatif/nicko/impl/v1_14_R1.java index 09200d4..9236397 100644 --- a/v1_14_R1/src/main/java/net/artelnatif/nicko/impl/v1_14_R1.java +++ b/v1_14_R1/src/main/java/net/artelnatif/nicko/impl/v1_14_R1.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -13,8 +14,9 @@ import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_14_R1 implements Internals { @Override @@ -67,7 +69,7 @@ public class v1_14_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -76,12 +78,14 @@ public class v1_14_R1 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, + final Object infoData = yes( + add, + gameProfile, entityPlayer.ping, - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -101,4 +105,22 @@ public class v1_14_R1 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_14_R1.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_15_R1/src/main/java/net/artelnatif/nicko/impl/v1_15_R1.java b/v1_15_R1/src/main/java/net/artelnatif/nicko/impl/v1_15_R1.java index 7324fde..fe76b14 100644 --- a/v1_15_R1/src/main/java/net/artelnatif/nicko/impl/v1_15_R1.java +++ b/v1_15_R1/src/main/java/net/artelnatif/nicko/impl/v1_15_R1.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -7,15 +8,16 @@ import net.artelnatif.nicko.bukkit.NickoBukkit; import net.artelnatif.nicko.disguise.ActionResult; import net.artelnatif.nicko.disguise.NickoProfile; import net.artelnatif.nicko.mojang.MojangSkin; -import org.bukkit.Bukkit; import net.minecraft.server.v1_15_R1.*; +import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_15_R1.CraftWorld; import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_15_R1 implements Internals { @Override @@ -70,7 +72,7 @@ public class v1_15_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -79,12 +81,14 @@ public class v1_15_R1 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, + final Object infoData = yes( + add, + gameProfile, entityPlayer.ping, - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -104,4 +108,22 @@ public class v1_15_R1 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_16_R1/src/main/java/net/artelnatif/nicko/impl/v1_16_R1.java b/v1_16_R1/src/main/java/net/artelnatif/nicko/impl/v1_16_R1.java index cdd44a7..49077e6 100644 --- a/v1_16_R1/src/main/java/net/artelnatif/nicko/impl/v1_16_R1.java +++ b/v1_16_R1/src/main/java/net/artelnatif/nicko/impl/v1_16_R1.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -7,15 +8,16 @@ import net.artelnatif.nicko.bukkit.NickoBukkit; import net.artelnatif.nicko.disguise.ActionResult; import net.artelnatif.nicko.disguise.NickoProfile; import net.artelnatif.nicko.mojang.MojangSkin; -import org.bukkit.Bukkit; import net.minecraft.server.v1_16_R1.*; +import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_16_R1.CraftWorld; import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_16_R1 implements Internals { @Override @@ -73,7 +75,7 @@ public class v1_16_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -82,12 +84,14 @@ public class v1_16_R1 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, + final Object infoData = yes( + add, + gameProfile, entityPlayer.ping, - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -107,4 +111,22 @@ public class v1_16_R1 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_16_R1.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_16_R2/src/main/java/net/artelnatif/nicko/impl/v1_16_R2.java b/v1_16_R2/src/main/java/net/artelnatif/nicko/impl/v1_16_R2.java index f884eca..1b59049 100644 --- a/v1_16_R2/src/main/java/net/artelnatif/nicko/impl/v1_16_R2.java +++ b/v1_16_R2/src/main/java/net/artelnatif/nicko/impl/v1_16_R2.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -14,8 +15,9 @@ import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_16_R2 implements Internals { @Override @@ -73,7 +75,7 @@ public class v1_16_R2 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -82,12 +84,14 @@ public class v1_16_R2 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, + final Object infoData = yes( + add, + gameProfile, entityPlayer.ping, - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -107,4 +111,22 @@ public class v1_16_R2 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_16_R2.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_16_R3/src/main/java/net/artelnatif/nicko/impl/v1_16_R3.java b/v1_16_R3/src/main/java/net/artelnatif/nicko/impl/v1_16_R3.java index b1e203e..6a69499 100644 --- a/v1_16_R3/src/main/java/net/artelnatif/nicko/impl/v1_16_R3.java +++ b/v1_16_R3/src/main/java/net/artelnatif/nicko/impl/v1_16_R3.java @@ -1,5 +1,6 @@ package net.artelnatif.nicko.impl; +import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; @@ -14,8 +15,9 @@ import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; +import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.util.ArrayList; +import java.lang.reflect.InvocationTargetException; public class v1_16_R3 implements Internals { @Override @@ -73,7 +75,7 @@ public class v1_16_R3 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } @@ -82,13 +84,18 @@ public class v1_16_R3 implements Internals { final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER); final IChatBaseComponent name = new ChatComponentText(profileName); - // what the fuck? didn't even KNOW instantiating a new class from an existing object was possible in java - final PacketPlayOutPlayerInfo.PlayerInfoData data = remove.new PlayerInfoData(gameProfile, - player.getPing(), - EnumGamemode.getById(player.getGameMode().ordinal()), name); - final ArrayList list = new ArrayList<>(); - list.add(data); - spoofPlayerInfoPacket(add, list); + // ok so what the actual fuck + // the PlayerDataInfo inner class is NOT public + // thus the compiler can't access it when compiling?????? + // i swear this is so dumb that i have to resort to doing this + final Object infoData = yes( + add, + gameProfile, + entityPlayer.ping, + EnumGamemode.getById(player.getGameMode().ordinal()), + name + ); + spoofPlayerInfoPacket(add, Lists.newArrayList(infoData)); Bukkit.getOnlinePlayers().forEach(online -> { EntityPlayer onlineEntityPlayer = ((CraftPlayer) online).getHandle(); @@ -108,4 +115,22 @@ public class v1_16_R3 implements Internals { NickoBukkit.getInstance().getLogger().warning("Unable to spoof packet, that's bad! (" + e.getMessage() + ")"); } } + + public Object yes(PacketPlayOutPlayerInfo packet, GameProfile gameProfile, int ping, EnumGamemode gamemode, IChatBaseComponent name) { + try { + final Class clazz = Class.forName("net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo$PlayerInfoData"); + final Constructor infoConstructor = clazz.getDeclaredConstructor( + PacketPlayOutPlayerInfo.class, + GameProfile.class, + int.class, + EnumGamemode.class, + IChatBaseComponent.class + ); + return infoConstructor.newInstance(packet, gameProfile, ping, gamemode, name); + } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | InstantiationException | + IllegalAccessException e) { + NickoBukkit.getInstance().getLogger().warning("Unable to instantiate PlayerInfoData, that's bad! (" + e.getMessage() + ")"); + return null; + } + } } diff --git a/v1_17_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java b/v1_17_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java index 6ca5cd1..24cd2a0 100644 --- a/v1_17_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java +++ b/v1_17_R1/src/main/java/net/artelnatif/nicko/impl/v1_17_R1.java @@ -77,7 +77,7 @@ public class v1_17_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } diff --git a/v1_18_R1/src/main/java/net/artelnatif/nicko/impl/v1_18_R1.java b/v1_18_R1/src/main/java/net/artelnatif/nicko/impl/v1_18_R1.java index dbfb5dc..1f1b7b7 100644 --- a/v1_18_R1/src/main/java/net/artelnatif/nicko/impl/v1_18_R1.java +++ b/v1_18_R1/src/main/java/net/artelnatif/nicko/impl/v1_18_R1.java @@ -79,7 +79,7 @@ public class v1_18_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } diff --git a/v1_18_R2/src/main/java/net/artelnatif/nicko/impl/v1_18_R2.java b/v1_18_R2/src/main/java/net/artelnatif/nicko/impl/v1_18_R2.java index cd76223..1f085f6 100644 --- a/v1_18_R2/src/main/java/net/artelnatif/nicko/impl/v1_18_R2.java +++ b/v1_18_R2/src/main/java/net/artelnatif/nicko/impl/v1_18_R2.java @@ -79,7 +79,7 @@ public class v1_18_R2 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } diff --git a/v1_19_R1/src/main/java/net/artelnatif/nicko/impl/v1_19_R1.java b/v1_19_R1/src/main/java/net/artelnatif/nicko/impl/v1_19_R1.java index e7cba66..fe98d37 100644 --- a/v1_19_R1/src/main/java/net/artelnatif/nicko/impl/v1_19_R1.java +++ b/v1_19_R1/src/main/java/net/artelnatif/nicko/impl/v1_19_R1.java @@ -79,7 +79,7 @@ public class v1_19_R1 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } } diff --git a/v1_19_R2/src/main/java/net/artelnatif/nicko/impl/v1_19_R2.java b/v1_19_R2/src/main/java/net/artelnatif/nicko/impl/v1_19_R2.java index 8032f28..288b95f 100644 --- a/v1_19_R2/src/main/java/net/artelnatif/nicko/impl/v1_19_R2.java +++ b/v1_19_R2/src/main/java/net/artelnatif/nicko/impl/v1_19_R2.java @@ -82,7 +82,7 @@ public class v1_19_R2 implements Internals { final MojangSkin skin = skinFetch.getResult(); final PropertyMap properties = gameProfile.getProperties(); properties.removeAll("textures"); - properties.put("textures", new Property("textures", skin.value(), skin.signature())); + properties.put("textures", new Property("textures", skin.getValue(), skin.getSignature())); updateSelf(player); } }