This commit is contained in:
JaTiTV 2021-12-04 05:27:03 +01:00
parent 13baf14d7d
commit 54b034fc31
13 changed files with 38 additions and 49 deletions

View File

@ -1,7 +1,7 @@
<component name="ArtifactManager"> <component name="ArtifactManager">
<artifact type="jar" name="T2CodeLib_7.4"> <artifact type="jar" name="T2CodeLib_7.5">
<output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path> <output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path>
<root id="archive" name="T2CodeLib_7.4.jar"> <root id="archive" name="T2CodeLib_7.5.jar">
<element id="module-output" name="T2CodeLib" /> <element id="module-output" name="T2CodeLib" />
</root> </root>
</artifact> </artifact>

View File

@ -1,13 +1,13 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT"> <library name="Maven: org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.18-R0.1-SNAPSHOT/spigot-api-1.18-R0.1-20211130.213543-3.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.18-R0.1-SNAPSHOT/spigot-api-1.18-R0.1-20211203.212959-19.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.18-R0.1-SNAPSHOT/spigot-api-1.18-R0.1-20211130.213543-3-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.18-R0.1-SNAPSHOT/spigot-api-1.18-R0.1-20211203.212959-19-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.18-R0.1-SNAPSHOT/spigot-api-1.18-R0.1-20211130.213543-3-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.18-R0.1-SNAPSHOT/spigot-api-1.18-R0.1-20211203.212959-19-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>7.4</version> <version>7.5</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2CodeLib</name> <name>T2CodeLib</name>

View File

@ -2,14 +2,23 @@ package net.t2code.lib.Spigot.Lib.items;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
public class ItemVersion { public class ItemVersion {
public static Material Head; private static Material Head;
private static ItemStack HeadIS;
public static void scan(){ public static void scan(){
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) { if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Head = Material.valueOf("SKULL"); Head = Material.valueOf("SKULL");
} else Head = Material.valueOf("PLAYER_HEAD"); } else Head = Material.valueOf("PLAYER_HEAD");
HeadIS = new ItemStack(Head);
} }
public static Material getHead() {
return Head;
}
public static ItemStack getHeadIS() {
return HeadIS;
}
} }

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
public class Replace { public class Replace {
@ -37,10 +38,10 @@ public class Replace {
public static List<String> replace(String prefix,Player player, List<String> Text) { public static List<String> replace(String prefix,Player player, List<String> Text) {
List<String> output = new ArrayList(); List<String> output = new ArrayList();
if (player == null) { if (player == null) {
return Arrays.asList("player is null"); return Collections.singletonList("player is null");
} }
if (Text == null) { if (Text == null) {
return Arrays.asList("Text is null"); return Collections.singletonList("Text is null");
} }
for (String input : Text) { for (String input : Text) {
output.add(PlaceholderAPI.setPlaceholders(player, input.replace("[prefix]", prefix).replace("&", "§") output.add(PlaceholderAPI.setPlaceholders(player, input.replace("[prefix]", prefix).replace("&", "§")
@ -51,8 +52,8 @@ public class Replace {
} }
public static List replacePrice(String prefix,List<String> Text, String price) { public static List<String> replacePrice(String prefix,List<String> Text, String price) {
List rp = new ArrayList(); List<String> rp = new ArrayList();
for (String s : Text) { for (String s : Text) {
rp.add(s.replace("[prefix]", prefix).replace("&", "§") rp.add(s.replace("[prefix]", prefix).replace("&", "§")
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö") .replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
@ -63,8 +64,8 @@ public class Replace {
} }
public static List replacePrice(String prefix,Player player, List<String> Text, String price) { public static List<String> replacePrice(String prefix,Player player, List<String> Text, String price) {
List rp = new ArrayList(); List<String> rp = new ArrayList();
for (String s : Text) { for (String s : Text) {
rp.add(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix).replace("&", "§") rp.add(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix).replace("&", "§")
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö") .replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")

View File

@ -33,7 +33,7 @@ public class Vault {
} }
public static void loadVault() throws InterruptedException { public static void loadVault() throws InterruptedException {
Long long_ = Long.valueOf(System.currentTimeMillis()); long long_ = System.currentTimeMillis();
if (Main.plugin.getServer().getPluginManager().getPlugin("Vault") != null) { if (Main.plugin.getServer().getPluginManager().getPlugin("Vault") != null) {
vaultEnable = true; vaultEnable = true;
RegisteredServiceProvider<Economy> eco = Main.plugin.getServer().getServicesManager().getRegistration(Economy.class); RegisteredServiceProvider<Economy> eco = Main.plugin.getServer().getServicesManager().getRegistration(Economy.class);
@ -41,14 +41,14 @@ public class Vault {
Main.eco = eco.getProvider(); Main.eco = eco.getProvider();
if (Main.eco != null) { if (Main.eco != null) {
connected = true; 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 { } else {
connected = false; 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 { } else {
connected = false; 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<Permission> perm = Main.plugin.getServer().getServicesManager().getRegistration(Permission.class); RegisteredServiceProvider<Permission> perm = Main.plugin.getServer().getServicesManager().getRegistration(Permission.class);
if (perm != null) { if (perm != null) {
@ -57,7 +57,7 @@ public class Vault {
} else { } else {
vaultEnable = false; vaultEnable = false;
connected = 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");
} }
} }

View File

@ -40,7 +40,7 @@ public class Config {
} }
} }
public static void set(String path, List value, YamlConfiguration YamlConfiguration) { public static void set(String path, List<String> value, YamlConfiguration YamlConfiguration) {
if (!YamlConfiguration.contains(path)) { if (!YamlConfiguration.contains(path)) {
YamlConfiguration.set(path, value); YamlConfiguration.set(path, value);
} }
@ -93,16 +93,7 @@ public class Config {
SOUND = sound1_9; SOUND = sound1_9;
} else SOUND = sound1_13; } else SOUND = sound1_13;
try { return checkSound(SOUND, selectSoundFromConfig, prefix);
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);
}
} }
public static Sound checkSound(String sound1_8, String sound1_13, String selectSoundFromConfig, String 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; SOUND = sound1_8;
} else SOUND = sound1_13; } else SOUND = sound1_13;
try { return checkSound(SOUND, selectSoundFromConfig, prefix);
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);
}
} }
public static Sound checkSound(String sound, String selectSoundFromConfig, String prefix) { public static Sound checkSound(String sound, String selectSoundFromConfig, String prefix) {
try { try {
Sound sound_Buy = Sound.valueOf(selectSoundFromConfig); return Sound.valueOf(selectSoundFromConfig);
if (sound_Buy != null) {
return sound_Buy;
} else return null;
} catch (Exception e) { } catch (Exception e) {
send.console("§4\n§4\n§4\n" + SelectLibMsg.SoundNotFound.replace("[prefix]", prefix) send.console("§4\n§4\n§4\n" + SelectLibMsg.SoundNotFound.replace("[prefix]", prefix)
.replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n"); .replace("[sound]", "§8Buy: §6" + selectSoundFromConfig) + "§4\n§4\n§4\n");
@ -153,8 +132,8 @@ public class Config {
return (yamlConfiguration.getDouble(path)); return (yamlConfiguration.getDouble(path));
} }
public static List selectList(String path, YamlConfiguration yamlConfiguration) { public static List<String> selectList(String path, YamlConfiguration yamlConfiguration) {
return (yamlConfiguration.getList(path)); return (yamlConfiguration.getStringList(path));
} }
public static ItemStack selectItemStack(String path, YamlConfiguration yamlConfiguration) { 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<String> selectList(String prefix, String path, YamlConfiguration yamlConfiguration) {
List<String> output = new ArrayList<>(); List<String> output = new ArrayList<>();
List<String> input = yamlConfiguration.getStringList(path); List<String> input = yamlConfiguration.getStringList(path);
for (String st : input) { for (String st : input) {
@ -171,7 +150,7 @@ public class Config {
return output; return output;
} }
public static void select(String prefix, List value, String path, YamlConfiguration yamlConfiguration) { public static void select(String prefix, List<String> value, String path, YamlConfiguration yamlConfiguration) {
List<String> output = new ArrayList<>(); List<String> output = new ArrayList<>();
List<String> input = yamlConfiguration.getStringList(path); List<String> input = yamlConfiguration.getStringList(path);
for (String st : input) { for (String st : input) {

View File

@ -1,5 +1,5 @@
name: T2CodeLib name: T2CodeLib
version: 7.4 version: 7.5
main: net.t2code.lib.Bungee.BMain main: net.t2code.lib.Bungee.BMain
author: JaTiTV, Jkobs author: JaTiTV, Jkobs
description: Libarie from T2Code Plugins description: Libarie from T2Code Plugins

View File

@ -1,5 +1,5 @@
name: T2CodeLib name: T2CodeLib
version: 7.4 version: 7.5
main: net.t2code.lib.Spigot.system.Main main: net.t2code.lib.Spigot.system.Main
api-version: 1.13 api-version: 1.13
prefix: T2CodeLib prefix: T2CodeLib