Compare commits

..

No commits in common. "2d916c7e0cff7393c838718c4e44a9d8a2e5c233" and "1b12c2728be9b9a470f40d836f665794f173f41e" have entirely different histories.

6 changed files with 10 additions and 81 deletions

View File

@ -6,10 +6,9 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>14.1</version> <version>14.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2CodeLib</name> <name>T2CodeLib</name>
<properties> <properties>

View File

@ -51,6 +51,7 @@ public class T2CbungeePlayers implements PluginMessageListener {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static void callAllBungeePlayers() { public static void callAllBungeePlayers() {

View File

@ -23,47 +23,6 @@ public class T2Creplace {
.replace("[nl]", "\n"))); .replace("[nl]", "\n")));
} }
public static Object replaceObject(String prefix, Object object) {
if (object instanceof String) {
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) || (object instanceof ArrayList)) {
List<String> in = (List<String>) object;
List<String> output = new ArrayList<>();
for (String input : in) {
output.add(replaceLegacyColor(input).replace("[prefix]", prefix)
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
.replace("[nl]", "\n"));
}
object = output;
}
return object;
}
public static Object replaceObject(String prefix, Player player, Object object) {
if (object instanceof String) {
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"));
}
if (object instanceof List) {
List<String> in = (List<String>) object;
List<String> output = new ArrayList<>();
for (String input : in) {
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
.replace("[OE]", "Ö").replace("[ae]", "ä").replace("[AE]", "Ä")
.replace("[nl]", "\n")));
}
object = output;
}
return object;
}
public static List<String> replace(String prefix, List<String> Text) { public static List<String> replace(String prefix, List<String> Text) {
List<String> output = new ArrayList<>(); List<String> output = new ArrayList<>();
for (String input : Text) { for (String input : Text) {
@ -76,7 +35,7 @@ public class T2Creplace {
} }
public static List<String> replace(String prefix, Player player, List<String> Text) { public static List<String> replace(String prefix, Player player, List<String> Text) {
List<String> output = new ArrayList<>(); List<String> output = new ArrayList();
if (player == null) { if (player == null) {
return Collections.singletonList("player is null"); return Collections.singletonList("player is null");
} }
@ -93,7 +52,7 @@ public class T2Creplace {
} }
public static List<String> replacePrice(String prefix, List<String> Text, String price) { public static List<String> replacePrice(String prefix, 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(s).replace("[prefix]", prefix) rp.add(replaceLegacyColor(s).replace("[prefix]", prefix)
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö") .replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")
@ -123,7 +82,7 @@ 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) rp.add(replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, s.replace("[prefix]", prefix)
.replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö") .replace("[ue]", "ü").replace("[UE]", "Ü").replace("[oe]", "ö")

View File

@ -24,29 +24,6 @@ public class T2Csend {
T2ChoverModule.modulePlayer(msg, player); T2ChoverModule.modulePlayer(msg, player);
} }
public static void sender(CommandSender sender, String msg) {
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleSender(msg, sender);
}
public static void console(Object object) {
String msg = String.valueOf(object);
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleConsole(msg);
}
public static void player(Player player, Object object) {
String msg = String.valueOf(object);
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.modulePlayer(msg, player);
}
public static void sender(CommandSender sender, Object object) {
String msg = String.valueOf(object);
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleSender(msg, sender);
}
public static void title(Player player, @Nullable String title, @Nullable String subtitle) { public static void title(Player player, @Nullable String title, @Nullable String subtitle) {
player.sendTitle(title, subtitle); player.sendTitle(title, subtitle);
} }
@ -55,6 +32,11 @@ public class T2Csend {
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut); player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
} }
public static void sender(CommandSender sender, String msg) {
if (msg == null || msg.contains("[empty]")) return;
T2ChoverModule.moduleSender(msg, sender);
}
public static void debug(Plugin plugin, String msg) { public static void debug(Plugin plugin, String msg) {
debug(plugin, msg, null); debug(plugin, msg, null);
} }

View File

@ -17,11 +17,6 @@ public class T2Cconfig {
YamlConfiguration.set(path, value); YamlConfiguration.set(path, value);
} }
} }
public static void set(String path, Object value, YamlConfiguration YamlConfiguration) {
if (!YamlConfiguration.contains(path)) {
YamlConfiguration.set(path, value);
}
}
public static void set(String path, YamlConfiguration YamlConfiguration) { public static void set(String path, YamlConfiguration YamlConfiguration) {
YamlConfiguration.set(path, null); YamlConfiguration.set(path, null);
@ -124,10 +119,6 @@ public class T2Cconfig {
return T2Creplace.replace(prefix, yamlConfiguration.getString(path)); return T2Creplace.replace(prefix, yamlConfiguration.getString(path));
} }
public static Object selectObject(String prefix, String path, YamlConfiguration yamlConfiguration) {
return T2Creplace.replaceObject(prefix, yamlConfiguration.get(path));
}
public static Integer selectInt(String path, YamlConfiguration yamlConfiguration) { public static Integer selectInt(String path, YamlConfiguration yamlConfiguration) {
return (yamlConfiguration.getInt(path)); return (yamlConfiguration.getInt(path));

View File

@ -108,9 +108,6 @@ public final class T2CodeLibMain extends JavaPlugin {
Metrics.Bstats(plugin, Util.getBstatsID()); Metrics.Bstats(plugin, Util.getBstatsID());
if (SelectLibConfig.getBungee()) { if (SelectLibConfig.getBungee()) {
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd"); Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bonlp"); Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bonlp");
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin, "t2c:bonlp")) { if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin, "t2c:bonlp")) {
T2Csend.debug(plugin, "registerIncomingPluginChannel §et2c:bonlp"); T2Csend.debug(plugin, "registerIncomingPluginChannel §et2c:bonlp");