Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
3ce11b3d12 | |||
f14aeb6078 | |||
066496dea0 | |||
d7cad5524c |
10
.idea/jarRepositories.xml
generated
10
.idea/jarRepositories.xml
generated
@@ -26,11 +26,21 @@
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="placeholderapi" />
|
||||
<option name="name" value="placeholderapi" />
|
||||
<option name="url" value="https://repo.extendedclip.com/content/repositories/placeholderapi/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="placeholderapi" />
|
||||
<option name="name" value="placeholderapi" />
|
||||
<option name="url" value="http://repo.extendedclip.com/content/repositories/placeholderapi/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BenCodez Repo" />
|
||||
<option name="name" value="BenCodez Repo" />
|
||||
<option name="url" value="https://nexus.bencodez.com/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Builders-Paradise" />
|
||||
<option name="name" value="Builders-Paradise" />
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-20181022.190036-99.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-20181022.190036-99-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-20181022.190036-99-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@@ -25,24 +25,34 @@
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.t2code:bungee:1615" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.t2code:LuckyBox-API:4.2.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.MilkBowl:VaultAPI:1.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.t2code:bungee:1615" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.t2code:LuckyBox-API:4.2.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.MilkBowl:VaultAPI:1.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.bencodez:votingplugin:6.9.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-velocity:2.2.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-base:2.2.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.bencodez:advancedcore:master-072a28e1ee-1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: xyz.upperlevel.spigot.book:spigot-book-api:1.6" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: dev.dbassett:skullcreator:3.0.1" level="project" />
|
||||
</component>
|
||||
</module>
|
14
pom.xml
14
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>11.6</version>
|
||||
<version>12.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>T2CodeLib</name>
|
||||
@@ -73,7 +73,11 @@
|
||||
</repository>
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>BenCodez Repo</id>
|
||||
<url>https://nexus.bencodez.com/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@@ -106,5 +110,11 @@
|
||||
<version>2.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>votingplugin</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
102
src/main/java/net/t2code/lib/Spigot/Lib/eco/Eco.java
Normal file
102
src/main/java/net/t2code/lib/Spigot/Lib/eco/Eco.java
Normal file
@@ -0,0 +1,102 @@
|
||||
package net.t2code.lib.Spigot.Lib.eco;
|
||||
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
||||
import net.t2code.lib.Spigot.system.Main;
|
||||
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Eco {
|
||||
|
||||
public static boolean moneyRemove(String prefix, Player player, Double price) {
|
||||
if (vault(prefix, player)) {
|
||||
return Main.eco.withdrawPlayer(player, price).transactionSuccess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean moneyAdd(String prefix, Player player, Double price) {
|
||||
if (vault(prefix, player)) {
|
||||
return Main.eco.depositPlayer(player, price).transactionSuccess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean vault(String prefix, Player player) {
|
||||
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);
|
||||
}
|
||||
player.sendMessage(prefix + "\n" + SelectLibMsg.vaultNotSetUp + "\n" + prefix);
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
public static boolean itemRemove(Player player, String item, int amount) {
|
||||
ItemStack itemStack = new ItemStack(Material.valueOf(item.toUpperCase()));
|
||||
boolean have = false;
|
||||
int anz = 0;
|
||||
for (int iam = 0; iam < player.getInventory().getSize(); iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm == null) continue;
|
||||
if (itm.getType() == itemStack.getType()) {
|
||||
anz = anz + itm.getAmount();
|
||||
}
|
||||
}
|
||||
if (anz >= amount) {
|
||||
player.getInventory().removeItem(new ItemStack(Material.valueOf(item), amount));
|
||||
have = true;
|
||||
}
|
||||
return have;
|
||||
}
|
||||
|
||||
public static boolean itemAdd(Player player, String item, int amount) {
|
||||
ItemStack itemStack = new ItemStack(Material.valueOf(item.toUpperCase()));
|
||||
boolean empty = false;
|
||||
for (int i = 0; i < player.getInventory().getSize() - 5; i++) {
|
||||
if (player.getInventory().getItem(i) == null) {
|
||||
empty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < amount; i++) {
|
||||
if (empty) {
|
||||
player.getInventory().addItem(itemStack);
|
||||
} else {
|
||||
player.getLocation().getWorld().dropItem(player.getLocation(), itemStack);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean votePointsRemove(String prefix, Player player, Integer amount) {
|
||||
if (votePlugin(prefix, player)) {
|
||||
return Main.voteUserManager.getVotingPluginUser(player).removePoints(amount);
|
||||
|
||||
} else return false;
|
||||
}
|
||||
|
||||
public static boolean votePointsAdd(String prefix, Player player, Integer amount) {
|
||||
if (votePlugin(prefix, player)) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(Main.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Main.voteUserManager.getVotingPluginUser(player).addPoints(amount);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
private static boolean votePlugin(String prefix, Player player) {
|
||||
if (PluginCheck.votingPlugin()) return true;
|
||||
send.console(prefix + " §4\n" + prefix + " §4VotingPlugin could not be found! §9Please download it here: " +
|
||||
"§6https://www.spigotmc.org/resources/votingplugin.15358/§4\n" + prefix);
|
||||
player.sendMessage(prefix + "\n" + SelectLibMsg.votingPluginNotSetUp + "\n" + prefix);
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -1,13 +1,10 @@
|
||||
package net.t2code.lib.Spigot.Lib.vault;
|
||||
package net.t2code.lib.Spigot.Lib.eco;
|
||||
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.system.Main;
|
||||
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
|
||||
import net.t2code.lib.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
public class Vault {
|
||||
@@ -15,32 +12,6 @@ public class Vault {
|
||||
public static Boolean vaultEnable;
|
||||
public static Boolean connected;
|
||||
|
||||
public static boolean buy(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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
p.sendMessage(prefix + "\n" + SelectLibMsg.vaultNotSetUp + "\n" + prefix);
|
||||
} else {
|
||||
return Main.eco.depositPlayer(p,price).transactionSuccess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void loadVault() throws InterruptedException {
|
||||
long long_ = System.currentTimeMillis();
|
||||
if (Main.plugin.getServer().getPluginManager().getPlugin("Vault") != null) {
|
||||
@@ -71,6 +42,7 @@ public class Vault {
|
||||
}
|
||||
|
||||
public static void vaultDisable() {
|
||||
if (!connected) return;
|
||||
connected = false;
|
||||
send.console(Util.getPrefix() + " §4Vault / Economy successfully deactivated.");
|
||||
}
|
@@ -15,9 +15,9 @@ public class ItemVersion {
|
||||
private static ItemStack RED_WOOL;
|
||||
private static ItemStack RED_STAINED_GLASS_PANE;
|
||||
|
||||
public static void scan(){
|
||||
public static void scan() {
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
Head = Material.valueOf("SKULL");
|
||||
Head = Material.valueOf("SKULL_ITEM");
|
||||
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);
|
||||
@@ -35,7 +35,7 @@ public class ItemVersion {
|
||||
RED_WOOL = new ItemStack(Material.RED_WOOL);
|
||||
RED_STAINED_GLASS_PANE = new ItemStack(Material.RED_STAINED_GLASS_PANE);
|
||||
}
|
||||
HeadIS = new ItemStack(Head);
|
||||
HeadIS = new ItemStack(Head, 1, (byte) 3);
|
||||
}
|
||||
|
||||
public static Material getHead() {
|
||||
|
@@ -0,0 +1,39 @@
|
||||
package net.t2code.lib.Spigot.Lib.messages;
|
||||
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class HoverModule {
|
||||
|
||||
public static void module(String text, String hover, String action, String actionValue, Player player) {
|
||||
module((text != null ? text : "null") + "/*/" + (hover != null ? hover : "null") + "/*/" + (action != null ? action : "null")
|
||||
+ "/*/" + (actionValue != null ? actionValue : "null"), player);
|
||||
}
|
||||
|
||||
public static void module(String msg, Player player) {
|
||||
if (!msg.contains("/*/")) {
|
||||
player.sendMessage(msg);
|
||||
return;
|
||||
}
|
||||
String[] split = msg.split("/\\*/");
|
||||
int i = split.length;
|
||||
String text = null;
|
||||
String hover = null;
|
||||
String action = null;
|
||||
String actionValue = null;
|
||||
if (i > 0) text= split[0];
|
||||
if (i > 1) hover =split[1];
|
||||
if (i > 2)action = split[2];
|
||||
if (i > 3)actionValue = split[3];
|
||||
|
||||
TextBuilder textBuilder = new TextBuilder(text);
|
||||
if (hover != null && !hover.equals("null")) {
|
||||
textBuilder.addHover(hover);
|
||||
}
|
||||
|
||||
if (action != null && actionValue != null && !action.equals("null") && !actionValue.equals("null")) {
|
||||
textBuilder.addClickEvent(ClickEvent.Action.valueOf(action.toUpperCase()), actionValue);
|
||||
}
|
||||
player.spigot().sendMessage(textBuilder.build());
|
||||
}
|
||||
}
|
@@ -2,6 +2,7 @@ package net.t2code.lib.Spigot.Lib.messages;
|
||||
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
||||
@@ -14,6 +15,7 @@ public class T2CodeTemplate {
|
||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord) {
|
||||
return onLoadHeader(prefix, autor, version, spigot, discord, null, null);
|
||||
}
|
||||
|
||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium) {
|
||||
return onLoadHeader(prefix, autor, version, spigot, discord, isPremium, null);
|
||||
}
|
||||
@@ -97,9 +99,14 @@ public class T2CodeTemplate {
|
||||
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
if (sender instanceof Player) {
|
||||
|
||||
TextComponent comp2 = new TextBuilder(prefix + " §2Version: §6" + pluginVersion)
|
||||
.addHover("§8Click to copy").addClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, Replace.removeColorCode(prefix) + " - " + pluginVersion).build();
|
||||
sender.spigot().sendMessage(comp2);
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12 || MCVersion.minecraft1_13 || MCVersion.minecraft1_14 || MCVersion.minecraft1_15) {
|
||||
send.sender(sender, prefix + " §2Version: §6" + pluginVersion);
|
||||
} else {
|
||||
TextComponent comp2 = new TextBuilder(prefix + " §2Version: §6" + pluginVersion)
|
||||
.addHover("§8Click to copy").addClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, Replace.removeColorCode(prefix) + " - " + pluginVersion).build();
|
||||
sender.spigot().sendMessage(comp2);
|
||||
}
|
||||
|
||||
if (!publicVersion.equalsIgnoreCase(pluginVersion)) {
|
||||
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, (Player) sender);
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ public class send {
|
||||
|
||||
public static void player(Player player, String msg) {
|
||||
if (msg == null || msg.contains("[empty]")) return;
|
||||
player.sendMessage(msg);
|
||||
HoverModule.module(msg,player);
|
||||
}
|
||||
|
||||
public static void title(Player player, String msg, String msg2) {
|
||||
|
@@ -28,12 +28,15 @@ public class PluginCheck {
|
||||
public static Boolean cmi(){
|
||||
return Bukkit.getPluginManager().getPlugin("CMI") != null;
|
||||
}
|
||||
|
||||
public static Boolean votingPlugin(){
|
||||
return Bukkit.getPluginManager().getPlugin("VotingPlugin") != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* T2Code Plugins
|
||||
* @return
|
||||
*/
|
||||
|
||||
public static Boolean cgui(){
|
||||
return Bukkit.getPluginManager().getPlugin("CommandGUI") != null;
|
||||
}
|
||||
|
@@ -12,14 +12,14 @@ public class Replace {
|
||||
public static String replace(String prefix, String Text) {
|
||||
return Text.replace("[prefix]", prefix).replace("&", "§").replace("[ue]", "ü")
|
||||
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||
.replace("[ae]", "ä").replace("[AE]", "Ä");
|
||||
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]","\n");
|
||||
}
|
||||
|
||||
|
||||
public static String replace(String prefix,Player player, String Text) {
|
||||
return PlaceholderAPI.setPlaceholders(player, Text.replace("[prefix]", prefix).replace("&", "§")
|
||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä"));
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]","\n"));
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Replace {
|
||||
for (String input : Text) {
|
||||
output.add(input.replace("[prefix]", prefix).replace("&", "§")
|
||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä"));
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]","\n"));
|
||||
}
|
||||
return output;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class Replace {
|
||||
for (String input : Text) {
|
||||
output.add(PlaceholderAPI.setPlaceholders(player, input.replace("[prefix]", prefix).replace("&", "§")
|
||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")));
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]","\n")));
|
||||
}
|
||||
return output;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class Replace {
|
||||
for (String s : Text) {
|
||||
rp.add(s.replace("[prefix]", prefix).replace("&", "§")
|
||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]","\n")
|
||||
.replace("[price]", String.valueOf(price)));
|
||||
}
|
||||
return rp;
|
||||
@@ -81,7 +81,7 @@ public class Replace {
|
||||
for (String s : Text) {
|
||||
rp.add(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix).replace("&", "§")
|
||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]","\n")
|
||||
.replace("[price]", String.valueOf(price))));
|
||||
}
|
||||
return rp;
|
||||
@@ -89,7 +89,7 @@ public class Replace {
|
||||
public static String replacePrice(String prefix, String Text, String price) {
|
||||
return Text.replace("[prefix]", prefix).replace("&", "§").replace("[ue]", "ü")
|
||||
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[price]", String.valueOf(price));
|
||||
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[price]", String.valueOf(price)).replace("[nl]","\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public class Replace {
|
||||
return PlaceholderAPI.setPlaceholders(player, Text.replace("[prefix]", prefix).replace("&", "§")
|
||||
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
|
||||
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
|
||||
.replace("[price]", String.valueOf(price)));
|
||||
.replace("[price]", String.valueOf(price)).replace("[nl]","\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ package net.t2code.lib.Spigot.Lib.update;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
import net.t2code.lib.Spigot.Lib.messages.HoverModule;
|
||||
import net.t2code.lib.Spigot.Lib.messages.TextBuilder;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.system.Main;
|
||||
@@ -85,31 +86,19 @@ public class UpdateAPI {
|
||||
send.player(player, Prefix);
|
||||
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
||||
if (publicVersion.toLowerCase().contains("dev")) {
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new §4DEV§6 version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
HoverModule.module(Prefix + " §6A new §4DEV§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
||||
}
|
||||
if (publicVersion.toLowerCase().contains("beta")) {
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new §2BETA§6 version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
HoverModule.module(Prefix + " §6A new §2BETA§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
||||
}
|
||||
if (publicVersion.toLowerCase().contains("snapshot")) {
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new §eSNAPSHOT§6 version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
HoverModule.module(Prefix + " §6A new §eSNAPSHOT§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
||||
}
|
||||
} else {
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
HoverModule.module(Prefix + " §6A new version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
||||
}
|
||||
TextComponent comp1 = new TextBuilder(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion)
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp1);
|
||||
TextComponent comp2 = new TextBuilder(Prefix + " §6You can find more information on Discord.")
|
||||
.addHover("§e" + Discord).addClickEvent(ClickEvent.Action.OPEN_URL, Discord).build();
|
||||
player.spigot().sendMessage(comp2);
|
||||
HoverModule.module(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion, "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
||||
HoverModule.module(Prefix + " §6You can find more information on Discord.", "§e" + Discord, "OPEN_URL", Discord, player);
|
||||
send.player(player, Prefix);
|
||||
}
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package net.t2code.lib.Spigot.system;
|
||||
|
||||
import net.t2code.lib.Spigot.Lib.eco.Vault;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
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;
|
||||
|
@@ -1,7 +1,12 @@
|
||||
package net.t2code.lib.Spigot.system;
|
||||
|
||||
import com.bencodez.votingplugin.VotingPluginHooks;
|
||||
import com.bencodez.votingplugin.VotingPluginMain;
|
||||
import com.bencodez.votingplugin.advancedcore.AdvancedCorePlugin;
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import net.t2code.lib.Spigot.Lib.eco.Vault;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
@@ -9,7 +14,6 @@ import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||
import net.t2code.lib.Spigot.Lib.vault.Vault;
|
||||
import net.t2code.lib.Spigot.system.config.ConfigCreate;
|
||||
import net.t2code.lib.Spigot.system.languages.LanguagesCreate;
|
||||
import net.t2code.lib.Util;
|
||||
@@ -24,12 +28,16 @@ import java.util.List;
|
||||
|
||||
public final class Main extends JavaPlugin {
|
||||
|
||||
|
||||
|
||||
public static File getPath() {
|
||||
return plugin.getDataFolder();
|
||||
}
|
||||
|
||||
public static Main plugin;
|
||||
public static Economy eco = null;
|
||||
public static VotingPluginHooks votingPlugin = null;
|
||||
public static UserManager voteUserManager = null;
|
||||
public static Permission perm = null;
|
||||
|
||||
public static List<String> autor;
|
||||
@@ -49,7 +57,7 @@ public final class Main extends JavaPlugin {
|
||||
version = plugin.getDescription().getVersion();
|
||||
long long_;
|
||||
long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
||||
if (Util.getSnapshot()){
|
||||
if (Util.getSnapshot()) {
|
||||
send.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! §4This is a trial version! §eSome features may not be working as expected." +
|
||||
" Please report all bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
||||
send.console(prefix + " §4 §e-------------------");
|
||||
@@ -60,12 +68,6 @@ public final class Main extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
//send.console("§4 _|_|_|_|_| _|_| _|_|_| _| ");
|
||||
//send.console("§4 _| _| _| _| _|_| _|_|_| _|_| ");
|
||||
//send.console("§4 _| _| _| _| _| _| _| _|_|_|_| ");
|
||||
//send.console("§4 _| _| _| _| _| _| _| _| ");
|
||||
//send.console("§4 _| _|_|_|_| _|_|_| _|_| _|_|_| _|_|_| ");
|
||||
//T2CodeTemplate.onLoadSeparateStroke(prefix);
|
||||
try {
|
||||
Vault.loadVault();
|
||||
} catch (InterruptedException e) {
|
||||
@@ -73,7 +75,7 @@ public final class Main extends JavaPlugin {
|
||||
}
|
||||
NMSVersion.onCheck();
|
||||
MCVersion.onCheck();
|
||||
if (MCVersion.minecraft1_19){
|
||||
if (MCVersion.minecraft1_19) {
|
||||
send.warning(this, "The 1.19 is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
@@ -86,22 +88,27 @@ public final class Main extends JavaPlugin {
|
||||
if (eco != null) {
|
||||
String st = eco.getName();
|
||||
if (eco.getName().equals("CMIEconomy")) st = "CMI";
|
||||
if (Bukkit.getPluginManager().getPlugin(st) != null){
|
||||
if (Bukkit.getPluginManager().getPlugin(st) != null) {
|
||||
send.console(Main.prefix + " §3Economy: §6" + eco.getName() + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion() + " §7- §e" +
|
||||
(System.currentTimeMillis() - long_) + "ms");
|
||||
} else send.console(Main.prefix + " §3Economy: §6" + eco.getName() + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
} else send.console(Main.prefix + " §3Economy: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
|
||||
if (perm != null) {
|
||||
if (Bukkit.getPluginManager().getPlugin(perm.getName()) != null){
|
||||
if (Bukkit.getPluginManager().getPlugin(perm.getName()) != null) {
|
||||
send.console(Main.prefix + " §3Permission plugin: §6" + perm.getName() + " - " + Bukkit.getPluginManager().getPlugin(perm.getName()).getDescription().getVersion()
|
||||
+ " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
} else send.console(Main.prefix + " §3Permission plugin: §6" + perm.getName() + " - §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
} else send.console(Main.prefix + " §3Permission plugin: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
|
||||
if (PluginCheck.pluginCheck("PlaceholderAPI")) {
|
||||
if (PluginCheck.papi()) {
|
||||
send.console(Main.prefix + " §3PlaceholderAPI: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
if (PluginCheck.votingPlugin()) {
|
||||
votingPlugin = VotingPluginHooks.getInstance();
|
||||
voteUserManager = votingPlugin.getUserManager();
|
||||
send.console(Main.prefix + " §3VotingPlugin: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
Main.plugin.getCommand("t2code").setExecutor(new CmdExecuter());
|
||||
@@ -109,7 +116,7 @@ public final class Main extends JavaPlugin {
|
||||
LanguagesCreate.langCreate();
|
||||
SelectLibConfig.onSelect();
|
||||
SelectLibMsg.onSelect(prefix);
|
||||
if (!Util.getSnapshot()){
|
||||
if (!Util.getSnapshot()) {
|
||||
UpdateAPI.onUpdateCheck(plugin, prefix, spigot, spigotID, discord);
|
||||
Metrics.Bstats(plugin, bstatsID);
|
||||
}
|
||||
@@ -121,8 +128,8 @@ public final class Main extends JavaPlugin {
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
if (SelectLibConfig.InventoriesCloseByServerStop){
|
||||
for (Player player : Bukkit.getOnlinePlayers()){
|
||||
if (SelectLibConfig.InventoriesCloseByServerStop) {
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
player.closeInventory();
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ public class LanguagesCreate {
|
||||
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
|
||||
|
||||
Config.set("Plugin.VaultNotSetUp", MSG.EN_VaultNotSetUp, yamlConfigurationEN);
|
||||
Config.set("Plugin.VotingPluginNotSetUp", MSG.EN_VotingPluginNotSetUp, yamlConfigurationEN);
|
||||
Config.set("Plugin.SoundNotFound", MSG.EN_SoundNotFound, yamlConfigurationEN);
|
||||
|
||||
try {
|
||||
@@ -44,7 +45,8 @@ public class LanguagesCreate {
|
||||
File messagesDE = new File(Main.getPath(), "languages/german_messages.yml");
|
||||
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
|
||||
|
||||
Config.set("Plugin.VaultNotSetUp", MSG.DE_VaultNotSetUp, yamlConfigurationDE);
|
||||
Config.set("Plugin.VaultNotSetUp", MSG.DE_VotingPluginNotSetUp, yamlConfigurationDE);
|
||||
Config.set("Plugin.VotingPluginNotSetUp", MSG.DE_VotingPluginNotSetUp, yamlConfigurationDE);
|
||||
Config.set("Plugin.SoundNotFound", MSG.DE_SoundNotFound, yamlConfigurationDE);
|
||||
|
||||
try {
|
||||
@@ -64,6 +66,7 @@ public class LanguagesCreate {
|
||||
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messagesNO);
|
||||
|
||||
Config.set("Plugin.VaultNotSetUp", MSG.NO_VaultNotSetUp, yamlConfigurationNO);
|
||||
Config.set("Plugin.VotingPluginNotSetUp", MSG.NO_VotingPluginNotSetUp, yamlConfigurationNO);
|
||||
Config.set("Plugin.SoundNotFound", MSG.NO_SoundNotFound, yamlConfigurationNO);
|
||||
|
||||
try {
|
||||
|
@@ -6,17 +6,20 @@ public class MSG {
|
||||
|
||||
// EN
|
||||
public static String EN_VaultNotSetUp = "[prefix] &4Vault / Economy not set up!";
|
||||
public static String EN_VotingPluginNotSetUp = "[prefix] &4VotingPlugin is not present on the server!";
|
||||
public static String EN_SoundNotFound = "[prefix] &4The sound &6[sound] &4was not found! Please check the settings.";
|
||||
|
||||
|
||||
// DE
|
||||
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
||||
public static String DE_VaultPluginNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
||||
public static String DE_VotingPluginNotSetUp = "[prefix] &4VotingPlugin ist auf dem Server nicht vorhanden!";
|
||||
public static String DE_SoundNotFound = "[prefix] &4Der Sound &6[sound] &4wurde nicht gefunden! Bitte [ue]berpr[ue]fe die Einstellungen.";
|
||||
|
||||
|
||||
|
||||
// NO
|
||||
public static String NO_VaultNotSetUp = "[prefix] &4Vault / Økonomi har ikke blitt satt opp!";
|
||||
public static String NO_VotingPluginNotSetUp = "[prefix] &4VotingPlugin er ikke til stede på serveren!";
|
||||
public static String NO_SoundNotFound = "[prefix] &4Lyden &6[sound] &4ble ikke bli funnet! Vennligst sjekk innstillingene.";
|
||||
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ public class SelectLibMsg {
|
||||
public static String selectMSG;
|
||||
|
||||
public static String vaultNotSetUp;
|
||||
public static String votingPluginNotSetUp;
|
||||
public static String soundNotFound;
|
||||
|
||||
public static void onSelect(String Prefix) {
|
||||
@@ -39,6 +40,7 @@ public class SelectLibMsg {
|
||||
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
|
||||
|
||||
vaultNotSetUp = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VaultNotSetUp"));
|
||||
votingPluginNotSetUp = Replace.replace(prefix, yamlConfiguration_msg.getString("Plugin.VotingPluginNotSetUp"));
|
||||
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");
|
||||
|
@@ -6,8 +6,8 @@ prefix: T2CodeLib
|
||||
authors: [ JaTiTV, Jkobs ]
|
||||
description: Library from T2Code Plugins
|
||||
website: T2Code.net
|
||||
load: STARTUP
|
||||
softdepend: [ PlaceholderAPI, PlotSquared, CMI, CMILib, Vault, Economy, XConomy ]
|
||||
|
||||
softdepend: [ PlaceholderAPI, VotingPlugin, PlotSquared, CMI, CMILib, Vault, Economy, XConomy ]
|
||||
loadbefore: [ T2C-Alias ]
|
||||
|
||||
commands:
|
||||
|
Reference in New Issue
Block a user