Merge remote-tracking branch 'origin/master'

This commit is contained in:
Taah 2023-08-26 06:19:30 -07:00
commit 1f48dc1e60

View File

@ -2,19 +2,21 @@ package dev.plex.listener.impl;
import dev.plex.listener.PlexListener; import dev.plex.listener.PlexListener;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import dev.plex.util.minimessage.SafeMiniMessage; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.block.SignChangeEvent;
public class SignListener extends PlexListener public class SignListener extends PlexListener
{ {
private static final LegacyComponentSerializer LEGACY_COMPONENT_SERIALIZER = LegacyComponentSerializer.legacyAmpersand();
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onSignEdit(SignChangeEvent event) public void onSignEdit(SignChangeEvent event)
{ {
for (int i = 0; i < event.lines().size(); i++) for (int i = 0; i < event.lines().size(); i++)
{ {
event.line(i, SafeMiniMessage.mmDeserialize(PlexUtils.getTextFromComponent(event.line(i)))); event.line(i, LEGACY_COMPONENT_SERIALIZER.deserialize(PlexUtils.getTextFromComponent(event.line(i))));
} }
} }
} }