mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1f48dc1e60
@ -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))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user