diff --git a/api/pom.xml b/api/pom.xml index 22735ae6e7..cb42d6418b 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -59,14 +59,14 @@ org.apache.maven.resolver maven-resolver-connector-basic - 1.8.0 + 1.7.3 provided org.apache.maven.resolver maven-resolver-transport-http - 1.8.0 + 1.7.3 provided diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java index 0012be818e..919e38a34a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -246,6 +246,12 @@ public static UUID readUUID(ByteBuf input) public static void writeProperties(Property[] properties, ByteBuf buf) { + if ( properties == null ) + { + writeVarInt( 0, buf ); + return; + } + writeVarInt( properties.length, buf ); for ( Property prop : properties ) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java index 5ad10159c9..95d65b5865 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -596,10 +596,6 @@ private void registerPacket(Class packetClass, Supplier { // Mapping is non current, but the next one may be ok ProtocolMapping nextMapping = mappings[mappingIndex + 1]; - if ( nextMapping.packetID < 0 ) - { - break; - } if ( nextMapping.protocolVersion == protocol ) { @@ -610,6 +606,11 @@ private void registerPacket(Class packetClass, Supplier } } + if ( mapping.packetID < 0 ) + { + break; + } + ProtocolData data = protocols.get( protocol ); data.packetMap.put( packetClass, mapping.packetID ); data.packetConstructors.put( mapping.packetID, constructor ); diff --git a/proxy/pom.xml b/proxy/pom.xml index af8f76b241..5fd3a2ec26 100644 --- a/proxy/pom.xml +++ b/proxy/pom.xml @@ -107,13 +107,13 @@ org.apache.maven.resolver maven-resolver-connector-basic - 1.8.0 + 1.7.3 runtime org.apache.maven.resolver maven-resolver-transport-http - 1.8.0 + 1.7.3 runtime diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index a3a2e4cebf..c324461ae7 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -487,6 +487,12 @@ private void sendMessage(ChatMessageType position, UUID sender, String message) { if ( getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_19 ) { + // Align with Spigot and remove client side formatting for now + if ( position == ChatMessageType.CHAT ) + { + position = ChatMessageType.SYSTEM; + } + unsafe().sendPacket( new SystemChat( message, position.ordinal() ) ); } else { diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 9d53af6a40..9dfca8ab8f 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -550,7 +550,7 @@ public void run() userCon.setCompressionThreshold( BungeeCord.getInstance().config.getCompressionThreshold() ); userCon.init(); - unsafe.sendPacket( new LoginSuccess( getUniqueId(), getName(), loginProfile.getProperties() ) ); + unsafe.sendPacket( new LoginSuccess( getUniqueId(), getName(), ( loginProfile == null ) ? null : loginProfile.getProperties() ) ); ch.setProtocol( Protocol.GAME ); ch.getHandle().pipeline().get( HandlerBoss.class ).setHandler( new UpstreamBridge( bungee, userCon ) ); 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 9f9603b7b0..f2c1ce9654 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 @@ -193,7 +193,7 @@ private String handleChat(String message) return message; } } - return null; + throw CancelSendSignal.INSTANCE; } @Override