Merge pull request #1119 from creeper123123321/master

Fix breaking change caused by VelocityPowered/Velocity@853fd22
This commit is contained in:
Myles 2018-12-13 10:03:45 +00:00 committed by GitHub
commit 94422dab77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,8 @@ public class VelocityVersionProvider extends VersionProvider {
public int getServerProtocol(UserConnection user) throws Exception {
// TODO Have one constant list forever until restart? (Might limit plugins if they change this)
List<Integer> sorted = new ArrayList<>(com.velocitypowered.api.network.ProtocolVersion.ID_TO_PROTOCOL_CONSTANT.keySet());
sorted.remove(Integer.valueOf(-1)); // Unknown/legacy
sorted.remove(Integer.valueOf(-1)); // Unknown
sorted.remove(Integer.valueOf(-2)); // Legacy
Collections.sort(sorted);
int playerVersion = user.get(ProtocolInfo.class).getProtocolVersion();