Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
c72edafd0a | |||
610cb74868 | |||
|
3a3c9b3208 | ||
a834adc8c9 | |||
290b9264f3 | |||
eb991d01e3 | |||
ec7714c9fe | |||
260dae2aa0 | |||
addc485ca8 | |||
f8619e4802 | |||
e97fadfbec | |||
567b0a2442 | |||
7b04697895 |
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>15.4</version>
|
<version>15.7</version>
|
||||||
<!--version>VERSION_snapshot-0</version-->
|
<!--version>VERSION_snapshot-0</version-->
|
||||||
<!--version>VERSION_beta-0</version-->
|
<!--version>VERSION_beta-0</version-->
|
||||||
<!--version>VERSION_dev-0</version-->
|
<!--version>VERSION_dev-0</version-->
|
||||||
|
@@ -50,20 +50,20 @@ public class T2CBupdateCheckerGit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject obj = new JSONObject(data);
|
JSONObject obj = new JSONObject(data);
|
||||||
String UpdateName = obj.getString("name");
|
String updateTitle = obj.getString("name");
|
||||||
String tag_name = obj.getString("tag_name");
|
String version = obj.getString("tag_name");
|
||||||
String body = obj.getString("body").replace("\n", "<br>").replace("\r", "").replace("'", "''");
|
String updateDescription = obj.getString("body").replace("\n", "<br>").replace("\r", "").replace("'", "''");
|
||||||
String updateurl = obj.getString("html_url");
|
String updateUrl = obj.getString("html_url");
|
||||||
boolean prerelease = obj.getBoolean("prerelease");
|
boolean preRelease = obj.getBoolean("prerelease");
|
||||||
|
|
||||||
String date = obj.getString("published_at");
|
String date = obj.getString("published_at");
|
||||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
|
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
|
||||||
Date parsedDate = inputFormat.parse(date);
|
Date parsedDate = inputFormat.parse(date);
|
||||||
String formattedDate = outputFormat.format(parsedDate);
|
String publishedAt = outputFormat.format(parsedDate);
|
||||||
|
|
||||||
JSONArray downloadArray = obj.getJSONArray("assets");
|
JSONArray downloadArray = obj.getJSONArray("assets");
|
||||||
String gitURL = updateurl;
|
String gitURL = updateUrl;
|
||||||
String downloadURL;
|
String downloadURL;
|
||||||
if (downloadArray.isEmpty()) {
|
if (downloadArray.isEmpty()) {
|
||||||
downloadURL = "https://www.spigotmc.org/resources/" + spigotID;
|
downloadURL = "https://www.spigotmc.org/resources/" + spigotID;
|
||||||
@@ -71,12 +71,12 @@ public class T2CBupdateCheckerGit {
|
|||||||
downloadURL = downloadArray.getJSONObject(0).getString("browser_download_url");
|
downloadURL = downloadArray.getJSONObject(0).getString("browser_download_url");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!prerelease) {
|
if (!preRelease) {
|
||||||
downloadURL = "https://www.spigotmc.org/resources/" + spigotID;
|
downloadURL = "https://www.spigotmc.org/resources/" + spigotID;
|
||||||
updateurl = "https://www.spigotmc.org/resources/" + spigotID;
|
updateUrl = "https://www.spigotmc.org/resources/" + spigotID;
|
||||||
}
|
}
|
||||||
|
|
||||||
T2CupdateWebData webData = new T2CupdateWebData(UpdateName, tag_name, body, updateurl, formattedDate, downloadURL, gitURL, prerelease);
|
T2CupdateWebData webData = new T2CupdateWebData(updateTitle, version, updateDescription, updateUrl, publishedAt, downloadURL, gitURL, preRelease);
|
||||||
consumer.accept(webData);
|
consumer.accept(webData);
|
||||||
} catch (Exception var10) {
|
} catch (Exception var10) {
|
||||||
Boolean load = false;
|
Boolean load = false;
|
||||||
|
@@ -52,6 +52,20 @@ public class T2CitemBuilder {
|
|||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setItem(Integer slot, Integer amount, String material, String displayName, List<String> lore, Inventory inventory) {
|
||||||
|
ItemStack item;
|
||||||
|
if (getLegacy && material.contains(",")) {
|
||||||
|
String[] split = material.split(",");
|
||||||
|
item = new ItemStack(Material.valueOf(split[0]), 1, Short.parseShort(split[1]));
|
||||||
|
} else item = new ItemStack(Material.valueOf(material));
|
||||||
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
|
itemMeta.setDisplayName(displayName);
|
||||||
|
itemMeta.setLore(lore);
|
||||||
|
item.setItemMeta(itemMeta);
|
||||||
|
item.setAmount(amount);
|
||||||
|
inventory.setItem(slot, item);
|
||||||
|
}
|
||||||
|
|
||||||
public static ItemStack base64(String base64Value, Integer amount, String displayName, List<String> lore) {
|
public static ItemStack base64(String base64Value, Integer amount, String displayName, List<String> lore) {
|
||||||
ItemStack itemStack = new ItemStack(T2CitemVersion.getHead());
|
ItemStack itemStack = new ItemStack(T2CitemVersion.getHead());
|
||||||
SkullMeta itemMeta = (SkullMeta) itemStack.getItemMeta();
|
SkullMeta itemMeta = (SkullMeta) itemStack.getItemMeta();
|
||||||
|
@@ -1,76 +1,54 @@
|
|||||||
package net.t2code.t2codelib.SPIGOT.api.items;
|
package net.t2code.t2codelib.SPIGOT.api.items;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class T2CitemVersion {
|
public class T2CitemVersion {
|
||||||
|
@Getter
|
||||||
private static Material Head;
|
private static Material Head;
|
||||||
|
@Getter
|
||||||
private static ItemStack HeadIS;
|
private static ItemStack HeadIS;
|
||||||
private static ItemStack CRAFTING_TABLE;
|
@Getter
|
||||||
private static ItemStack YELLOW_WOOL;
|
private static ItemStack CraftingTable;
|
||||||
private static ItemStack ORANGE_WOOL;
|
@Getter
|
||||||
private static ItemStack GREEN_WOOL;
|
private static ItemStack YellowWool;
|
||||||
private static ItemStack GRAY_WOOL;
|
@Getter
|
||||||
private static ItemStack RED_WOOL;
|
private static ItemStack OrangeWool;
|
||||||
private static ItemStack RED_STAINED_GLASS_PANE;
|
@Getter
|
||||||
|
private static ItemStack GreenWool;
|
||||||
|
@Getter
|
||||||
|
private static ItemStack GrayWool;
|
||||||
|
@Getter
|
||||||
|
private static ItemStack RedWool;
|
||||||
|
@Getter
|
||||||
|
private static ItemStack RedStainedGlassPane;
|
||||||
|
@Getter
|
||||||
|
private static ItemStack BlackStainedGlassPane;
|
||||||
|
|
||||||
public static void scan() {
|
public static void scan() {
|
||||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||||
Head = Material.valueOf("SKULL_ITEM");
|
Head = Material.valueOf("SKULL_ITEM");
|
||||||
YELLOW_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4);
|
YellowWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4);
|
||||||
ORANGE_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1);
|
OrangeWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1);
|
||||||
GREEN_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 5);
|
GreenWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 5);
|
||||||
GRAY_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8);
|
GrayWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8);
|
||||||
RED_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14);
|
RedWool = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14);
|
||||||
RED_STAINED_GLASS_PANE = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14);
|
RedStainedGlassPane = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14);
|
||||||
CRAFTING_TABLE = new ItemStack(Material.valueOf("WORKBENCH"));
|
BlackStainedGlassPane = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 15);
|
||||||
|
CraftingTable = new ItemStack(Material.valueOf("WORKBENCH"));
|
||||||
} else {
|
} else {
|
||||||
Head = Material.valueOf("PLAYER_HEAD");
|
Head = Material.valueOf("PLAYER_HEAD");
|
||||||
CRAFTING_TABLE = new ItemStack(Material.CRAFTING_TABLE);
|
CraftingTable = new ItemStack(Material.CRAFTING_TABLE);
|
||||||
YELLOW_WOOL = new ItemStack(Material.YELLOW_WOOL);
|
YellowWool = new ItemStack(Material.YELLOW_WOOL);
|
||||||
ORANGE_WOOL = new ItemStack(Material.ORANGE_WOOL);
|
OrangeWool = new ItemStack(Material.ORANGE_WOOL);
|
||||||
GREEN_WOOL = new ItemStack(Material.GREEN_WOOL);
|
GreenWool = new ItemStack(Material.GREEN_WOOL);
|
||||||
GRAY_WOOL = new ItemStack(Material.GRAY_WOOL);
|
GrayWool = new ItemStack(Material.GRAY_WOOL);
|
||||||
RED_WOOL = new ItemStack(Material.RED_WOOL);
|
RedWool = new ItemStack(Material.RED_WOOL);
|
||||||
RED_STAINED_GLASS_PANE = new ItemStack(Material.RED_STAINED_GLASS_PANE);
|
RedStainedGlassPane = new ItemStack(Material.RED_STAINED_GLASS_PANE);
|
||||||
|
BlackStainedGlassPane = new ItemStack(Material.BLACK_STAINED_GLASS_PANE);
|
||||||
}
|
}
|
||||||
HeadIS = new ItemStack(Head, 1, (byte) 3);
|
HeadIS = new ItemStack(Head, 1, (byte) 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Material getHead() {
|
|
||||||
return Head;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getHeadIS() {
|
|
||||||
return HeadIS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getCraftingTable() {
|
|
||||||
return CRAFTING_TABLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getYellowWool() {
|
|
||||||
return YELLOW_WOOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getOrangeWool() {
|
|
||||||
return ORANGE_WOOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getGreenWool() {
|
|
||||||
return GREEN_WOOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getGrayWool() {
|
|
||||||
return GRAY_WOOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getRedWool() {
|
|
||||||
return RED_WOOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack getRedStainedGlassPane() {
|
|
||||||
return RED_STAINED_GLASS_PANE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package net.t2code.t2codelib.SPIGOT.api.messages;
|
package net.t2code.t2codelib.SPIGOT.api.messages;
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -17,10 +18,16 @@ public class T2Creplace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String replace(String prefix, Player player, String Text) {
|
public static String replace(String prefix, Player player, String Text) {
|
||||||
return replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, Text.replace("[prefix]", prefix)
|
String input = Text.replace("[prefix]", prefix)
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
.replace("[nl]", "\n")));
|
.replace("[nl]", "\n");
|
||||||
|
if (T2CpluginCheck.papi()) {
|
||||||
|
return replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, input));
|
||||||
|
} else {
|
||||||
|
return replaceLegacyColor(input);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object replaceObject(String prefix, Object object) {
|
public static Object replaceObject(String prefix, Object object) {
|
||||||
@@ -46,18 +53,33 @@ public class T2Creplace {
|
|||||||
|
|
||||||
public static Object replaceObject(String prefix, Player player, Object object) {
|
public static Object replaceObject(String prefix, Player player, Object object) {
|
||||||
if (object instanceof String) {
|
if (object instanceof String) {
|
||||||
object = PlaceholderAPI.setPlaceholders(player, replaceLegacyColor((String) object).replace("[prefix]", prefix).replace("[ue]", "ü")
|
|
||||||
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
if (T2CpluginCheck.papi()) {
|
||||||
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n"));
|
object = PlaceholderAPI.setPlaceholders(player, replaceLegacyColor((String) object).replace("[prefix]", prefix).replace("[ue]", "ü")
|
||||||
|
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||||
|
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n"));
|
||||||
|
} else {
|
||||||
|
object = replaceLegacyColor((String) object).replace("[prefix]", prefix).replace("[ue]", "ü")
|
||||||
|
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||||
|
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (object instanceof List) {
|
if (object instanceof List) {
|
||||||
List<String> in = (List<String>) object;
|
List<String> in = (List<String>) object;
|
||||||
List<String> output = new ArrayList<>();
|
List<String> output = new ArrayList<>();
|
||||||
for (String input : in) {
|
for (String input : in) {
|
||||||
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
if (T2CpluginCheck.papi()) {
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
.replace("[nl]", "\n")));
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
|
.replace("[nl]", "\n")));
|
||||||
|
} else {
|
||||||
|
output.add(replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
|
.replace("[nl]", "\n"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
object = output;
|
object = output;
|
||||||
}
|
}
|
||||||
@@ -84,10 +106,18 @@ public class T2Creplace {
|
|||||||
return Collections.singletonList("Text is null");
|
return Collections.singletonList("Text is null");
|
||||||
}
|
}
|
||||||
for (String input : Text) {
|
for (String input : Text) {
|
||||||
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
if (T2CpluginCheck.papi()) {
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
.replace("[nl]", "\n")));
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
|
.replace("[nl]", "\n")));
|
||||||
|
} else {
|
||||||
|
output.add(replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
|
.replace("[nl]", "\n"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@@ -115,10 +145,15 @@ public class T2Creplace {
|
|||||||
public static List<String> 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<String> rp = new ArrayList<>();
|
List<String> rp = new ArrayList<>();
|
||||||
for (String s : Text) {
|
for (String s : Text) {
|
||||||
rp.add(replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix)
|
String input = s.replace("[prefix]", prefix)
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n")
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n")
|
||||||
.replace("[price]", String.valueOf(price)))));
|
.replace("[price]", String.valueOf(price));
|
||||||
|
if (T2CpluginCheck.papi()) {
|
||||||
|
rp.add(replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, input)));
|
||||||
|
} else {
|
||||||
|
rp.add(replaceLegacyColor(input));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return rp;
|
return rp;
|
||||||
}
|
}
|
||||||
@@ -132,10 +167,16 @@ public class T2Creplace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String replacePrice(String prefix, Player player, String Text, String price) {
|
public static String replacePrice(String prefix, Player player, String Text, String price) {
|
||||||
return replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, Text.replace("[prefix]", prefix)
|
String input = Text.replace("[prefix]", prefix)
|
||||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||||
.replace("[price]", String.valueOf(price)).replace("[nl]", "\n")));
|
.replace("[price]", String.valueOf(price)).replace("[nl]", "\n");
|
||||||
|
if (T2CpluginCheck.papi()) {
|
||||||
|
return replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, input));
|
||||||
|
} else {
|
||||||
|
return replaceLegacyColor(input);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String replaceLegacyColor(String text) {
|
public static String replaceLegacyColor(String text) {
|
||||||
@@ -171,4 +212,19 @@ public class T2Creplace {
|
|||||||
.replace("&o", "<italic>").replace("§o", "<italic>")
|
.replace("&o", "<italic>").replace("§o", "<italic>")
|
||||||
.replace("&r", "<reset>").replace("§r", "<reset>");
|
.replace("&r", "<reset>").replace("§r", "<reset>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Object replace(Object object, String placeholder, String replacement) {
|
||||||
|
if (object instanceof String) {
|
||||||
|
object = ((String) object).replace(placeholder, replacement);
|
||||||
|
}
|
||||||
|
if ((object instanceof List) || (object instanceof ArrayList)) {
|
||||||
|
List<String> in = (List<String>) object;
|
||||||
|
List<String> output = new ArrayList<>();
|
||||||
|
for (String input : in) {
|
||||||
|
output.add(input.replace(placeholder, replacement));
|
||||||
|
}
|
||||||
|
object = output;
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,8 @@ package net.t2code.t2codelib.SPIGOT.api.messages;
|
|||||||
|
|
||||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
|
import net.t2code.t2codelib.T2CupdateWebData;
|
||||||
|
import net.t2code.t2codelib.UpdateType;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@@ -46,7 +48,7 @@ public class T2Ctemplate {
|
|||||||
T2Csend.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! Some features may not be working as expected. Please report all" +
|
T2Csend.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! Some features may not be working as expected. Please report all" +
|
||||||
" bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
" bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
||||||
onLoadSeparateStroke(prefix);
|
onLoadSeparateStroke(prefix);
|
||||||
if (!SelectLibConfig.getT2cTestDevelopment()){
|
if (!SelectLibConfig.getT2cTestDevelopment()) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@@ -68,6 +70,10 @@ public class T2Ctemplate {
|
|||||||
T2Csend.console(prefix + " §8-------------------------------");
|
T2Csend.console(prefix + " §8-------------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void onLoadFooter(String prefix, Long long_, String v) {
|
||||||
|
onLoadFooter(prefix, long_);
|
||||||
|
}
|
||||||
|
|
||||||
public static void onLoadFooter(String prefix, Long long_) {
|
public static void onLoadFooter(String prefix, Long long_) {
|
||||||
onLoadSeparateStroke(prefix);
|
onLoadSeparateStroke(prefix);
|
||||||
T2Csend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
T2Csend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
@@ -78,16 +84,14 @@ public class T2Ctemplate {
|
|||||||
* @param autor
|
* @param autor
|
||||||
* @param spigot
|
* @param spigot
|
||||||
* @param discord
|
* @param discord
|
||||||
*
|
* @deprecated reason this method is deprecated <br/>
|
||||||
* @deprecated reason this method is deprecated <br/>
|
* {will be removed in next version} <br/>
|
||||||
* {will be removed in next version} <br/>
|
* use {@link #onDisable(String, Plugin)} instead like this:
|
||||||
* use {@link #onDisable(Plugin)} instead like this:
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* <blockquote><pre>
|
* <blockquote><pre>
|
||||||
* onDisable(getPlugin())
|
* onDisable(getPlugin())
|
||||||
* </pre></blockquote>
|
* </pre></blockquote>
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static void onDisable(String prefix, List<String> autor, String version, String spigot, String discord) {
|
public static void onDisable(String prefix, List<String> autor, String version, String spigot, String discord) {
|
||||||
@@ -105,15 +109,32 @@ public class T2Ctemplate {
|
|||||||
|
|
||||||
public static void sendInfo(CommandSender sender, Plugin plugin, int spigotID, String discord, Boolean premiumVerified, String text) {
|
public static void sendInfo(CommandSender sender, Plugin plugin, int spigotID, String discord, Boolean premiumVerified, String text) {
|
||||||
String pluginVersion = plugin.getDescription().getVersion();
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
String publicVersion = T2CupdateAPI.pluginVersions.get(plugin.getName()).webData.getVersion();
|
String publicVersion = "";
|
||||||
boolean update = !publicVersion.equalsIgnoreCase(pluginVersion);
|
boolean update;
|
||||||
boolean player = sender instanceof Player;
|
String stNVersion;
|
||||||
|
T2CupdateWebData webData;
|
||||||
|
try {
|
||||||
|
webData = T2CupdateAPI.pluginVersions.get(plugin.getName()).webData;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
webData = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (webData != null) {
|
||||||
|
publicVersion = T2CupdateAPI.pluginVersions.get(plugin.getName()).webData.getVersion();
|
||||||
|
update = !publicVersion.equalsIgnoreCase(pluginVersion);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
update = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean player = sender instanceof Player;
|
||||||
String stPlugin = "<dark_red>║</dark_red> <yellow>Plugin:</yellow> <gold>[pl]</gold>".replace("[pl]", plugin.getName());
|
String stPlugin = "<dark_red>║</dark_red> <yellow>Plugin:</yellow> <gold>[pl]</gold>".replace("[pl]", plugin.getName());
|
||||||
String stVersion = "<dark_red>║</dark_red> <yellow>Version:</yellow> <gold>[ver]</gold>".replace("[ver]", pluginVersion);
|
String stVersion = "<dark_red>║</dark_red> <yellow>Version:</yellow> <gold>[ver]</gold>".replace("[ver]", pluginVersion);
|
||||||
String stAutor = "<dark_red>║</dark_red> <yellow>Autor(s):</yellow> <gold>[autor]</gold>".replace("[autor]", plugin.getDescription().getAuthors().toString());
|
String stAutor = "<dark_red>║</dark_red> <yellow>Autor(s):</yellow> <gold>[autor]</gold>".replace("[autor]", plugin.getDescription().getAuthors().toString());
|
||||||
String stNVersion = "<dark_red>║</dark_red> <yellow>Newest Version:</yellow> <gold>[nver]</gold>".replace("[nver]", publicVersion);
|
|
||||||
String stStable = "<dark_red>║</dark_red> <yellow>Stable version available:</yellow> [up]".replace("[up]", update ? "<dark_green>YES</dark_green>" : "<red>no</red>");
|
String stUpdate = "<dark_red>║</dark_red> <yellow>New version available:</yellow> [up]".replace("[up]", webData != null ? update ?
|
||||||
|
"<dark_green>YES</dark_green>" : "<red>no</red>" : "<b><dark_red>It could not be checked for updates!</dark_red></b>");
|
||||||
|
stNVersion = update ? "<br><dark_red>║</dark_red> <yellow>Newest Version:</yellow> <gold>[nver]</gold>".replace("[nver]",player ? "<hover:show_text:'<yellow>Click for the update information</yellow>'><click:run_command:'/t2code updateinfo "+plugin.getName()+"'>"+publicVersion+"</click></hover>":publicVersion) : "";
|
||||||
String stLinkPlayer = "<dark_red>║</dark_red> <yellow><hover:show_text:'<green>Go to the Spigot page</green>'><click:open_url:'[slink]'>Spigot</click></hover></yellow> "
|
String stLinkPlayer = "<dark_red>║</dark_red> <yellow><hover:show_text:'<green>Go to the Spigot page</green>'><click:open_url:'[slink]'>Spigot</click></hover></yellow> "
|
||||||
.replace("[slink]", "https://www.spigotmc.org/resources/" + spigotID)
|
.replace("[slink]", "https://www.spigotmc.org/resources/" + spigotID)
|
||||||
+ "<dark_red>-</dark_red> <dark_purple><hover:show_text:'<green>Go to the T2Code Support Discord</green>'><click:open_url:'[dlink]'>Discord</click></hover></dark_purple>"
|
+ "<dark_red>-</dark_red> <dark_purple><hover:show_text:'<green>Go to the T2Code Support Discord</green>'><click:open_url:'[dlink]'>Discord</click></hover></dark_purple>"
|
||||||
@@ -121,16 +142,17 @@ public class T2Ctemplate {
|
|||||||
String stLinkConsole = "<dark_red>║</dark_red> <yellow>Spigot:</yellow> <gold>https://www.spigotmc.org/resources/" + spigotID + "</gold>"
|
String stLinkConsole = "<dark_red>║</dark_red> <yellow>Spigot:</yellow> <gold>https://www.spigotmc.org/resources/" + spigotID + "</gold>"
|
||||||
+ "<br><dark_red>║</dark_red> <yellow>Discord:</yellow> <gold>" + discord + "</gold>";
|
+ "<br><dark_red>║</dark_red> <yellow>Discord:</yellow> <gold>" + discord + "</gold>";
|
||||||
String stLink = player ? stLinkPlayer : stLinkConsole;
|
String stLink = player ? stLinkPlayer : stLinkConsole;
|
||||||
String pr = premiumVerified != null ? "<br><dark_red>║</dark_red> <yellow>Premium verified:</yellow> [pr]".replace("[pr]", premiumVerified ? "<dark_green>YES</dark_green>" : "<red>NO</red>") : "";
|
String pr = premiumVerified != null ? "<br><dark_red>║</dark_red> <yellow>Premium verified:</yellow> [pr]".replace("[pr]",
|
||||||
|
premiumVerified ? "<dark_green>YES</dark_green>" : "<red>NO</red>") : "";
|
||||||
|
|
||||||
String stMSG = text == null || text.equals("") ? "" : "<br><dark_red>║</dark_red> " + text + "<br>";
|
String stMSG = text == null || text.equals("") ? "" : "<br><dark_red>║</dark_red> " + text;
|
||||||
T2Csend.sender(sender, "<dark_red>╔════════════════════════════════</dark_red>"
|
T2Csend.sender(sender, "<br><dark_red>╔════════════════════════════════</dark_red>"
|
||||||
+ "<br>" + stPlugin
|
+ "<br>" + stPlugin
|
||||||
|
+ "<br>" + stVersion
|
||||||
+ stMSG
|
+ stMSG
|
||||||
+ stVersion
|
|
||||||
+ "<br>" + stAutor
|
+ "<br>" + stAutor
|
||||||
+ "<br>" + stNVersion
|
+ "<br>" + stUpdate
|
||||||
+ "<br>" + stStable
|
+ stNVersion
|
||||||
+ "<br>" + stLink
|
+ "<br>" + stLink
|
||||||
+ pr
|
+ pr
|
||||||
+ "<br><dark_red>╚════════════════════════════════</dark_red>");
|
+ "<br><dark_red>╚════════════════════════════════</dark_red>");
|
||||||
|
@@ -6,6 +6,7 @@ import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
|||||||
import net.t2code.t2codelib.UpdateType;
|
import net.t2code.t2codelib.UpdateType;
|
||||||
import net.t2code.t2codelib.T2CupdateObject;
|
import net.t2code.t2codelib.T2CupdateObject;
|
||||||
import net.t2code.t2codelib.T2CupdateWebData;
|
import net.t2code.t2codelib.T2CupdateWebData;
|
||||||
|
import net.t2code.t2codelib.Util;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@@ -68,44 +69,44 @@ public class T2CupdateAPI {
|
|||||||
"[prefix] <color:#ff9499><hover:show_text:'<red>Click for more information</red>'><click:run_command:'/t2c updateinfo " + plugin.getName() + "'>Update information</click></hover></color><br>" +
|
"[prefix] <color:#ff9499><hover:show_text:'<red>Click for more information</red>'><click:run_command:'/t2c updateinfo " + plugin.getName() + "'>Update information</click></hover></color><br>" +
|
||||||
"[prefix]";
|
"[prefix]";
|
||||||
|
|
||||||
String value;
|
String updateStatusVersion;
|
||||||
|
|
||||||
if (webData.isPreRelease()) {
|
if (webData.isPreRelease()) {
|
||||||
//todo if (!SelectLibConfig.getSeePreReleaseUpdates()) return;
|
//todo if (!SelectLibConfig.getSeePreReleaseUpdates()) return;
|
||||||
value = UpdateType.PRERELEASE.text;
|
updateStatusVersion = UpdateType.PRERELEASE.text;
|
||||||
if (publicVersion.toLowerCase().contains("dev")) {
|
if (publicVersion.toLowerCase().contains("dev")) {
|
||||||
value = UpdateType.DEVELOPMENT.text;
|
updateStatusVersion = UpdateType.DEVELOPMENT.text;
|
||||||
}
|
}
|
||||||
if (publicVersion.toLowerCase().contains("beta")) {
|
if (publicVersion.toLowerCase().contains("beta")) {
|
||||||
value = UpdateType.BETA.text;
|
updateStatusVersion = UpdateType.BETA.text;
|
||||||
}
|
}
|
||||||
if (publicVersion.toLowerCase().contains("snapshot")) {
|
if (publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
value = UpdateType.SNAPSHOT.text;
|
updateStatusVersion = UpdateType.SNAPSHOT.text;
|
||||||
}
|
}
|
||||||
} else value = UpdateType.STABLE.text;
|
} else updateStatusVersion = UpdateType.STABLE.text;
|
||||||
|
|
||||||
T2Csend.player(player, st.replace("[prefix]", prefix).replace("[value]", value).replace("[link]", webData.getUpdateUrl())
|
T2Csend.player(player, st.replace("[prefix]", prefix).replace("[value]", updateStatusVersion).replace("[link]", webData.getUpdateUrl())
|
||||||
.replace("[plv]", pluginVersion).replace("[puv]", publicVersion).replace("[dc]", discord));
|
.replace("[plv]", pluginVersion).replace("[puv]", publicVersion).replace("[dc]", discord));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendUpdateMsg(String prefix, String discord, T2CupdateWebData webData, Plugin plugin) {
|
public static void sendUpdateMsg(String prefix, String discord, T2CupdateWebData webData, Plugin plugin) {
|
||||||
String publicVersion = webData.getVersion();
|
String publicVersion = webData.getVersion();
|
||||||
String pluginVersion = plugin.getDescription().getVersion();
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
String value;
|
String updateStatusVersion;
|
||||||
if (webData.isPreRelease()) {
|
if (webData.isPreRelease()) {
|
||||||
value = UpdateType.PRERELEASE.text;
|
updateStatusVersion = UpdateType.PRERELEASE.text;
|
||||||
if (publicVersion.toLowerCase().contains("dev")) {
|
if (publicVersion.toLowerCase().contains("dev")) {
|
||||||
value = UpdateType.DEVELOPMENT.text;
|
updateStatusVersion = UpdateType.DEVELOPMENT.text;
|
||||||
}
|
}
|
||||||
if (publicVersion.toLowerCase().contains("beta")) {
|
if (publicVersion.toLowerCase().contains("beta")) {
|
||||||
value = UpdateType.BETA.text;
|
updateStatusVersion = UpdateType.BETA.text;
|
||||||
}
|
}
|
||||||
if (publicVersion.toLowerCase().contains("snapshot")) {
|
if (publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
value = UpdateType.SNAPSHOT.text;
|
updateStatusVersion = UpdateType.SNAPSHOT.text;
|
||||||
}
|
}
|
||||||
} else value = UpdateType.STABLE.text;
|
} else updateStatusVersion = UpdateType.STABLE.text;
|
||||||
String h = "<br><dark_red>╔══════════════</dark_red>" + prefix + "<dark_red>══════════════</dark_red>";
|
String h = "<br><dark_red>╔══════════════</dark_red>" + prefix + "<dark_red>══════════════</dark_red>";
|
||||||
String s1 = "<br><dark_red>║</dark_red> <color:#6e90ff>A new [value] version was found!</color>".replace("[value]", value);
|
String s1 = "<br><dark_red>║</dark_red> <color:#6e90ff>A new [value] version was found!</color>".replace("[value]", updateStatusVersion);
|
||||||
String s2 = "<br><dark_red>║</dark_red> <color:#6e90ff>Your version: <red>" + pluginVersion + "</red> <gray>-</gray> Current version:</color> <green>" + webData.getVersion() + "</green>";
|
String s2 = "<br><dark_red>║</dark_red> <color:#6e90ff>Your version: <red>" + pluginVersion + "</red> <gray>-</gray> Current version:</color> <green>" + webData.getVersion() + "</green>";
|
||||||
String s3 = "<br><dark_red>║</dark_red> <color:#6e90ff>You can download it here:</color> <yellow>" + webData.getUpdateUrl() + "</yellow>";
|
String s3 = "<br><dark_red>║</dark_red> <color:#6e90ff>You can download it here:</color> <yellow>" + webData.getUpdateUrl() + "</yellow>";
|
||||||
String s4 = "<br><dark_red>║</dark_red> <color:#6e90ff>You can find more information on Discord:</color> <yellow>" + discord + "</yellow>";
|
String s4 = "<br><dark_red>║</dark_red> <color:#6e90ff>You can find more information on Discord:</color> <yellow>" + discord + "</yellow>";
|
||||||
@@ -119,9 +120,13 @@ public class T2CupdateAPI {
|
|||||||
try {
|
try {
|
||||||
object = T2CupdateAPI.pluginVersions.get(args[1]);
|
object = T2CupdateAPI.pluginVersions.get(args[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return "Das Plugin " + args[1] + " gibts net"; // todo
|
return Util.getPrefix() + " <red>The plugin <yellow>" + args[1] + "</yellow> is not registered in the update checker of T2Code!</red>";
|
||||||
}
|
}
|
||||||
|
if (object == null) return Util.getPrefix() + " <red>The plugin <yellow>" + args[1] + "</yellow> is not registered in the update checker of T2Code!</red>";
|
||||||
T2CupdateWebData webData = object.webData;
|
T2CupdateWebData webData = object.webData;
|
||||||
|
if (webData == null) {
|
||||||
|
return Util.getPrefix() + " <b><dark_red>It could not be checked for updates with the plugin <yellow>" + args[1] + "</yellow>!</dark_red></b>";
|
||||||
|
}
|
||||||
String pluginName = T2CupdateAPI.pluginVersions.get(args[1]).pluginName;
|
String pluginName = T2CupdateAPI.pluginVersions.get(args[1]).pluginName;
|
||||||
String pluginVersion = T2CupdateAPI.pluginVersions.get(args[1]).pluginVersion;
|
String pluginVersion = T2CupdateAPI.pluginVersions.get(args[1]).pluginVersion;
|
||||||
|
|
||||||
@@ -162,7 +167,7 @@ public class T2CupdateAPI {
|
|||||||
|
|
||||||
String text;
|
String text;
|
||||||
|
|
||||||
text = "<dark_red>╔══════════════════════</dark_red>";
|
text = "<br><dark_red>╔══════════════════════</dark_red>";
|
||||||
text = text + pluginNameString;
|
text = text + pluginNameString;
|
||||||
text = text + pluginVersionString;
|
text = text + pluginVersionString;
|
||||||
text = text + updateInfoString.replace("[value]", object.updateAvailable ? "Update available" : "Info about your version");
|
text = text + updateInfoString.replace("[value]", object.updateAvailable ? "Update available" : "Info about your version");
|
||||||
|
@@ -15,6 +15,7 @@ import java.io.*;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ public class T2CupdateCheckerGit {
|
|||||||
String finalRepoURL = RepoURL;
|
String finalRepoURL = RepoURL;
|
||||||
|
|
||||||
Integer finalInterval;
|
Integer finalInterval;
|
||||||
if (timeInterval < 1){
|
if (timeInterval < 1) {
|
||||||
finalInterval = 1;
|
finalInterval = 1;
|
||||||
} else finalInterval = timeInterval;
|
} else finalInterval = timeInterval;
|
||||||
|
|
||||||
@@ -98,19 +99,19 @@ public class T2CupdateCheckerGit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject obj = new JSONObject(data);
|
JSONObject obj = new JSONObject(data);
|
||||||
String UpdateName = obj.getString("name");
|
String updateTitle = obj.getString("name");
|
||||||
String tag_name = obj.getString("tag_name");
|
String version = obj.getString("tag_name");
|
||||||
String body = obj.getString("body").replace("\n", "<br>").replace("\r", "").replace("'", "''").replace("**", "");
|
String updateDescription = obj.getString("body").replace("\n", "<br>").replace("\r", "").replace("'", "''").replace("**", "");
|
||||||
String updateurl = obj.getString("html_url");
|
String updateUrl = obj.getString("html_url");
|
||||||
boolean prerelease = obj.getBoolean("prerelease");
|
boolean preRelease = obj.getBoolean("prerelease");
|
||||||
|
|
||||||
String date = obj.getString("published_at");
|
String date = obj.getString("published_at");
|
||||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
|
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
|
||||||
Date parsedDate = inputFormat.parse(date);
|
Date parsedDate = inputFormat.parse(date);
|
||||||
String formattedDate = outputFormat.format(parsedDate);
|
String publishedAt = outputFormat.format(parsedDate);
|
||||||
|
|
||||||
String gitURL = updateurl;
|
String gitURL = updateUrl;
|
||||||
JSONArray downloadArray = obj.getJSONArray("assets");
|
JSONArray downloadArray = obj.getJSONArray("assets");
|
||||||
String downloadURL;
|
String downloadURL;
|
||||||
if (downloadArray.isEmpty()) {
|
if (downloadArray.isEmpty()) {
|
||||||
@@ -119,14 +120,14 @@ public class T2CupdateCheckerGit {
|
|||||||
downloadURL = downloadArray.getJSONObject(0).getString("browser_download_url");
|
downloadURL = downloadArray.getJSONObject(0).getString("browser_download_url");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!prerelease) {
|
if (!preRelease) {
|
||||||
downloadURL = "https://www.spigotmc.org/resources/" + spigotID;
|
downloadURL = "https://www.spigotmc.org/resources/" + spigotID;
|
||||||
updateurl = "https://www.spigotmc.org/resources/" + spigotID;
|
updateUrl = "https://www.spigotmc.org/resources/" + spigotID;
|
||||||
}
|
}
|
||||||
|
|
||||||
T2CupdateWebData webData = new T2CupdateWebData(UpdateName, tag_name, body, updateurl, formattedDate, downloadURL, gitURL, prerelease);
|
T2CupdateWebData webData = new T2CupdateWebData(updateTitle, version, updateDescription, updateUrl, publishedAt, downloadURL, gitURL, preRelease);
|
||||||
consumer.accept(webData);
|
consumer.accept(webData);
|
||||||
} catch (Exception var10) {
|
} catch (Exception exception) {
|
||||||
Boolean load = false;
|
Boolean load = false;
|
||||||
if (T2CupdateAPI.pluginVersions.containsKey(plugin.getName())) {
|
if (T2CupdateAPI.pluginVersions.containsKey(plugin.getName())) {
|
||||||
load = T2CupdateAPI.pluginVersions.get(plugin.getName()).load;
|
load = T2CupdateAPI.pluginVersions.get(plugin.getName()).load;
|
||||||
@@ -140,7 +141,9 @@ public class T2CupdateCheckerGit {
|
|||||||
updateCheckOnJoin
|
updateCheckOnJoin
|
||||||
);
|
);
|
||||||
T2CupdateAPI.pluginVersions.put(plugin.getName(), update);
|
T2CupdateAPI.pluginVersions.put(plugin.getName(), update);
|
||||||
this.plugin.getLogger().severe("§4 Cannot look for updates: " + var10.getMessage());
|
|
||||||
|
T2Csend.error(this.plugin,"§4 Cannot look for updates: " + exception.getMessage());
|
||||||
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -52,6 +52,13 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
}
|
}
|
||||||
Commands.updateInfo(sender, args);
|
Commands.updateInfo(sender, args);
|
||||||
return false;
|
return false;
|
||||||
|
// case "plugininfo": todo
|
||||||
|
// if (!sender.hasPermission("t2code.admin")) {
|
||||||
|
// T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// Commands.updateInfo(sender, args);
|
||||||
|
// return false;
|
||||||
case "reloadconfig":
|
case "reloadconfig":
|
||||||
if (!sender.hasPermission("t2code.admin")) {
|
if (!sender.hasPermission("t2code.admin")) {
|
||||||
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
@@ -74,10 +81,11 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
}
|
}
|
||||||
Commands.test(sender, args);
|
Commands.test(sender, args);
|
||||||
return false;
|
return false;
|
||||||
case "serverid":if (!sender.hasPermission("t2code.admin")) {
|
case "serverid":
|
||||||
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
if (!sender.hasPermission("t2code.admin")) {
|
||||||
return false;
|
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
T2Csend.sender(sender, ("[prefix] <red>T2C ServerID:</red> <gold><hover:show_text:'<yellow>copy</yellow>'>" +
|
T2Csend.sender(sender, ("[prefix] <red>T2C ServerID:</red> <gold><hover:show_text:'<yellow>copy</yellow>'>" +
|
||||||
"<click:copy_to_clipboard:[id]>[id]</click></hover></gold>").replace("[prefix]", Util.getPrefix()).replace("[id]", String.valueOf(Util.getServerUUID())));
|
"<click:copy_to_clipboard:[id]>[id]</click></hover></gold>").replace("[prefix]", Util.getPrefix()).replace("[id]", String.valueOf(Util.getServerUUID())));
|
||||||
return false;
|
return false;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package net.t2code.t2codelib;
|
package net.t2code.t2codelib;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -13,7 +14,7 @@ public class Util {
|
|||||||
|
|
||||||
|
|
||||||
public static String getInfoText() {
|
public static String getInfoText() {
|
||||||
return "";
|
return "<yellow>Description:</yellow> <gold>"+T2CodeLibMain.getPlugin().getDescription().getDescription()+"</gold>" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPrefix() {
|
public static String getPrefix() {
|
||||||
|
@@ -3,7 +3,7 @@ version: '${project.version}'
|
|||||||
main: net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain
|
main: net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
prefix: T2CodeLib
|
prefix: T2CodeLib
|
||||||
authors: [ JaTiTV, Jkobs ]
|
authors: [ JaTiTV ]
|
||||||
description: Library from T2Code Plugins
|
description: Library from T2Code Plugins
|
||||||
website: https://spigotmc.org/resources/96388/
|
website: https://spigotmc.org/resources/96388/
|
||||||
load: STARTUP
|
load: STARTUP
|
||||||
|
Reference in New Issue
Block a user