fix: make the events work with new adventure and improve SNBTUtilities a bit
This commit is contained in:
@@ -3,8 +3,8 @@ package me.chayapak1.chomens_bot.evalFunctions;
|
||||
import me.chayapak1.chomens_bot.Bot;
|
||||
import me.chayapak1.chomens_bot.data.eval.EvalFunction;
|
||||
import me.chayapak1.chomens_bot.data.listener.Listener;
|
||||
import me.chayapak1.chomens_bot.util.SNBTUtilities;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
|
||||
public class GetLatestChatMessageFunction extends EvalFunction implements Listener {
|
||||
private String latestMessage = "";
|
||||
@@ -17,7 +17,7 @@ public class GetLatestChatMessageFunction extends EvalFunction implements Listen
|
||||
|
||||
@Override
|
||||
public boolean onSystemMessageReceived (final Component component, final String string, final String ansi) {
|
||||
latestMessage = GsonComponentSerializer.gson().serialize(component);
|
||||
latestMessage = SNBTUtilities.fromComponent(false, component);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user