diff --git a/api/src/main/java/net/md_5/bungee/api/event/CustomClickEvent.java b/api/src/main/java/net/md_5/bungee/api/event/CustomClickEvent.java
index 2a437593..0d340668 100644
--- a/api/src/main/java/net/md_5/bungee/api/event/CustomClickEvent.java
+++ b/api/src/main/java/net/md_5/bungee/api/event/CustomClickEvent.java
@@ -7,6 +7,7 @@ import lombok.ToString;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Cancellable;
import net.md_5.bungee.api.plugin.Event;
+import org.jetbrains.annotations.ApiStatus;
/**
* Called after a {@link ProxiedPlayer} runs a custom action from a chat event
@@ -15,6 +16,7 @@ import net.md_5.bungee.api.plugin.Event;
@Data
@ToString(callSuper = false)
@EqualsAndHashCode(callSuper = false)
+@ApiStatus.Experimental
public class CustomClickEvent extends Event implements Cancellable
{
@@ -32,11 +34,19 @@ public class CustomClickEvent extends Event implements Cancellable
*/
private final String id;
/**
- * Form data, may be null. If a form submission, usually contains a
+ * The raw data as submitted.
+ */
+ private final String rawData;
+ /**
+ * The parsed form data.
+ *
+ * If a form submission, usually contains a
* {@code CustomClickEvent.ACTION_KEY} key with the ID of the relevant
* submission action.
+ *
+ * If not a form submission, then may be null.
*/
- private final Map data;
+ private final Map parsedData;
/**
* Cancelled state.
*/
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
index c0fdf533..86d9d4c0 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java
@@ -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;