Skip to content

Commit 1991af1

Browse files
committed
Project Uploaded
1 parent f48c1d2 commit 1991af1

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/main/java/net/matrixcreations/libraries/MatrixColorAPI.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,11 @@
55
import net.matrixcreations.libraries.utils.LegacyCodeUtils;
66
import net.matrixcreations.libraries.utils.SolidColorUtils;
77

8-
import java.lang.reflect.Method;
9-
import java.util.Arrays;
108
import java.util.List;
119
import java.util.stream.Collectors;
1210

1311
public final class MatrixColorAPI {
1412

15-
public static void main(String[] args) {
16-
logFormatExamples();
17-
}
18-
1913
public static String process(String text) {
2014
text = GradientUtils.processGradients(text);
2115
text = SolidColorUtils.processSolidColors(text);
@@ -26,40 +20,4 @@ public static String process(String text) {
2620
public static List<String> process(List<String> texts) {
2721
return texts.stream().map(MatrixColorAPI::process).collect(Collectors.toList());
2822
}
29-
30-
private static void logFormatExamples() {
31-
List<String> examples = Arrays.asList(
32-
"&#FFD700Normal text",
33-
"&#FF0000&lBold red text",
34-
"<GRADIENT:#FFD700>Hello this is gradient text</GRADIENT:#FF0000>",
35-
"<GRADIENT:#FFD700>&lHello this is bold gradient text</GRADIENT:#FF0000>",
36-
"<SOLID:#FFD700>Hello this is solid yellow text",
37-
"<SOLID:#FFD700>&lHello this is solid bold yellow text"
38-
);
39-
40-
// Process and log each format example
41-
ColorUtils.process(examples).forEach(MatrixColorAPI::sendConsoleMessage);
42-
}
43-
44-
public static void sendConsoleMessage(String message) {
45-
try {
46-
// Load the Bukkit class dynamically (without direct dependency)
47-
Class<?> bukkitClass = Class.forName("org.bukkit.Bukkit");
48-
49-
// Get the getConsoleSender method from Bukkit class
50-
Method getConsoleSenderMethod = bukkitClass.getMethod("getConsoleSender");
51-
52-
// Invoke the method to get the console sender
53-
Object consoleSender = getConsoleSenderMethod.invoke(null);
54-
55-
// Now find the sendMessage method from the console sender object
56-
Method sendMessageMethod = consoleSender.getClass().getMethod("sendMessage", String.class);
57-
58-
// Invoke the sendMessage method on the console sender object
59-
sendMessageMethod.invoke(consoleSender, message);
60-
61-
} catch (Exception e) {
62-
e.printStackTrace();
63-
}
64-
}
6523
}

0 commit comments

Comments
 (0)