Compare commits
8 Commits
9.0_Snapsh
...
10.2
Author | SHA1 | Date | |
---|---|---|---|
|
ad5d7e09ea | ||
|
c564cdead1 | ||
2db5be7d56 | |||
|
9f19d2b039 | ||
3cb557c0e1 | |||
da2e9ff6a4 | |||
|
68d89e2e9e | ||
c171a1674d |
@@ -1,7 +1,7 @@
|
|||||||
<component name="ArtifactManager">
|
<component name="ArtifactManager">
|
||||||
<artifact type="jar" name="T2CodeLib_9.0_Snapshot_2">
|
<artifact type="jar" name="T2CodeLib_10.2">
|
||||||
<output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path>
|
<output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path>
|
||||||
<root id="archive" name="T2CodeLib_9.0_Snapshot_2.jar">
|
<root id="archive" name="T2CodeLib_10.2.jar">
|
||||||
<element id="module-output" name="T2CodeLib" />
|
<element id="module-output" name="T2CodeLib" />
|
||||||
</root>
|
</root>
|
||||||
</artifact>
|
</artifact>
|
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>9.0</version>
|
<version>10.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>T2CodeLib</name>
|
<name>T2CodeLib</name>
|
||||||
|
@@ -0,0 +1,85 @@
|
|||||||
|
package net.t2code.lib.Bungee.Lib.yamlConfiguration;
|
||||||
|
|
||||||
|
import net.md_5.bungee.config.Configuration;
|
||||||
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BConfig {
|
||||||
|
public static void set(String path, String value, Configuration configuration) {
|
||||||
|
if (!configuration.contains(path)) {
|
||||||
|
configuration.set(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(String path, Configuration configuration) {
|
||||||
|
configuration.set(path, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(String path, Integer value, Configuration configuration) {
|
||||||
|
if (!configuration.contains(path)) {
|
||||||
|
configuration.set(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(String path, Double value, Configuration configuration) {
|
||||||
|
if (!configuration.contains(path)) {
|
||||||
|
configuration.set(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(String path, Boolean value, Configuration configuration) {
|
||||||
|
if (!configuration.contains(path)) {
|
||||||
|
configuration.set(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void set(String path, List<String> value, Configuration configuration) {
|
||||||
|
if (!configuration.contains(path)) {
|
||||||
|
configuration.set(path, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String select(String prefix, String path, Configuration configuration) {
|
||||||
|
return Replace.replace(prefix, configuration.getString(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Integer selectInt(String path, Configuration configuration) {
|
||||||
|
return (configuration.getInt(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean selectBoolean(String path, Configuration configuration) {
|
||||||
|
return (configuration.getBoolean(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Double selectDouble(String path, Configuration configuration) {
|
||||||
|
return (configuration.getDouble(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> selectList(String path, Configuration configuration) {
|
||||||
|
return (configuration.getStringList(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static List<String> selectList(String prefix, String path, Configuration configuration) {
|
||||||
|
List<String> output = new ArrayList<>();
|
||||||
|
List<String> input = configuration.getStringList(path);
|
||||||
|
for (String st : input) {
|
||||||
|
output.add(Replace.replace(prefix, st));
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void select(String prefix, List<String> value, String path, Configuration configuration) {
|
||||||
|
List<String> output = new ArrayList<>();
|
||||||
|
List<String> input = configuration.getStringList(path);
|
||||||
|
for (String st : input) {
|
||||||
|
output.add(Replace.replace(prefix, st));
|
||||||
|
}
|
||||||
|
value = output;
|
||||||
|
}
|
||||||
|
}
|
@@ -5,9 +5,6 @@ import org.bukkit.permissions.Permission;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
public class Register {
|
public class Register {
|
||||||
public static void listener(Listener listener, Plugin plugin) {
|
public static void listener(Listener listener, Plugin plugin) {
|
||||||
@@ -35,4 +32,8 @@ public class Register {
|
|||||||
plugin.getServer().getPluginManager().getPermission(permission).setDefault(setDefault);
|
plugin.getServer().getPluginManager().getPermission(permission).setDefault(setDefault);
|
||||||
plugin.getServer().getPluginManager().getPermission(permission).getChildren().put(children, setBoolean);
|
plugin.getServer().getPluginManager().getPermission(permission).getChildren().put(children, setBoolean);
|
||||||
}
|
}
|
||||||
|
public static void permissionDescription(String permission, String description, Plugin plugin) {
|
||||||
|
plugin.getServer().getPluginManager().getPermission(permission).setDescription(description);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,18 +26,17 @@ public class UpdateAPI {
|
|||||||
|
|
||||||
public static void join(Plugin plugin, String prefix, String perm, Player player, String spigot, String discord) {
|
public static void join(Plugin plugin, String prefix, String perm, Player player, String spigot, String discord) {
|
||||||
String pluginVersion = plugin.getDescription().getVersion();
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
String publicVersion = UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion;
|
|
||||||
if (!player.hasPermission(perm) || !player.isOp()) {
|
if (!player.hasPermission(perm) || !player.isOp()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (publicVersion == null) {
|
if (UpdateAPI.PluginVersionen.get(plugin.getName()) == null) {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
join(plugin, prefix, perm, player, spigot, discord);
|
join(plugin, prefix, perm, player, spigot, discord);
|
||||||
}
|
}
|
||||||
}.runTaskLater(plugin, 20L);
|
}.runTaskLater(plugin, 20L);
|
||||||
} else use(plugin, prefix, player, pluginVersion, publicVersion, spigot, discord);
|
} else use(plugin, prefix, player, pluginVersion, UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion, spigot, discord);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {
|
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {
|
||||||
@@ -55,7 +54,19 @@ public class UpdateAPI {
|
|||||||
|
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
|
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
|
||||||
send.console("§4=========== " + Prefix + " §4===========");
|
send.console("§4=========== " + Prefix + " §4===========");
|
||||||
send.console("§6A new version was found!");
|
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")){
|
||||||
|
if (publicVersion.toLowerCase().contains("dev")){
|
||||||
|
send.console("§6A new §4DEV§6 version was found!");
|
||||||
|
}
|
||||||
|
if (publicVersion.toLowerCase().contains("beta")){
|
||||||
|
send.console("§6A new §2BETA§6 version was found!");
|
||||||
|
}
|
||||||
|
if (publicVersion.toLowerCase().contains("snapshot")){
|
||||||
|
send.console("§6A new §eSNAPSHOT§6 version was found!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
send.console("§6A new version was found!");
|
||||||
|
}
|
||||||
send.console("§6Your version: §c" + pluginVersion + " §7- §6Current version: §a" + publicVersion);
|
send.console("§6Your version: §c" + pluginVersion + " §7- §6Current version: §a" + publicVersion);
|
||||||
send.console("§6You can download it here: §e" + Spigot);
|
send.console("§6You can download it here: §e" + Spigot);
|
||||||
send.console("§6You can find more information on Discord: §e" + Discord);
|
send.console("§6You can find more information on Discord: §e" + Discord);
|
||||||
@@ -67,9 +78,27 @@ public class UpdateAPI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send.player(player, Prefix);
|
send.player(player, Prefix);
|
||||||
TextComponent comp = new TextBuilder(Prefix + " §6A new version was found!")
|
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")){
|
||||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
if (publicVersion.toLowerCase().contains("dev")){
|
||||||
player.spigot().sendMessage(comp);
|
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);
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
} 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);
|
||||||
|
}
|
||||||
TextComponent comp1 = new TextBuilder(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion)
|
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();
|
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||||
player.spigot().sendMessage(comp1);
|
player.spigot().sendMessage(comp1);
|
||||||
|
@@ -21,7 +21,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public final class Main extends JavaPlugin {
|
public final class Main extends JavaPlugin {
|
||||||
|
|
||||||
@@ -108,9 +107,11 @@ public final class Main extends JavaPlugin {
|
|||||||
LanguagesCreate.langCreate();
|
LanguagesCreate.langCreate();
|
||||||
SelectLibConfig.onSelect();
|
SelectLibConfig.onSelect();
|
||||||
SelectLibMsg.onSelect(prefix);
|
SelectLibMsg.onSelect(prefix);
|
||||||
UpdateAPI.onUpdateCheck(plugin, prefix, spigot, spigotID, discord);
|
if (!Util.getSnapshot()){
|
||||||
|
UpdateAPI.onUpdateCheck(plugin, prefix, spigot, spigotID, discord);
|
||||||
|
Metrics.Bstats(plugin, bstatsID);
|
||||||
|
}
|
||||||
|
|
||||||
Metrics.Bstats(plugin, bstatsID);
|
|
||||||
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
||||||
T2CodeTemplate.onLoadFooter(prefix, long_);
|
T2CodeTemplate.onLoadFooter(prefix, long_);
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package net.t2code.lib;
|
package net.t2code.lib;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
private static Boolean Snapshot = true;
|
private static Boolean Snapshot = false;
|
||||||
|
|
||||||
private static String Prefix = "§8[§4T2Code§5Lib§8]";
|
private static String Prefix = "§8[§4T2Code§5Lib§8]";
|
||||||
private static Integer SpigotID = 96388;
|
private static Integer SpigotID = 96388;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name: T2CodeLib
|
name: T2CodeLib
|
||||||
version: 9.0
|
version: 10.2
|
||||||
main: net.t2code.lib.Bungee.BMain
|
main: net.t2code.lib.Bungee.BMain
|
||||||
author: JaTiTV, Jkobs
|
author: JaTiTV, Jkobs
|
||||||
description: Libarie from T2Code Plugins
|
description: Libarie from T2Code Plugins
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
name: T2CodeLib
|
name: T2CodeLib
|
||||||
version: 9.0
|
version: 10.2
|
||||||
main: net.t2code.lib.Spigot.system.Main
|
main: net.t2code.lib.Spigot.system.Main
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
prefix: T2CodeLib
|
prefix: T2CodeLib
|
||||||
|
Reference in New Issue
Block a user