Minecraft 1.21.6-pre1 support
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package net.md_5.bungee.connection;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.brigadier.context.StringRange;
|
||||
import com.mojang.brigadier.suggestion.Suggestion;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
@@ -9,7 +8,6 @@ import io.netty.channel.Channel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.ServerConnection;
|
||||
@@ -31,6 +29,7 @@ import net.md_5.bungee.netty.PacketHandler;
|
||||
import net.md_5.bungee.protocol.PacketWrapper;
|
||||
import net.md_5.bungee.protocol.Protocol;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
import net.md_5.bungee.protocol.TagUtil;
|
||||
import net.md_5.bungee.protocol.packet.Chat;
|
||||
import net.md_5.bungee.protocol.packet.ClientChat;
|
||||
import net.md_5.bungee.protocol.packet.ClientCommand;
|
||||
@@ -48,6 +47,7 @@ import net.md_5.bungee.protocol.packet.TabCompleteRequest;
|
||||
import net.md_5.bungee.protocol.packet.TabCompleteResponse;
|
||||
import net.md_5.bungee.protocol.packet.UnsignedClientCommand;
|
||||
import net.md_5.bungee.util.AllowedCharacters;
|
||||
import se.llbit.nbt.SpecificTag;
|
||||
|
||||
public class UpstreamBridge extends PacketHandler
|
||||
{
|
||||
@@ -385,29 +385,7 @@ public class UpstreamBridge extends PacketHandler
|
||||
@Override
|
||||
public void handle(CustomClickAction customClickAction) throws Exception
|
||||
{
|
||||
Map<String, String> data = null;
|
||||
if ( customClickAction.getData() != null )
|
||||
{
|
||||
ImmutableMap.Builder<String, String> parsed = ImmutableMap.builder();
|
||||
|
||||
String[] lines = customClickAction.getData().split( "\n" );
|
||||
for ( String line : lines )
|
||||
{
|
||||
String[] split = line.split( "\t", 2 );
|
||||
if ( split.length > 1 )
|
||||
{
|
||||
parsed.put( split[0], split[1] );
|
||||
}
|
||||
}
|
||||
data = parsed.buildOrThrow();
|
||||
|
||||
if ( data.isEmpty() )
|
||||
{
|
||||
data = null;
|
||||
}
|
||||
}
|
||||
|
||||
CustomClickEvent event = new CustomClickEvent( con, customClickAction.getId(), customClickAction.getData(), data );
|
||||
CustomClickEvent event = new CustomClickEvent( con, customClickAction.getId(), TagUtil.toJson( (SpecificTag) customClickAction.getData() ) );
|
||||
if ( bungee.getPluginManager().callEvent( event ).isCancelled() )
|
||||
{
|
||||
throw CancelSendSignal.INSTANCE;
|
||||
|
Reference in New Issue
Block a user