Minecraft 1.19.4 support

This commit is contained in:
md_5
2023-03-15 03:30:00 +11:00
parent 1b6d845530
commit f9712cbc7c
12 changed files with 194 additions and 64 deletions

View File

@@ -698,9 +698,10 @@ public class DownstreamBridge extends PacketHandler
@Override
public void handle(ServerData serverData) throws Exception
{
serverData.setMotd( null );
serverData.setIcon( null );
con.unsafe().sendPacket( serverData );
// 1.19.4 doesn't allow empty MOTD and we probably don't want to simulate a ping event to get the "correct" one
// serverData.setMotd( null );
// serverData.setIcon( null );
// con.unsafe().sendPacket( serverData );
throw CancelSendSignal.INSTANCE;
}

View File

@@ -79,6 +79,8 @@ public abstract class EntityMap
case ProtocolConstants.MINECRAFT_1_19_1:
case ProtocolConstants.MINECRAFT_1_19_3:
return EntityMap_1_16_2.INSTANCE_1_19_1;
case ProtocolConstants.MINECRAFT_1_19_4:
return EntityMap_1_16_2.INSTANCE_1_19_4;
}
throw new RuntimeException( "Version " + version + " has no entity map" );
}

View File

@@ -19,6 +19,7 @@ class EntityMap_1_16_2 extends EntityMap
static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D );
static final EntityMap_1_16_2 INSTANCE_1_19 = new EntityMap_1_16_2( 0x02, 0x2F );
static final EntityMap_1_16_2 INSTANCE_1_19_1 = new EntityMap_1_16_2( 0x02, 0x30 );
static final EntityMap_1_16_2 INSTANCE_1_19_4 = new EntityMap_1_16_2( 0x03, 0x30 );
//
private final int spawnPlayerId;
private final int spectateId;