11.5
This update introduces the possibility to disable messages. Just write '[empty]' in the message to disable it.
This commit is contained in:
parent
4bdbe98f8a
commit
efb66696eb
8
pom.xml
8
pom.xml
@ -6,7 +6,11 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>11.4</version>
|
||||
<<<<<<< Updated upstream
|
||||
<version>11.1</version>
|
||||
=======
|
||||
<version>11.5</version>
|
||||
>>>>>>> Stashed changes
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>T2CodeLib</name>
|
||||
@ -103,7 +107,7 @@
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.1</version>
|
||||
<version>2.9.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -7,34 +7,10 @@ import org.bukkit.inventory.ItemStack;
|
||||
public class ItemVersion {
|
||||
private static Material Head;
|
||||
private static ItemStack HeadIS;
|
||||
private static ItemStack CRAFTING_TABLE;
|
||||
private static ItemStack YELLOW_WOOL;
|
||||
private static ItemStack ORANGE_WOOL;
|
||||
private static ItemStack GREEN_WOOL;
|
||||
private static ItemStack GRAY_WOOL;
|
||||
private static ItemStack RED_WOOL;
|
||||
private static ItemStack RED_STAINED_GLASS_PANE;
|
||||
|
||||
public static void scan(){
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
Head = Material.valueOf("SKULL");
|
||||
YELLOW_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 4);
|
||||
ORANGE_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 1);
|
||||
GREEN_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 5);
|
||||
GRAY_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 8);
|
||||
RED_WOOL = new ItemStack(Material.valueOf("WOOL"), 1, (short) 14);
|
||||
RED_STAINED_GLASS_PANE = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 14);
|
||||
CRAFTING_TABLE = new ItemStack(Material.valueOf("WORKBENCH"));
|
||||
} else {
|
||||
Head = Material.valueOf("PLAYER_HEAD");
|
||||
CRAFTING_TABLE = new ItemStack(Material.CRAFTING_TABLE);
|
||||
YELLOW_WOOL = new ItemStack(Material.YELLOW_WOOL);
|
||||
ORANGE_WOOL = new ItemStack(Material.ORANGE_WOOL);
|
||||
GREEN_WOOL = new ItemStack(Material.GREEN_WOOL);
|
||||
GRAY_WOOL = new ItemStack(Material.GRAY_WOOL);
|
||||
RED_WOOL = new ItemStack(Material.RED_WOOL);
|
||||
RED_STAINED_GLASS_PANE = new ItemStack(Material.RED_STAINED_GLASS_PANE);
|
||||
}
|
||||
} else Head = Material.valueOf("PLAYER_HEAD");
|
||||
HeadIS = new ItemStack(Head);
|
||||
}
|
||||
|
||||
@ -45,32 +21,4 @@ public class ItemVersion {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ public class TextBuilder {
|
||||
}
|
||||
|
||||
public TextComponent build() {
|
||||
if (this.text.contains("[empty]")) return null;
|
||||
TextComponent textComponent = new TextComponent();
|
||||
textComponent.setText(this.text);
|
||||
if (this.hover != null) {
|
||||
|
@ -14,22 +14,29 @@ public class send {
|
||||
*/
|
||||
|
||||
public static void console(String msg) {
|
||||
if (msg == null || msg.contains("[empty]")) return;
|
||||
Bukkit.getConsoleSender().sendMessage(msg);
|
||||
}
|
||||
|
||||
public static void player(Player player, String msg) {
|
||||
if (msg == null || msg.contains("[empty]")) return;
|
||||
player.sendMessage(msg);
|
||||
}
|
||||
|
||||
public static void title(Player player, String msg, String msg2) {
|
||||
if (msg == null || msg.contains("[empty]")) return;
|
||||
if (msg2 == null || msg2.contains("[empty]")) return;
|
||||
player.sendTitle(msg, msg2);
|
||||
}
|
||||
|
||||
public static void title(Player player, String msg, String msg2, int i, int i1, int i2) {
|
||||
if (msg == null || msg.contains("[empty]")) return;
|
||||
if (msg2 == null || msg2.contains("[empty]")) return;
|
||||
player.sendTitle(msg, msg2, i, i1, i2);
|
||||
}
|
||||
|
||||
public static void sender(CommandSender sender, String msg) {
|
||||
if (msg == null || msg.contains("[empty]")) return;
|
||||
sender.sendMessage(msg);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ public class NMSVersion {
|
||||
public static boolean v1_17_R1;
|
||||
public static boolean v1_18_R1;
|
||||
public static boolean v1_18_R2;
|
||||
public static boolean v1_19_R1;
|
||||
|
||||
public static void onCheck() {
|
||||
isNMS = Bukkit.getServer().getClass().getPackage().getName();
|
||||
@ -44,6 +43,5 @@ public class NMSVersion {
|
||||
v1_17_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_17_R1");
|
||||
v1_18_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_18_R1");
|
||||
v1_18_R2 = Bukkit.getServer().getClass().getPackage().getName().contains("1_18_R2");
|
||||
v1_19_R1 = Bukkit.getServer().getClass().getPackage().getName().contains("1_19_R1");
|
||||
}
|
||||
}
|
||||
|
@ -43,9 +43,6 @@ public class PluginCheck {
|
||||
public static Boolean luckyBox(){
|
||||
return Bukkit.getPluginManager().getPlugin("T2C-LuckyBox") != null;
|
||||
}
|
||||
public static Boolean autoResponse(){
|
||||
return Bukkit.getPluginManager().getPlugin("T2C-AutoResponse") != null;
|
||||
}
|
||||
public static Boolean opSec(){
|
||||
return Bukkit.getPluginManager().getPlugin("OPSecurity") != null;
|
||||
}
|
||||
@ -56,7 +53,7 @@ public class PluginCheck {
|
||||
return Bukkit.getPluginManager().getPlugin("Booster") != null;
|
||||
}
|
||||
public static Boolean antiMapCopy(){
|
||||
return Bukkit.getPluginManager().getPlugin("AntiMapCopy") != null;
|
||||
return Bukkit.getPluginManager().getPlugin("AAntiMapCopy") != null;
|
||||
}
|
||||
public static Boolean loreEditor(){
|
||||
return Bukkit.getPluginManager().getPlugin("LoreEditor") != null;
|
||||
|
@ -26,7 +26,7 @@ public class UpdateAPI {
|
||||
|
||||
public static void join(Plugin plugin, String prefix, String perm, Player player, String spigot, String discord) {
|
||||
String pluginVersion = plugin.getDescription().getVersion();
|
||||
if (!player.hasPermission(perm) && !player.isOp()) {
|
||||
if (!player.hasPermission(perm) || !player.isOp()) {
|
||||
return;
|
||||
}
|
||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()) == null) {
|
||||
|
@ -22,20 +22,12 @@ public class Vault {
|
||||
}
|
||||
p.sendMessage(prefix + "\n" + SelectLibMsg.VaultNotSetUp + "\n" + prefix);
|
||||
} else {
|
||||
return Main.eco.withdrawPlayer(p,price).transactionSuccess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean addMoney(String prefix, Player p, Double price) {
|
||||
if (Main.eco == null) {
|
||||
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
|
||||
send.console(prefix + " §4\n" + prefix + " §4Vault could not be found! §9Please download it here: " +
|
||||
"§6https://www.spigotmc.org/resources/vault.34315/§4\n" + prefix);
|
||||
if (Main.eco.getBalance(p) < price) {
|
||||
return false;
|
||||
} else {
|
||||
Main.eco.withdrawPlayer(p, price);
|
||||
return true;
|
||||
}
|
||||
p.sendMessage(prefix + "\n" + SelectLibMsg.VaultNotSetUp + "\n" + prefix);
|
||||
} else {
|
||||
return Main.eco.depositPlayer(p,price).transactionSuccess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -26,36 +26,35 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!sender.hasPermission("t2code.admin")) {
|
||||
send.sender(sender, "§4No Permission §8t2code.admin");
|
||||
if (!sender.hasPermission("t2code.admin")){
|
||||
send.sender(sender,"§4No Permission §8t2code.admin");
|
||||
return false;
|
||||
}
|
||||
if (args.length == 0) {
|
||||
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
|
||||
return false;
|
||||
}
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "info":
|
||||
case "plugin":
|
||||
case "pl":
|
||||
case "version":
|
||||
case "ver":
|
||||
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
|
||||
return false;
|
||||
case "debug":
|
||||
} else {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "info":
|
||||
case "plugin":
|
||||
case "pl":
|
||||
case "version":
|
||||
case "ver":
|
||||
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
|
||||
return false;
|
||||
}
|
||||
if ("debug".equals(args[0].toLowerCase())) {
|
||||
if (args.length != 2) {
|
||||
send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||
return false;
|
||||
}
|
||||
if ("createreportlog".equals(args[1].toLowerCase())) {
|
||||
CreateReportLog.create(sender);
|
||||
} else send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||
return false;
|
||||
|
||||
default:
|
||||
send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||
return false;
|
||||
CreateReportLog.create(sender);
|
||||
|
||||
} else send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||
} else send.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,10 +5,10 @@ import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
|
||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
||||
import net.t2code.lib.Spigot.Lib.vault.Vault;
|
||||
import net.t2code.lib.Util;
|
||||
import net.t2code.luckyBox.api.LuckyBoxAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -20,6 +20,7 @@ import java.util.Calendar;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
|
||||
public class CreateReportLog {
|
||||
protected static void create(CommandSender sender) {
|
||||
send.sender(sender, Main.prefix + " §6A DebugLog is created...");
|
||||
@ -101,26 +102,24 @@ public class CreateReportLog {
|
||||
zip.putNextEntry(new ZipEntry(fileToZip.getName()));
|
||||
Files.copy(fileToZip.toPath(), zip);
|
||||
|
||||
//File logToZip = new File(log);
|
||||
//zipOut.putNextEntry(new ZipEntry(logToZip.getName()));
|
||||
//Files.copy(logToZip.toPath(), zipOut);
|
||||
|
||||
addFileToZip("", "logs/latest.log", zip, false);
|
||||
|
||||
for (String pl : Util.getT2cPlugins()){
|
||||
pluginToDebug(pl, zip);
|
||||
}
|
||||
|
||||
//pluginToDebug("T2C-LuckyBox", zip);
|
||||
//pluginToDebug("WonderBagShop", zip);
|
||||
//pluginToDebug("CommandGUI", zip);
|
||||
//pluginToDebug("OPSecurity", zip);
|
||||
//pluginToDebug("PaPiTest", zip);
|
||||
//pluginToDebug("PlotSquaredGUI", zip);
|
||||
//pluginToDebug("T2C-Alias", zip);
|
||||
//pluginToDebug("T2C-AutoResponse", zip);
|
||||
//
|
||||
//pluginToDebug("LoreEditor", zip);
|
||||
//pluginToDebug("Booster", zip);
|
||||
//pluginToDebug("AntiMapCopy", zip);
|
||||
//pluginToDebug("AntiCopy", zip);
|
||||
//pluginToDebug("T2CodeLib", "T2CodeLib", zip); todo bugfix (servercrash)
|
||||
pluginToDebug("T2C-LuckyBox", "T2C-LuckyBox", zip);
|
||||
pluginToDebug("WonderBagShop", "WonderBagShop", zip);
|
||||
pluginToDebug("CommandGUI", "CommandGUI", zip);
|
||||
pluginToDebug("OPSecurity", "OPSecurity", zip);
|
||||
pluginToDebug("PaPiTest", "PaPiTest", zip);
|
||||
pluginToDebug("PlotSquaredGUI", "PlotSquaredGUI", zip);
|
||||
pluginToDebug("T2C-Alias", "T2Code-Alias", zip);
|
||||
|
||||
pluginToDebug("LoreEditor", "LoreEditor", zip);
|
||||
pluginToDebug("Booster", "Booster", zip);
|
||||
pluginToDebug("AntiMapCopy", "AntiCopy", zip);
|
||||
zip.closeEntry();
|
||||
zip.close();
|
||||
} catch (IOException e) {
|
||||
@ -134,7 +133,7 @@ public class CreateReportLog {
|
||||
|
||||
}
|
||||
|
||||
private static void pluginToDebug(String pluginName, ZipOutputStream zip) throws IOException {
|
||||
private static void pluginToDebug(String pluginName, String jar, ZipOutputStream zip) throws IOException {
|
||||
if (PluginCheck.pluginCheck(pluginName)) {
|
||||
Plugin plugin = Bukkit.getPluginManager().getPlugin(pluginName);
|
||||
File plConfigs = new File(plugin.getDataFolder().getPath());
|
||||
@ -145,7 +144,7 @@ public class CreateReportLog {
|
||||
File[] fileArray = f.listFiles();
|
||||
|
||||
for (File config : fileArray) {
|
||||
if (config.getName().contains(pluginName) && config.getName().contains(".jar")) {
|
||||
if (config.getName().contains(jar) && config.getName().contains(".jar")) {
|
||||
addFileToZip("T2Code-Plugins", config.getPath(), zip, false);
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import java.io.File;
|
||||
|
||||
public class SelectLibMsg {
|
||||
private static Plugin plugin = Main.plugin;
|
||||
private static String prefix = Main.prefix;
|
||||
private static String prefix = Main.prefix;
|
||||
|
||||
public static String selectMSG;
|
||||
|
||||
@ -41,6 +41,8 @@ public class SelectLibMsg {
|
||||
VaultNotSetUp = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VaultNotSetUp"));
|
||||
SoundNotFound = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.SoundNotFound"));
|
||||
|
||||
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
|
||||
|
||||
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
package net.t2code.lib;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class Util {
|
||||
private static Boolean Snapshot = false;
|
||||
|
||||
@ -35,24 +32,4 @@ public class Util {
|
||||
public static Boolean getSnapshot(){
|
||||
return Snapshot;
|
||||
}
|
||||
|
||||
public static List<String> getT2cPlugins() {
|
||||
return t2cPlugins;
|
||||
}
|
||||
|
||||
private static List<String> t2cPlugins =
|
||||
Arrays.asList(
|
||||
"T2C-LuckyBox",
|
||||
"WonderBagShop",
|
||||
"CommandGUI",
|
||||
"OPSecurity",
|
||||
"PaPiTest",
|
||||
"PlotSquaredGUI",
|
||||
"T2C-Alias",
|
||||
"T2C-AutoResponse",
|
||||
"LoreEditor",
|
||||
"Booster",
|
||||
"AntiMapCopy",
|
||||
"AntiCopy"
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user