Compare commits
No commits in common. "ec7714c9fec3c6b20c82778f27f2ef7cec15b58f" and "f8619e48029340d83642f46f44d89c25b9af717f" have entirely different histories.
ec7714c9fe
...
f8619e4802
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.6_dev-4</version>
|
<version>15.6_dev-3</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-->
|
||||||
|
@ -29,6 +29,7 @@ public class T2CitemBuilder {
|
|||||||
} else glass = new ItemStack(Material.valueOf(item.toUpperCase().replace(".", "_")));
|
} else glass = new ItemStack(Material.valueOf(item.toUpperCase().replace(".", "_")));
|
||||||
ItemMeta itemMetaglass = glass.getItemMeta();
|
ItemMeta itemMetaglass = glass.getItemMeta();
|
||||||
assert itemMetaglass != null;
|
assert itemMetaglass != null;
|
||||||
|
itemMetaglass.setDisplayName(" ");
|
||||||
glass.setItemMeta(itemMetaglass);
|
glass.setItemMeta(itemMetaglass);
|
||||||
glass.setAmount(1);
|
glass.setAmount(1);
|
||||||
for (int i = 0; i < 9 * lines; i++) {
|
for (int i = 0; i < 9 * lines; i++) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
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;
|
||||||
@ -18,16 +17,10 @@ public class T2Creplace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String replace(String prefix, Player player, String Text) {
|
public static String replace(String prefix, Player player, String Text) {
|
||||||
String input = Text.replace("[prefix]", prefix)
|
return replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, 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) {
|
||||||
@ -53,33 +46,18 @@ 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]", "ü")
|
||||||
if (T2CpluginCheck.papi()) {
|
.replace("[UE]", "Ü").replace("[oe]", "ö").replace("[OE]", "Ö")
|
||||||
object = PlaceholderAPI.setPlaceholders(player, replaceLegacyColor((String) object).replace("[prefix]", prefix).replace("[ue]", "ü")
|
.replace("[ae]", "ä").replace("[AE]", "Ä").replace("[nl]", "\n"));
|
||||||
.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) {
|
||||||
if (T2CpluginCheck.papi()) {
|
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).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")));
|
|
||||||
} 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;
|
||||||
}
|
}
|
||||||
@ -106,18 +84,10 @@ public class T2Creplace {
|
|||||||
return Collections.singletonList("Text is null");
|
return Collections.singletonList("Text is null");
|
||||||
}
|
}
|
||||||
for (String input : Text) {
|
for (String input : Text) {
|
||||||
if (T2CpluginCheck.papi()) {
|
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).replace("[prefix]", prefix)
|
||||||
output.add(PlaceholderAPI.setPlaceholders(player, replaceLegacyColor(input).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")));
|
|
||||||
} 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;
|
||||||
}
|
}
|
||||||
@ -145,15 +115,10 @@ 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) {
|
||||||
String input = 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]", "ö")
|
||||||
.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;
|
||||||
}
|
}
|
||||||
@ -167,16 +132,10 @@ 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) {
|
||||||
String input = Text.replace("[prefix]", prefix)
|
return replaceLegacyColor(PlaceholderAPI.setPlaceholders(player, 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) {
|
||||||
@ -213,7 +172,7 @@ public class T2Creplace {
|
|||||||
.replace("&r", "<reset>").replace("§r", "<reset>");
|
.replace("&r", "<reset>").replace("§r", "<reset>");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object replace(Object object, String placeholder, String replacement) {
|
public static Object replace(Object object,String placeholder,String replacement) {
|
||||||
if (object instanceof String) {
|
if (object instanceof String) {
|
||||||
object = ((String) object).replace(placeholder, replacement);
|
object = ((String) object).replace(placeholder, replacement);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user