Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #304 from SpigotMC/master
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
johnfriedrich authored Jun 8, 2022
2 parents 02e2758 + ff5727c commit ff1df60
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>1.8.0</version>
<version>1.7.3</version>
<!-- not part of the API proper -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>1.8.0</version>
<version>1.7.3</version>
<!-- not part of the API proper -->
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down
9 changes: 5 additions & 4 deletions protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,6 @@ private void registerPacket(Class<? extends DefinedPacket> 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 )
{
Expand All @@ -610,6 +606,11 @@ private void registerPacket(Class<? extends DefinedPacket> packetClass, Supplier
}
}

if ( mapping.packetID < 0 )
{
break;
}

ProtocolData data = protocols.get( protocol );
data.packetMap.put( packetClass, mapping.packetID );
data.packetConstructors.put( mapping.packetID, constructor );
Expand Down
4 changes: 2 additions & 2 deletions proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>1.8.0</version>
<version>1.7.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>1.8.0</version>
<version>1.7.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 6 additions & 0 deletions proxy/src/main/java/net/md_5/bungee/UserConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private String handleChat(String message)
return message;
}
}
return null;
throw CancelSendSignal.INSTANCE;
}

@Override
Expand Down

0 comments on commit ff1df60

Please sign in to comment.