Add optional 1.18 (21w40a) snapshot protocol support

Accessible via the net.md_5.bungee.protocol.snapshot JVM property.
This commit is contained in:
md_5
2021-10-09 09:25:28 +11:00
parent c5a90475af
commit f26f7d8809
6 changed files with 24 additions and 7 deletions

View File

@@ -216,7 +216,7 @@ public class ServerConnector extends PacketHandler
// Set tab list size, TODO: what shall we do about packet mutability
Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(),
(byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() );
(byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat() );
user.unsafe().sendPacket( modLogin );

View File

@@ -71,6 +71,8 @@ public abstract class EntityMap
case ProtocolConstants.MINECRAFT_1_17:
case ProtocolConstants.MINECRAFT_1_17_1:
return EntityMap_1_16_2.INSTANCE_1_17;
case ProtocolConstants.MINECRAFT_1_18:
return EntityMap_1_16_2.INSTANCE_1_18;
}
throw new RuntimeException( "Version " + version + " has no entity map" );
}

View File

@@ -16,6 +16,7 @@ class EntityMap_1_16_2 extends EntityMap
static final EntityMap_1_16_2 INSTANCE_1_16_2 = new EntityMap_1_16_2( 0x04, 0x2D );
static final EntityMap_1_16_2 INSTANCE_1_17 = new EntityMap_1_16_2( 0x04, 0x2D );
static final EntityMap_1_16_2 INSTANCE_1_18 = new EntityMap_1_16_2( 0x04, 0x2D );
//
private final int spawnPlayerId;
private final int spectateId;