Minecraft 1.20 support

This commit is contained in:
md_5 2023-06-08 01:30:00 +10:00
parent 188d502c59
commit 68200133b6
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
26 changed files with 75 additions and 52 deletions

View File

@ -19,9 +19,6 @@ updates:
# Used with maven-resolver dependencies; 2.0 update breaks other providers
- dependency-name: "org.slf4j:slf4j-api"
update-types: ["version-update:semver-major"]
# 2.0 update is substantively breaking
- dependency-name: "org.yaml:snakeyaml"
update-types: ["version-update:semver-major"]
- package-ecosystem: "github-actions"
directory: "/"

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-API</name>
@ -72,7 +72,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
<version>2.0</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-bootstrap</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Bootstrap</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Chat</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-config</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Config</name>
@ -29,7 +29,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
<version>2.0</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-event</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Event</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-log</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Log</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-cmd-alert</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cmd_alert</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-cmd-find</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cmd_find</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-cmd-kick</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cmd_kick</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-cmd-list</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cmd_list</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-cmd-send</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cmd_send</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-cmd-server</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>cmd_server</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>BungeeCord Modules</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-module-reconnect-yaml</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>reconnect_yaml</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-native</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Native</name>

View File

@ -5,7 +5,7 @@
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>BungeeCord-Parent</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-protocol</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Protocol</name>

View File

@ -42,6 +42,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_19_1 = 760;
public static final int MINECRAFT_1_19_3 = 761;
public static final int MINECRAFT_1_19_4 = 762;
public static final int MINECRAFT_1_20 = 763;
public static final List<String> SUPPORTED_VERSIONS;
public static final List<Integer> SUPPORTED_VERSION_IDS;
@ -59,7 +60,8 @@ public class ProtocolConstants
"1.16.x",
"1.17.x",
"1.18.x",
"1.19.x"
"1.19.x",
"1.20.x"
);
ImmutableList.Builder<Integer> supportedVersionIds = ImmutableList.<Integer>builder().add(
ProtocolConstants.MINECRAFT_1_8,
@ -96,13 +98,14 @@ public class ProtocolConstants
ProtocolConstants.MINECRAFT_1_19,
ProtocolConstants.MINECRAFT_1_19_1,
ProtocolConstants.MINECRAFT_1_19_3,
ProtocolConstants.MINECRAFT_1_19_4
ProtocolConstants.MINECRAFT_1_19_4,
ProtocolConstants.MINECRAFT_1_20
);
if ( SNAPSHOT_SUPPORT )
{
// supportedVersions.add( "1.19.x" );
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_19 );
// supportedVersions.add( "1.20.x" );
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_20 );
}
SUPPORTED_VERSIONS = supportedVersions.build();

View File

@ -39,6 +39,7 @@ public class Login extends DefinedPacket
private boolean debug;
private boolean flat;
private Location deathLocation;
private int portalCooldown;
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -127,6 +128,10 @@ public class Login extends DefinedPacket
deathLocation = new Location( readString( buf ), buf.readLong() );
}
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
portalCooldown = readVarInt( buf );
}
}
@Override
@ -220,6 +225,10 @@ public class Login extends DefinedPacket
buf.writeBoolean( false );
}
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
writeVarInt( portalCooldown, buf );
}
}
@Override

View File

@ -29,6 +29,7 @@ public class Respawn extends DefinedPacket
private boolean flat;
private boolean copyMeta;
private Location deathLocation;
private int portalCooldown;
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -73,6 +74,10 @@ public class Respawn extends DefinedPacket
deathLocation = new Location( readString( buf ), buf.readLong() );
}
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
portalCooldown = readVarInt( buf );
}
}
@Override
@ -123,6 +128,10 @@ public class Respawn extends DefinedPacket
buf.writeBoolean( false );
}
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20 )
{
writeVarInt( portalCooldown, buf );
}
}
@Override

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Proxy</name>

View File

@ -225,7 +225,8 @@ 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.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation() );
(byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation(),
login.getPortalCooldown() );
user.unsafe().sendPacket( modLogin );
@ -243,7 +244,8 @@ public class ServerConnector extends PacketHandler
}
user.getSentBossBars().clear();
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) );
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(),
login.getPortalCooldown() ) );
user.getServer().disconnect( "Quitting" );
} else
{
@ -292,11 +294,13 @@ public class ServerConnector extends PacketHandler
user.setDimensionChange( true );
if ( login.getDimension() == user.getDimension() )
{
user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) );
user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(),
false, login.getDeathLocation(), login.getPortalCooldown() ) );
}
user.setServerEntityId( login.getEntityId() );
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation() ) );
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(),
false, login.getDeathLocation(), login.getPortalCooldown() ) );
if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14 )
{
user.unsafe().sendPacket( new ViewDistance( login.getViewDistance() ) );

View File

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

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-query</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-Query</name>

View File

@ -6,13 +6,13 @@
<parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-parent</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-slf4j</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.20-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BungeeCord-SLF4J</name>