Expand CustomClickEvent to have raw and parsed data

This commit is contained in:
md_5
2025-05-22 22:16:22 +10:00
parent f1f5be18f9
commit f8de305477
2 changed files with 23 additions and 5 deletions

View File

@@ -394,12 +394,20 @@ public class UpstreamBridge extends PacketHandler
for ( String line : lines )
{
String[] split = line.split( "\t", 2 );
parsed.put( split[0], ( split.length > 1 ) ? split[1] : "" );
if ( split.length > 1 )
{
parsed.put( split[0], split[1] );
}
}
data = parsed.buildOrThrow();
if ( data.isEmpty() )
{
data = null;
}
data = parsed.build();
}
CustomClickEvent event = new CustomClickEvent( con, customClickAction.getId(), data );
CustomClickEvent event = new CustomClickEvent( con, customClickAction.getId(), customClickAction.getData(), data );
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
{
throw CancelSendSignal.INSTANCE;