diff --git a/api/pom.xml b/api/pom.xml
index 5432a6eb..79d2d367 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-api
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-API
diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml
index b3bcb6c1..96c4a83a 100644
--- a/bootstrap/pom.xml
+++ b/bootstrap/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-bootstrap
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Bootstrap
diff --git a/chat/pom.xml b/chat/pom.xml
index 99b089cb..5f87b60d 100644
--- a/chat/pom.xml
+++ b/chat/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-chat
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Chat
diff --git a/config/pom.xml b/config/pom.xml
index 44005b6f..24b6ce1c 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-config
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Config
diff --git a/event/pom.xml b/event/pom.xml
index 93c4aa39..2de6603c 100644
--- a/event/pom.xml
+++ b/event/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-event
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Event
diff --git a/log/pom.xml b/log/pom.xml
index 87b839ad..05c5f2c9 100644
--- a/log/pom.xml
+++ b/log/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-log
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Log
diff --git a/module/cmd-alert/pom.xml b/module/cmd-alert/pom.xml
index 44d5b21e..1c4f643f 100644
--- a/module/cmd-alert/pom.xml
+++ b/module/cmd-alert/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module-cmd-alert
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
cmd_alert
diff --git a/module/cmd-find/pom.xml b/module/cmd-find/pom.xml
index e320447a..3e43c9ae 100644
--- a/module/cmd-find/pom.xml
+++ b/module/cmd-find/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module-cmd-find
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
cmd_find
diff --git a/module/cmd-list/pom.xml b/module/cmd-list/pom.xml
index 230af0cc..99d6da26 100644
--- a/module/cmd-list/pom.xml
+++ b/module/cmd-list/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module-cmd-list
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
cmd_list
diff --git a/module/cmd-send/pom.xml b/module/cmd-send/pom.xml
index 23f9a02b..4472f373 100644
--- a/module/cmd-send/pom.xml
+++ b/module/cmd-send/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module-cmd-send
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
cmd_send
diff --git a/module/cmd-server/pom.xml b/module/cmd-server/pom.xml
index 0731bd8e..9be58576 100644
--- a/module/cmd-server/pom.xml
+++ b/module/cmd-server/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module-cmd-server
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
cmd_server
diff --git a/module/pom.xml b/module/pom.xml
index 107cb0ef..5255b34f 100644
--- a/module/pom.xml
+++ b/module/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
pom
BungeeCord Modules
diff --git a/module/reconnect-yaml/pom.xml b/module/reconnect-yaml/pom.xml
index 809cf79c..c68041d3 100644
--- a/module/reconnect-yaml/pom.xml
+++ b/module/reconnect-yaml/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-module
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-module-reconnect-yaml
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
reconnect_yaml
diff --git a/native/pom.xml b/native/pom.xml
index 15c0ada2..959aae03 100644
--- a/native/pom.xml
+++ b/native/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-native
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Native
diff --git a/pom.xml b/pom.xml
index 6cd54c2d..ef9fc1b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
pom
BungeeCord-Parent
diff --git a/protocol/pom.xml b/protocol/pom.xml
index ec0240a4..61fedc71 100644
--- a/protocol/pom.xml
+++ b/protocol/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-protocol
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Protocol
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
index 98be98e8..564c8800 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
@@ -63,7 +63,8 @@ public enum Protocol
KeepAlive.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x00 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x1F ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x21 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x21 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x20 )
);
TO_CLIENT.registerPacket(
Login.class,
@@ -83,7 +84,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x33 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x34 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x35 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x38 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x38 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x3A )
);
TO_CLIENT.registerPacket(
BossBar.class,
@@ -94,7 +96,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_8, 0x38 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x2D ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x30 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x30 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x33 )
);
TO_CLIENT.registerPacket(
TabCompleteResponse.class,
@@ -108,7 +111,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x3F ),
map( ProtocolConstants.MINECRAFT_1_12, 0x41 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x42 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x45 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x45 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x49 )
);
TO_CLIENT.registerPacket(
ScoreboardScore.class,
@@ -116,7 +120,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x42 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x44 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x45 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x48 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x48 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x4C )
);
TO_CLIENT.registerPacket(
ScoreboardDisplay.class,
@@ -124,7 +129,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x38 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x3A ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x3B ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x3E )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x3E ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x42 )
);
TO_CLIENT.registerPacket(
Team.class,
@@ -132,26 +138,30 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x41 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x43 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x44 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x47 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x47 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x4B )
);
TO_CLIENT.registerPacket(
PluginMessage.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x3F ),
map( ProtocolConstants.MINECRAFT_1_9, 0x18 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x19 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x19 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x18 )
);
TO_CLIENT.registerPacket(
Kick.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x40 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x1A ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x1B )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x1B ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x1A )
);
TO_CLIENT.registerPacket(
Title.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x45 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x47 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x4B )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x4B ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x4F )
);
TO_CLIENT.registerPacket(
PlayerListHeaderFooter.class,
@@ -160,13 +170,15 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x49 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x4A ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x4E )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x4E ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x53 )
);
TO_CLIENT.registerPacket(
EntityStatus.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x1A ),
map( ProtocolConstants.MINECRAFT_1_9, 0x1B ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x1C )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x1C ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x1B )
);
TO_CLIENT.registerPacket(
Commands.class,
@@ -179,14 +191,16 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x0B ),
map( ProtocolConstants.MINECRAFT_1_12, 0x0C ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x0B ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x0E )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x0E ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x0F )
);
TO_SERVER.registerPacket(
Chat.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x01 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x02 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x03 ),
- map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 )
+ map( ProtocolConstants.MINECRAFT_1_12_1, 0x02 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x03 )
);
TO_SERVER.registerPacket(
TabCompleteRequest.class,
@@ -194,14 +208,16 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x01 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x02 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x01 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x05 )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x05 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x06 )
);
TO_SERVER.registerPacket(
ClientSettings.class,
map( ProtocolConstants.MINECRAFT_1_8, 0x15 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x04 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x05 ),
- map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 )
+ map( ProtocolConstants.MINECRAFT_1_12_1, 0x04 ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x05 )
);
TO_SERVER.registerPacket(
PluginMessage.class,
@@ -209,7 +225,8 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_9, 0x09 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x0A ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x09 ),
- map( ProtocolConstants.MINECRAFT_1_13, 0x0A )
+ map( ProtocolConstants.MINECRAFT_1_13, 0x0A ),
+ map( ProtocolConstants.MINECRAFT_1_14, 0x0B )
);
}
},
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
index 09c2bebf..b3037a9c 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
@@ -20,13 +20,15 @@ public class ProtocolConstants
public static final int MINECRAFT_1_13 = 393;
public static final int MINECRAFT_1_13_1 = 401;
public static final int MINECRAFT_1_13_2 = 404;
+ public static final int MINECRAFT_1_14 = 476;
public static final List SUPPORTED_VERSIONS = Arrays.asList(
"1.8.x",
"1.9.x",
"1.10.x",
"1.11.x",
"1.12.x",
- "1.13.x"
+ "1.13.x",
+ "1.14.x"
);
public static final List SUPPORTED_VERSION_IDS = Arrays.asList(
ProtocolConstants.MINECRAFT_1_8,
@@ -42,7 +44,8 @@ public class ProtocolConstants
ProtocolConstants.MINECRAFT_1_12_2,
ProtocolConstants.MINECRAFT_1_13,
ProtocolConstants.MINECRAFT_1_13_1,
- ProtocolConstants.MINECRAFT_1_13_2
+ ProtocolConstants.MINECRAFT_1_13_2,
+ ProtocolConstants.MINECRAFT_1_14
);
public enum Direction
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java
index 80485a4d..be033450 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Commands.java
@@ -492,7 +492,9 @@ public class Commands extends DefinedPacket
PROVIDERS.put( "minecraft:color", VOID );
PROVIDERS.put( "minecraft:component", VOID );
PROVIDERS.put( "minecraft:message", VOID );
- PROVIDERS.put( "minecraft:nbt", VOID );
+ PROVIDERS.put( "minecraft:nbt_compound_tag", VOID ); // 1.14
+ PROVIDERS.put( "minecraft:nbt_tag", VOID ); // 1.14
+ PROVIDERS.put( "minecraft:nbt", VOID ); // 1.13
PROVIDERS.put( "minecraft:nbt_path", VOID );
PROVIDERS.put( "minecraft:objective", VOID );
PROVIDERS.put( "minecraft:objective_criteria", VOID );
@@ -513,6 +515,7 @@ public class Commands extends DefinedPacket
PROVIDERS.put( "minecraft:item_enchantment", VOID );
PROVIDERS.put( "minecraft:entity_summon", VOID );
PROVIDERS.put( "minecraft:dimension", VOID );
+ PROVIDERS.put( "minecraft:time", VOID ); // 1.14
}
private static ArgumentType> read(String key, ByteBuf buf)
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java
index 2e3915ce..47c338ab 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java
@@ -22,6 +22,7 @@ public class Login extends DefinedPacket
private short difficulty;
private short maxPlayers;
private String levelType;
+ private int viewDistance;
private boolean reducedDebugInfo;
@Override
@@ -36,9 +37,16 @@ public class Login extends DefinedPacket
{
dimension = buf.readByte();
}
- difficulty = buf.readUnsignedByte();
+ if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
+ {
+ difficulty = buf.readUnsignedByte();
+ }
maxPlayers = buf.readUnsignedByte();
levelType = readString( buf );
+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_14 )
+ {
+ viewDistance = readVarInt( buf );
+ }
if ( protocolVersion >= 29 )
{
reducedDebugInfo = buf.readBoolean();
@@ -57,9 +65,16 @@ public class Login extends DefinedPacket
{
buf.writeByte( dimension );
}
- buf.writeByte( difficulty );
+ if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
+ {
+ buf.writeByte( difficulty );
+ }
buf.writeByte( maxPlayers );
writeString( levelType, buf );
+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_14 )
+ {
+ writeVarInt( viewDistance, buf );
+ }
if ( protocolVersion >= 29 )
{
buf.writeBoolean( reducedDebugInfo );
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java
index d0a7529e..3b79fe9b 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java
@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.md_5.bungee.protocol.AbstractPacketHandler;
+import net.md_5.bungee.protocol.ProtocolConstants;
@Data
@NoArgsConstructor
@@ -21,19 +22,25 @@ public class Respawn extends DefinedPacket
private String levelType;
@Override
- public void read(ByteBuf buf)
+ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
dimension = buf.readInt();
- difficulty = buf.readUnsignedByte();
+ if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
+ {
+ difficulty = buf.readUnsignedByte();
+ }
gameMode = buf.readUnsignedByte();
levelType = readString( buf );
}
@Override
- public void write(ByteBuf buf)
+ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
buf.writeInt( dimension );
- buf.writeByte( difficulty );
+ if ( protocolVersion < ProtocolConstants.MINECRAFT_1_14 )
+ {
+ buf.writeByte( difficulty );
+ }
buf.writeByte( gameMode );
writeString( levelType, buf );
}
diff --git a/proxy/pom.xml b/proxy/pom.xml
index af3536bc..50fb11be 100644
--- a/proxy/pom.xml
+++ b/proxy/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-proxy
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Proxy
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
index 177b7389..fb2d9e27 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -210,7 +210,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.getGameMode(), (byte) login.getDimension(), login.getDifficulty(),
- (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.isReducedDebugInfo() );
+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.isReducedDebugInfo() );
user.unsafe().sendPacket( modLogin );
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 3d4208a8..fda93018 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -433,13 +433,13 @@ public final class UserConnection implements ProxiedPlayer
@Override
public void sendMessage(BaseComponent... message)
{
- sendMessage( ChatMessageType.CHAT, message );
+ sendMessage( ChatMessageType.SYSTEM, message );
}
@Override
public void sendMessage(BaseComponent message)
{
- sendMessage( ChatMessageType.CHAT, message );
+ sendMessage( ChatMessageType.SYSTEM, message );
}
private void sendMessage(ChatMessageType position, String message)
diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java
index 1ecee69e..398cd6dd 100644
--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java
+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java
@@ -51,6 +51,8 @@ public abstract class EntityMap
case ProtocolConstants.MINECRAFT_1_13_1:
case ProtocolConstants.MINECRAFT_1_13_2:
return EntityMap_1_13.INSTANCE;
+ case ProtocolConstants.MINECRAFT_1_14:
+ return EntityMap_1_14.INSTANCE;
}
throw new RuntimeException( "Version " + version + " has no entity map" );
}
@@ -149,18 +151,37 @@ public abstract class EntityMap
continue;
case 15: // particle
int particleId = DefinedPacket.readVarInt( packet );
- switch ( particleId )
+
+ if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_14 )
{
- case 3:
- case 20:
- DefinedPacket.readVarInt( packet ); // block state
- break;
- case 11: // dust
- packet.skipBytes( 16 ); // float, float, float, flat
- break;
- case 27: // item
- readSkipSlot( packet, protocolVersion );
- break;
+ switch ( particleId )
+ {
+ case 3: // minecraft:block
+ case 23: // minecraft:falling_dust
+ DefinedPacket.readVarInt( packet ); // block state
+ break;
+ case 14: // minecraft:dust
+ packet.skipBytes( 16 ); // float, float, float, flat
+ break;
+ case 32: // minecraft:item
+ readSkipSlot( packet, protocolVersion );
+ break;
+ }
+ } else
+ {
+ switch ( particleId )
+ {
+ case 3: // minecraft:block
+ case 20: // minecraft:falling_dust
+ DefinedPacket.readVarInt( packet ); // block state
+ break;
+ case 11: // minecraft:dust
+ packet.skipBytes( 16 ); // float, float, float, flat
+ break;
+ case 27: // minecraft:item
+ readSkipSlot( packet, protocolVersion );
+ break;
+ }
}
continue;
default:
@@ -232,6 +253,23 @@ public abstract class EntityMap
throw Throwables.propagate( ex );
}
break;
+ case 15:
+ DefinedPacket.readVarInt( packet );
+ DefinedPacket.readVarInt( packet );
+ DefinedPacket.readVarInt( packet );
+ break;
+ case 16:
+ if ( index == metaIndex )
+ {
+ int position = packet.readerIndex();
+ rewriteVarInt( packet, oldId + 1, newId + 1, position );
+ packet.readerIndex( position );
+ }
+ DefinedPacket.readVarInt( packet );
+ break;
+ case 17:
+ DefinedPacket.readVarInt( packet );
+ break;
default:
throw new IllegalArgumentException( "Unknown meta type " + type );
}
diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java
new file mode 100644
index 00000000..40d26b89
--- /dev/null
+++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_14.java
@@ -0,0 +1,187 @@
+package net.md_5.bungee.entitymap;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import io.netty.buffer.ByteBuf;
+import net.md_5.bungee.BungeeCord;
+import net.md_5.bungee.UserConnection;
+import net.md_5.bungee.api.connection.ProxiedPlayer;
+import net.md_5.bungee.protocol.DefinedPacket;
+import net.md_5.bungee.protocol.ProtocolConstants;
+
+import java.util.UUID;
+
+class EntityMap_1_14 extends EntityMap
+{
+
+ static final EntityMap_1_14 INSTANCE = new EntityMap_1_14();
+
+ EntityMap_1_14()
+ {
+ addRewrite( 0x00, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Object : PacketPlayOutSpawnEntity
+ addRewrite( 0x01, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Experience Orb : PacketPlayOutSpawnEntityExperienceOrb
+ addRewrite( 0x03, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Mob : PacketPlayOutSpawnEntityLiving
+ addRewrite( 0x04, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Painting : PacketPlayOutSpawnEntityPainting
+ addRewrite( 0x05, ProtocolConstants.Direction.TO_CLIENT, true ); // Spawn Player : PacketPlayOutNamedEntitySpawn
+ addRewrite( 0x06, ProtocolConstants.Direction.TO_CLIENT, true ); // Animation : PacketPlayOutAnimation
+ addRewrite( 0x08, ProtocolConstants.Direction.TO_CLIENT, true ); // Block Break Animation : PacketPlayOutBlockBreakAnimation
+ addRewrite( 0x1B, ProtocolConstants.Direction.TO_CLIENT, false ); // Entity Status : PacketPlayOutEntityStatus
+ addRewrite( 0x28, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Relative Move : PacketPlayOutRelEntityMove
+ addRewrite( 0x29, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look and Relative Move : PacketPlayOutRelEntityMoveLook
+ addRewrite( 0x2A, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Look : PacketPlayOutEntityLook
+ addRewrite( 0x2B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity : PacketPlayOutEntity
+ addRewrite( 0x38, ProtocolConstants.Direction.TO_CLIENT, true ); // Remove Entity Effect : PacketPlayOutRemoveEntityEffect
+ addRewrite( 0x3B, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Head Look : PacketPlayOutEntityHeadRotation
+ addRewrite( 0x3E, ProtocolConstants.Direction.TO_CLIENT, true ); // Camera : PacketPlayOutCamera
+ addRewrite( 0x43, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Metadata : PacketPlayOutEntityMetadata
+ addRewrite( 0x44, ProtocolConstants.Direction.TO_CLIENT, false ); // Attach Entity : PacketPlayOutAttachEntity
+ addRewrite( 0x45, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Velocity : PacketPlayOutEntityVelocity
+ addRewrite( 0x46, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Equipment : PacketPlayOutEntityEquipment
+ addRewrite( 0x4A, ProtocolConstants.Direction.TO_CLIENT, true ); // Set Passengers : PacketPlayOutMount
+ addRewrite( 0x55, ProtocolConstants.Direction.TO_CLIENT, true ); // Collect Item : PacketPlayOutCollect
+ addRewrite( 0x56, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Teleport : PacketPlayOutEntityTeleport
+ addRewrite( 0x58, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Properties : PacketPlayOutUpdateAttributes
+ addRewrite( 0x59, ProtocolConstants.Direction.TO_CLIENT, true ); // Entity Effect : PacketPlayOutEntityEffect
+
+ addRewrite( 0x0E, ProtocolConstants.Direction.TO_SERVER, true ); // Use Entity : PacketPlayInUseEntity
+ addRewrite( 0x1B, ProtocolConstants.Direction.TO_SERVER, true ); // Entity Action : PacketPlayInEntityAction
+ }
+
+ @Override
+ @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE")
+ public void rewriteClientbound(ByteBuf packet, int oldId, int newId, int protocolVersion)
+ {
+ super.rewriteClientbound( packet, oldId, newId );
+
+ // Special cases
+ int readerIndex = packet.readerIndex();
+ int packetId = DefinedPacket.readVarInt( packet );
+ int packetIdLength = packet.readerIndex() - readerIndex;
+ int jumpIndex = packet.readerIndex();
+ switch ( packetId )
+ {
+ case 0x44 /* Attach Entity : PacketPlayOutAttachEntity */:
+ rewriteInt( packet, oldId, newId, readerIndex + packetIdLength + 4 );
+ break;
+ case 0x55 /* Collect Item : PacketPlayOutCollect */:
+ DefinedPacket.readVarInt( packet );
+ rewriteVarInt( packet, oldId, newId, packet.readerIndex() );
+ break;
+ case 0x4A /* Set Passengers : PacketPlayOutMount */:
+ DefinedPacket.readVarInt( packet );
+ jumpIndex = packet.readerIndex();
+ // Fall through on purpose to int array of IDs
+ case 0x37 /* Destroy Entities : PacketPlayOutEntityDestroy */:
+ int count = DefinedPacket.readVarInt( packet );
+ int[] ids = new int[ count ];
+ for ( int i = 0; i < count; i++ )
+ {
+ ids[i] = DefinedPacket.readVarInt( packet );
+ }
+ packet.readerIndex( jumpIndex );
+ packet.writerIndex( jumpIndex );
+ DefinedPacket.writeVarInt( count, packet );
+ for ( int id : ids )
+ {
+ if ( id == oldId )
+ {
+ id = newId;
+ } else if ( id == newId )
+ {
+ id = oldId;
+ }
+ DefinedPacket.writeVarInt( id, packet );
+ }
+ break;
+ case 0x00 /* Spawn Object : PacketPlayOutSpawnEntity */:
+ DefinedPacket.readVarInt( packet );
+ DefinedPacket.readUUID( packet );
+ int type = packet.readUnsignedByte();
+
+ if ( type == 60 || type == 90 || type == 91 )
+ {
+ if ( type == 60 || type == 91 )
+ {
+ oldId = oldId + 1;
+ newId = newId + 1;
+ }
+
+ packet.skipBytes( 26 ); // double, double, double, byte, byte
+ int position = packet.readerIndex();
+ int readId = packet.readInt();
+ if ( readId == oldId )
+ {
+ packet.setInt( position, newId );
+ } else if ( readId == newId )
+ {
+ packet.setInt( position, oldId );
+ }
+ }
+ break;
+ case 0x05 /* Spawn Player : PacketPlayOutNamedEntitySpawn */:
+ DefinedPacket.readVarInt( packet ); // Entity ID
+ int idLength = packet.readerIndex() - readerIndex - packetIdLength;
+ UUID uuid = DefinedPacket.readUUID( packet );
+ ProxiedPlayer player;
+ if ( ( player = BungeeCord.getInstance().getPlayerByOfflineUUID( uuid ) ) != null )
+ {
+ int previous = packet.writerIndex();
+ packet.readerIndex( readerIndex );
+ packet.writerIndex( readerIndex + packetIdLength + idLength );
+ DefinedPacket.writeUUID( player.getUniqueId(), packet );
+ packet.writerIndex( previous );
+ }
+ break;
+ case 0x32 /* Combat Event : PacketPlayOutCombatEvent */:
+ int event = packet.readUnsignedByte();
+ if ( event == 1 /* End Combat*/ )
+ {
+ DefinedPacket.readVarInt( packet );
+ rewriteInt( packet, oldId, newId, packet.readerIndex() );
+ } else if ( event == 2 /* Entity Dead */ )
+ {
+ int position = packet.readerIndex();
+ rewriteVarInt( packet, oldId, newId, packet.readerIndex() );
+ packet.readerIndex( position );
+ DefinedPacket.readVarInt( packet );
+ rewriteInt( packet, oldId, newId, packet.readerIndex() );
+ }
+ break;
+ case 0x43 /* EntityMetadata : PacketPlayOutEntityMetadata */:
+ DefinedPacket.readVarInt( packet ); // Entity ID
+ rewriteMetaVarInt( packet, oldId + 1, newId + 1, 7, protocolVersion ); // fishing hook
+ rewriteMetaVarInt( packet, oldId, newId, 8, protocolVersion ); // fireworks (et al)
+ break;
+ case 0x50 /* Entity Sound Effect : PacketPlayOutEntitySound */:
+ DefinedPacket.readVarInt( packet );
+ DefinedPacket.readVarInt( packet );
+ rewriteVarInt( packet, oldId, newId, packet.readerIndex() );
+ break;
+ }
+ packet.readerIndex( readerIndex );
+ }
+
+ @Override
+ public void rewriteServerbound(ByteBuf packet, int oldId, int newId)
+ {
+ super.rewriteServerbound( packet, oldId, newId );
+ // Special cases
+ int readerIndex = packet.readerIndex();
+ int packetId = DefinedPacket.readVarInt( packet );
+ int packetIdLength = packet.readerIndex() - readerIndex;
+
+ if ( packetId == 0x2B /* Spectate : PacketPlayInSpectate */ && !BungeeCord.getInstance().getConfig().isIpForward() )
+ {
+ UUID uuid = DefinedPacket.readUUID( packet );
+ ProxiedPlayer player;
+ if ( ( player = BungeeCord.getInstance().getPlayer( uuid ) ) != null )
+ {
+ int previous = packet.writerIndex();
+ packet.readerIndex( readerIndex );
+ packet.writerIndex( readerIndex + packetIdLength );
+ DefinedPacket.writeUUID( ( (UserConnection) player ).getPendingConnection().getOfflineId(), packet );
+ packet.writerIndex( previous );
+ }
+ }
+ packet.readerIndex( readerIndex );
+ }
+}
diff --git a/query/pom.xml b/query/pom.xml
index fdd44b20..9cc2f80b 100644
--- a/query/pom.xml
+++ b/query/pom.xml
@@ -6,13 +6,13 @@
net.md-5
bungeecord-parent
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
../pom.xml
net.md-5
bungeecord-query
- 1.13-SNAPSHOT
+ 1.14-SNAPSHOT
jar
BungeeCord-Query