diff --git a/.idea/artifacts/T2CodeLib_7_4.xml b/.idea/artifacts/T2CodeLib_7_5.xml similarity index 64% rename from .idea/artifacts/T2CodeLib_7_4.xml rename to .idea/artifacts/T2CodeLib_7_5.xml index e3839ca..80898f0 100644 --- a/.idea/artifacts/T2CodeLib_7_4.xml +++ b/.idea/artifacts/T2CodeLib_7_5.xml @@ -1,7 +1,7 @@ - + $PROJECT_DIR$/../../Plugins/T2CodeLib/.jar - + diff --git a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_18_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_18_R0_1_SNAPSHOT.xml index d8d523d..dfe3642 100644 --- a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_18_R0_1_SNAPSHOT.xml +++ b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_18_R0_1_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6e2b739..00ca2ce 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.t2code T2CodeLib - 7.4 + 7.5 jar T2CodeLib diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/items/ItemVersion.java b/src/main/java/net/t2code/lib/Spigot/Lib/items/ItemVersion.java index 9b8657a..322614e 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/items/ItemVersion.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/items/ItemVersion.java @@ -2,14 +2,23 @@ package net.t2code.lib.Spigot.Lib.items; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; public class ItemVersion { - public static Material Head; + private static Material Head; + private static ItemStack HeadIS; public static void scan(){ if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) { Head = Material.valueOf("SKULL"); } else Head = Material.valueOf("PLAYER_HEAD"); + HeadIS = new ItemStack(Head); } + public static Material getHead() { + return Head; + } + public static ItemStack getHeadIS() { + return HeadIS; + } } diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java b/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java index fb0966a..6f25002 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java @@ -5,6 +5,7 @@ import org.bukkit.entity.Player; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; public class Replace { @@ -37,10 +38,10 @@ public class Replace { public static List replace(String prefix,Player player, List Text) { List output = new ArrayList(); if (player == null) { - return Arrays.asList("player is null"); + return Collections.singletonList("player is null"); } if (Text == null) { - return Arrays.asList("Text is null"); + return Collections.singletonList("Text is null"); } for (String input : Text) { output.add(PlaceholderAPI.setPlaceholders(player, input.replace("[prefix]", prefix).replace("&", "§") @@ -51,8 +52,8 @@ public class Replace { } - public static List replacePrice(String prefix,List Text, String price) { - List rp = new ArrayList(); + public static List replacePrice(String prefix,List Text, String price) { + List rp = new ArrayList(); for (String s : Text) { rp.add(s.replace("[prefix]", prefix).replace("&", "§") .replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö") @@ -63,8 +64,8 @@ public class Replace { } - public static List replacePrice(String prefix,Player player, List Text, String price) { - List rp = new ArrayList(); + public static List replacePrice(String prefix,Player player, List Text, String price) { + List rp = new ArrayList(); for (String s : Text) { rp.add(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix).replace("&", "§") .replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö") diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/vault/Vault.java b/src/main/java/net/t2code/lib/Spigot/Lib/vault/Vault.java index 4b5301a..ec2e9a9 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/vault/Vault.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/vault/Vault.java @@ -33,7 +33,7 @@ public class Vault { } public static void loadVault() throws InterruptedException { - Long long_ = Long.valueOf(System.currentTimeMillis()); + long long_ = System.currentTimeMillis(); if (Main.plugin.getServer().getPluginManager().getPlugin("Vault") != null) { vaultEnable = true; RegisteredServiceProvider eco = Main.plugin.getServer().getServicesManager().getRegistration(Economy.class); @@ -41,14 +41,14 @@ public class Vault { Main.eco = eco.getProvider(); if (Main.eco != null) { connected = true; - send.console(Main.prefix + " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms"); + send.console(Main.prefix + " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms"); } else { connected = false; - send.console(Main.prefix + " §4Economy could not be connected / found! 1" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms"); + send.console(Main.prefix + " §4Economy could not be connected / found! 1" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms"); } } else { connected = false; - send.console(Main.prefix + " §4Economy could not be connected / found! 2" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms"); + send.console(Main.prefix + " §4Economy could not be connected / found! 2" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms"); } RegisteredServiceProvider perm = Main.plugin.getServer().getServicesManager().getRegistration(Permission.class); if (perm != null) { @@ -57,7 +57,7 @@ public class Vault { } else { vaultEnable = false; connected = false; - send.console(Main.prefix + " §4Vault could not be connected! 3" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms"); + send.console(Main.prefix + " §4Vault could not be connected! 3" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms"); } } diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.java b/src/main/java/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.java index 3c0de43..d31c4ff 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.java @@ -40,7 +40,7 @@ public class Config { } } - public static void set(String path, List value, YamlConfiguration YamlConfiguration) { + public static void set(String path, List value, YamlConfiguration YamlConfiguration) { if (!YamlConfiguration.contains(path)) { YamlConfiguration.set(path, value); } @@ -93,16 +93,7 @@ public class Config { SOUND = sound1_9; } else SOUND = sound1_13; - try { - Sound sound_Buy = Sound.valueOf(selectSoundFromConfig); - if (sound_Buy != null) { - return sound_Buy; - } else return null; - } catch (Exception e) { - send.console("§4\n§4\n§4\n" + SelectLibMsg.SoundNotFound.replace("[prefix]", prefix) - .replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n"); - return Sound.valueOf(SOUND); - } + return checkSound(SOUND, selectSoundFromConfig, prefix); } public static Sound checkSound(String sound1_8, String sound1_13, String selectSoundFromConfig, String prefix) { @@ -111,24 +102,12 @@ public class Config { SOUND = sound1_8; } else SOUND = sound1_13; - try { - Sound sound_Buy = Sound.valueOf(selectSoundFromConfig); - if (sound_Buy != null) { - return sound_Buy; - } else return null; - } catch (Exception e) { - send.console("§4\n§4\n§4\n" + SelectLibMsg.SoundNotFound.replace("[prefix]", prefix) - .replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n"); - return Sound.valueOf(SOUND); - } + return checkSound(SOUND, selectSoundFromConfig, prefix); } public static Sound checkSound(String sound, String selectSoundFromConfig, String prefix) { try { - Sound sound_Buy = Sound.valueOf(selectSoundFromConfig); - if (sound_Buy != null) { - return sound_Buy; - } else return null; + return Sound.valueOf(selectSoundFromConfig); } catch (Exception e) { send.console("§4\n§4\n§4\n" + SelectLibMsg.SoundNotFound.replace("[prefix]", prefix) .replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n"); @@ -153,8 +132,8 @@ public class Config { return (yamlConfiguration.getDouble(path)); } - public static List selectList(String path, YamlConfiguration yamlConfiguration) { - return (yamlConfiguration.getList(path)); + public static List selectList(String path, YamlConfiguration yamlConfiguration) { + return (yamlConfiguration.getStringList(path)); } public static ItemStack selectItemStack(String path, YamlConfiguration yamlConfiguration) { @@ -162,7 +141,7 @@ public class Config { } - public static List selectList(String prefix, String path, YamlConfiguration yamlConfiguration) { + public static List selectList(String prefix, String path, YamlConfiguration yamlConfiguration) { List output = new ArrayList<>(); List input = yamlConfiguration.getStringList(path); for (String st : input) { @@ -171,7 +150,7 @@ public class Config { return output; } - public static void select(String prefix, List value, String path, YamlConfiguration yamlConfiguration) { + public static void select(String prefix, List value, String path, YamlConfiguration yamlConfiguration) { List output = new ArrayList<>(); List input = yamlConfiguration.getStringList(path); for (String st : input) { diff --git a/target/classes/bungee.yml b/target/classes/bungee.yml index 553dd7f..490825c 100644 --- a/target/classes/bungee.yml +++ b/target/classes/bungee.yml @@ -1,5 +1,5 @@ name: T2CodeLib -version: 7.4 +version: 7.5 main: net.t2code.lib.Bungee.BMain author: JaTiTV, Jkobs description: Libarie from T2Code Plugins \ No newline at end of file diff --git a/target/classes/net/t2code/lib/Spigot/Lib/items/ItemVersion.class b/target/classes/net/t2code/lib/Spigot/Lib/items/ItemVersion.class index 78175ae..63bc5ff 100644 Binary files a/target/classes/net/t2code/lib/Spigot/Lib/items/ItemVersion.class and b/target/classes/net/t2code/lib/Spigot/Lib/items/ItemVersion.class differ diff --git a/target/classes/net/t2code/lib/Spigot/Lib/replace/Replace.class b/target/classes/net/t2code/lib/Spigot/Lib/replace/Replace.class index 47b9f5d..5064fed 100644 Binary files a/target/classes/net/t2code/lib/Spigot/Lib/replace/Replace.class and b/target/classes/net/t2code/lib/Spigot/Lib/replace/Replace.class differ diff --git a/target/classes/net/t2code/lib/Spigot/Lib/vault/Vault.class b/target/classes/net/t2code/lib/Spigot/Lib/vault/Vault.class index bca48eb..0d5432b 100644 Binary files a/target/classes/net/t2code/lib/Spigot/Lib/vault/Vault.class and b/target/classes/net/t2code/lib/Spigot/Lib/vault/Vault.class differ diff --git a/target/classes/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.class b/target/classes/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.class index 6f09f9d..d04e13b 100644 Binary files a/target/classes/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.class and b/target/classes/net/t2code/lib/Spigot/Lib/yamlConfiguration/Config.class differ diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml index ccdd829..f9bf7df 100644 --- a/target/classes/plugin.yml +++ b/target/classes/plugin.yml @@ -1,5 +1,5 @@ name: T2CodeLib -version: 7.4 +version: 7.5 main: net.t2code.lib.Spigot.system.Main api-version: 1.13 prefix: T2CodeLib