#3602: Minecraft 24w04a support
This commit is contained in:
@@ -8,6 +8,8 @@ import net.md_5.bungee.protocol.packet.ClientCommand;
|
||||
import net.md_5.bungee.protocol.packet.ClientSettings;
|
||||
import net.md_5.bungee.protocol.packet.ClientStatus;
|
||||
import net.md_5.bungee.protocol.packet.Commands;
|
||||
import net.md_5.bungee.protocol.packet.CookieRequest;
|
||||
import net.md_5.bungee.protocol.packet.CookieResponse;
|
||||
import net.md_5.bungee.protocol.packet.EncryptionRequest;
|
||||
import net.md_5.bungee.protocol.packet.EncryptionResponse;
|
||||
import net.md_5.bungee.protocol.packet.EntityStatus;
|
||||
@@ -40,6 +42,7 @@ import net.md_5.bungee.protocol.packet.SetCompression;
|
||||
import net.md_5.bungee.protocol.packet.StartConfiguration;
|
||||
import net.md_5.bungee.protocol.packet.StatusRequest;
|
||||
import net.md_5.bungee.protocol.packet.StatusResponse;
|
||||
import net.md_5.bungee.protocol.packet.StoreCookie;
|
||||
import net.md_5.bungee.protocol.packet.Subtitle;
|
||||
import net.md_5.bungee.protocol.packet.SystemChat;
|
||||
import net.md_5.bungee.protocol.packet.TabCompleteRequest;
|
||||
@@ -47,6 +50,7 @@ import net.md_5.bungee.protocol.packet.TabCompleteResponse;
|
||||
import net.md_5.bungee.protocol.packet.Team;
|
||||
import net.md_5.bungee.protocol.packet.Title;
|
||||
import net.md_5.bungee.protocol.packet.TitleTimes;
|
||||
import net.md_5.bungee.protocol.packet.Transfer;
|
||||
import net.md_5.bungee.protocol.packet.ViewDistance;
|
||||
|
||||
public abstract class AbstractPacketHandler
|
||||
@@ -243,4 +247,20 @@ public abstract class AbstractPacketHandler
|
||||
public void handle(FinishConfiguration finishConfiguration) throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public void handle(Transfer transfer) throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public void handle(StoreCookie storeCookie) throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public void handle(CookieRequest cookieRequest) throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public void handle(CookieResponse cookieResponse) throws Exception
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,8 @@ import net.md_5.bungee.protocol.packet.ClientChat;
|
||||
import net.md_5.bungee.protocol.packet.ClientCommand;
|
||||
import net.md_5.bungee.protocol.packet.ClientSettings;
|
||||
import net.md_5.bungee.protocol.packet.Commands;
|
||||
import net.md_5.bungee.protocol.packet.CookieRequest;
|
||||
import net.md_5.bungee.protocol.packet.CookieResponse;
|
||||
import net.md_5.bungee.protocol.packet.EncryptionRequest;
|
||||
import net.md_5.bungee.protocol.packet.EncryptionResponse;
|
||||
import net.md_5.bungee.protocol.packet.EntityStatus;
|
||||
@@ -46,6 +48,7 @@ import net.md_5.bungee.protocol.packet.SetCompression;
|
||||
import net.md_5.bungee.protocol.packet.StartConfiguration;
|
||||
import net.md_5.bungee.protocol.packet.StatusRequest;
|
||||
import net.md_5.bungee.protocol.packet.StatusResponse;
|
||||
import net.md_5.bungee.protocol.packet.StoreCookie;
|
||||
import net.md_5.bungee.protocol.packet.Subtitle;
|
||||
import net.md_5.bungee.protocol.packet.SystemChat;
|
||||
import net.md_5.bungee.protocol.packet.TabCompleteRequest;
|
||||
@@ -53,6 +56,7 @@ import net.md_5.bungee.protocol.packet.TabCompleteResponse;
|
||||
import net.md_5.bungee.protocol.packet.Team;
|
||||
import net.md_5.bungee.protocol.packet.Title;
|
||||
import net.md_5.bungee.protocol.packet.TitleTimes;
|
||||
import net.md_5.bungee.protocol.packet.Transfer;
|
||||
import net.md_5.bungee.protocol.packet.ViewDistance;
|
||||
|
||||
public enum Protocol
|
||||
@@ -90,7 +94,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x20 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x1F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x23 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x24 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x24 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x25 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Login.class,
|
||||
@@ -106,7 +111,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x25 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x24 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x28 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x29 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x29 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x2A )
|
||||
);
|
||||
TO_CLIENT.registerPacket( Chat.class,
|
||||
Chat::new,
|
||||
@@ -136,7 +142,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x3D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x41 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x43 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x45 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x45 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x46 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
BossBar.class,
|
||||
@@ -195,7 +202,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x54 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x58 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5C )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x5D )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ScoreboardScore.class,
|
||||
@@ -212,12 +220,14 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x57 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5F )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x60 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ScoreboardScoreReset.class,
|
||||
ScoreboardScoreReset::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x42 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x42 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x43 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ScoreboardDisplay.class,
|
||||
@@ -234,7 +244,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x4D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x51 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x53 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x55 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x55 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x56 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Team.class,
|
||||
@@ -251,7 +262,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x56 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5E )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x5E ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x5F )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PluginMessage.class,
|
||||
@@ -268,7 +280,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x16 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x15 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x17 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x18 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x18 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x19 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Kick.class,
|
||||
@@ -285,7 +298,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x19 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x17 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1B )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1C )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Title.class,
|
||||
@@ -303,7 +317,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x5B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x61 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x63 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x63 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x64 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ClearTitles.class,
|
||||
@@ -323,7 +338,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x59 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x5D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x5F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x61 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x61 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x62 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
TitleTimes.class,
|
||||
@@ -334,7 +350,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x5C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x60 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x62 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x64 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x64 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x65 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
SystemChat.class,
|
||||
@@ -344,7 +361,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x60 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x64 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x67 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x69 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x69 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6B )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PlayerListHeaderFooter.class,
|
||||
@@ -365,7 +383,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x61 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x65 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x68 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x6A )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x6A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6C )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
EntityStatus.class,
|
||||
@@ -382,7 +401,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x1A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x19 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1D )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x1D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x1E )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Commands.class,
|
||||
@@ -408,7 +428,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_1, 0x1D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x1C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x1F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x20 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x20 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x21 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ViewDistance.class,
|
||||
@@ -422,7 +443,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x4B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x4F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x51 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x53 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x53 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x61 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
ServerData.class,
|
||||
@@ -432,27 +454,46 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x41 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x45 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x47 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x49 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x49 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x4A )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PlayerListItemRemove.class,
|
||||
PlayerListItemRemove::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x35 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x39 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3B )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3B ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3C )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PlayerListItemUpdate.class,
|
||||
PlayerListItemUpdate::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x36 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x3A ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3C )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x3C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x3D )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
StartConfiguration.class,
|
||||
StartConfiguration::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x65 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x67 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x67 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x68 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
CookieRequest.class,
|
||||
CookieRequest::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x16 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
StoreCookie.class,
|
||||
StoreCookie::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x6A )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Transfer.class,
|
||||
Transfer::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x72 )
|
||||
);
|
||||
|
||||
TO_SERVER.registerPacket(
|
||||
@@ -471,7 +512,8 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x11 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x12 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x14 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x15 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x15 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x16 )
|
||||
);
|
||||
TO_SERVER.registerPacket( Chat.class,
|
||||
Chat::new,
|
||||
@@ -538,13 +580,19 @@ public enum Protocol
|
||||
map( ProtocolConstants.MINECRAFT_1_19_3, 0x0C ),
|
||||
map( ProtocolConstants.MINECRAFT_1_19_4, 0x0D ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x0F ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x10 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_3, 0x10 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x11 )
|
||||
);
|
||||
TO_SERVER.registerPacket(
|
||||
StartConfiguration.class,
|
||||
StartConfiguration::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x0B )
|
||||
);
|
||||
TO_SERVER.registerPacket(
|
||||
CookieResponse.class,
|
||||
CookieResponse::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x10 )
|
||||
);
|
||||
}
|
||||
},
|
||||
// 1
|
||||
@@ -605,6 +653,11 @@ public enum Protocol
|
||||
LoginPayloadRequest::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_13, 0x04 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
CookieRequest.class,
|
||||
CookieRequest::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x05 )
|
||||
);
|
||||
|
||||
TO_SERVER.registerPacket(
|
||||
LoginRequest.class,
|
||||
@@ -626,6 +679,11 @@ public enum Protocol
|
||||
LoginAcknowledged::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x03 )
|
||||
);
|
||||
TO_SERVER.registerPacket(
|
||||
CookieResponse.class,
|
||||
CookieResponse::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x04 )
|
||||
);
|
||||
}
|
||||
},
|
||||
// 3
|
||||
@@ -633,25 +691,45 @@ public enum Protocol
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
TO_CLIENT.registerPacket(
|
||||
CookieRequest.class,
|
||||
CookieRequest::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x00 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
PluginMessage.class,
|
||||
PluginMessage::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x00 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x00 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x01 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Kick.class,
|
||||
Kick::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x01 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x01 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x02 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
FinishConfiguration.class,
|
||||
FinishConfiguration::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x02 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x02 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x03 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
KeepAlive.class,
|
||||
KeepAlive::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x03 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x03 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x04 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
StoreCookie.class,
|
||||
StoreCookie::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x09 )
|
||||
);
|
||||
TO_CLIENT.registerPacket(
|
||||
Transfer.class,
|
||||
Transfer::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x0A )
|
||||
);
|
||||
|
||||
TO_SERVER.registerPacket(
|
||||
@@ -662,17 +740,20 @@ public enum Protocol
|
||||
TO_SERVER.registerPacket(
|
||||
PluginMessage.class,
|
||||
PluginMessage::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x01 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x01 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x02 )
|
||||
);
|
||||
TO_SERVER.registerPacket(
|
||||
FinishConfiguration.class,
|
||||
FinishConfiguration::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x02 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x02 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x03 )
|
||||
);
|
||||
TO_SERVER.registerPacket(
|
||||
KeepAlive.class,
|
||||
KeepAlive::new,
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x03 )
|
||||
map( ProtocolConstants.MINECRAFT_1_20_2, 0x03 ),
|
||||
map( ProtocolConstants.MINECRAFT_1_20_5, 0x04 )
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@@ -45,6 +45,7 @@ public class ProtocolConstants
|
||||
public static final int MINECRAFT_1_20 = 763;
|
||||
public static final int MINECRAFT_1_20_2 = 764;
|
||||
public static final int MINECRAFT_1_20_3 = 765;
|
||||
public static final int MINECRAFT_1_20_5 = 1073741997;
|
||||
public static final List<String> SUPPORTED_VERSIONS;
|
||||
public static final List<Integer> SUPPORTED_VERSION_IDS;
|
||||
|
||||
@@ -109,7 +110,7 @@ public class ProtocolConstants
|
||||
if ( SNAPSHOT_SUPPORT )
|
||||
{
|
||||
// supportedVersions.add( "1.20.x" );
|
||||
// supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_20_3 );
|
||||
supportedVersionIds.add( ProtocolConstants.MINECRAFT_1_20_5 );
|
||||
}
|
||||
|
||||
SUPPORTED_VERSIONS = supportedVersions.build();
|
||||
|
@@ -0,0 +1,38 @@
|
||||
package net.md_5.bungee.protocol.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||
import net.md_5.bungee.protocol.DefinedPacket;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CookieRequest extends DefinedPacket
|
||||
{
|
||||
|
||||
private String cookie;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
cookie = readString( buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( cookie, buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(AbstractPacketHandler handler) throws Exception
|
||||
{
|
||||
handler.handle( this );
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package net.md_5.bungee.protocol.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||
import net.md_5.bungee.protocol.DefinedPacket;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CookieResponse extends DefinedPacket
|
||||
{
|
||||
|
||||
private String cookie;
|
||||
private byte[] data;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
cookie = readString( buf );
|
||||
data = readNullable( DefinedPacket::readArray, buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( cookie, buf );
|
||||
writeNullable( data, DefinedPacket::writeArray, buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(AbstractPacketHandler handler) throws Exception
|
||||
{
|
||||
handler.handle( this );
|
||||
}
|
||||
}
|
@@ -19,6 +19,7 @@ public class EncryptionRequest extends DefinedPacket
|
||||
private String serverId;
|
||||
private byte[] publicKey;
|
||||
private byte[] verifyToken;
|
||||
private boolean shouldAuthenticate;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
@@ -26,6 +27,10 @@ public class EncryptionRequest extends DefinedPacket
|
||||
serverId = readString( buf );
|
||||
publicKey = readArray( buf );
|
||||
verifyToken = readArray( buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )
|
||||
{
|
||||
shouldAuthenticate = buf.readBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,6 +39,10 @@ public class EncryptionRequest extends DefinedPacket
|
||||
writeString( serverId, buf );
|
||||
writeArray( publicKey, buf );
|
||||
writeArray( verifyToken, buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )
|
||||
{
|
||||
buf.writeBoolean( shouldAuthenticate );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -41,6 +41,7 @@ public class Login extends DefinedPacket
|
||||
private boolean flat;
|
||||
private Location deathLocation;
|
||||
private int portalCooldown;
|
||||
private boolean secureProfile;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
@@ -154,6 +155,11 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
portalCooldown = readVarInt( buf );
|
||||
}
|
||||
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )
|
||||
{
|
||||
secureProfile = buf.readBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,6 +281,11 @@ public class Login extends DefinedPacket
|
||||
{
|
||||
writeVarInt( portalCooldown, buf );
|
||||
}
|
||||
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )
|
||||
{
|
||||
buf.writeBoolean( secureProfile );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -33,7 +33,7 @@ public class ServerData extends DefinedPacket
|
||||
{
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||
{
|
||||
icon = DefinedPacket.readArray( buf );
|
||||
icon = readArray( buf );
|
||||
} else
|
||||
{
|
||||
icon = readString( buf );
|
||||
@@ -45,7 +45,7 @@ public class ServerData extends DefinedPacket
|
||||
preview = buf.readBoolean();
|
||||
}
|
||||
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 && protocolVersion < ProtocolConstants.MINECRAFT_1_20_5 )
|
||||
{
|
||||
enforceSecure = buf.readBoolean();
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class ServerData extends DefinedPacket
|
||||
buf.writeBoolean( true );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_4 )
|
||||
{
|
||||
DefinedPacket.writeArray( (byte[]) icon, buf );
|
||||
writeArray( (byte[]) icon, buf );
|
||||
} else
|
||||
{
|
||||
writeString( (String) icon, buf );
|
||||
@@ -91,7 +91,7 @@ public class ServerData extends DefinedPacket
|
||||
buf.writeBoolean( preview );
|
||||
}
|
||||
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_19_1 && protocolVersion < ProtocolConstants.MINECRAFT_1_20_5 )
|
||||
{
|
||||
buf.writeBoolean( enforceSecure );
|
||||
}
|
||||
|
@@ -0,0 +1,41 @@
|
||||
package net.md_5.bungee.protocol.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||
import net.md_5.bungee.protocol.DefinedPacket;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class StoreCookie extends DefinedPacket
|
||||
{
|
||||
|
||||
private String key;
|
||||
private byte[] data;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
key = readString( buf );
|
||||
data = readArray( buf, 5120 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( key, buf );
|
||||
writeArray( data, buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(AbstractPacketHandler handler) throws Exception
|
||||
{
|
||||
handler.handle( this );
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package net.md_5.bungee.protocol.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||
import net.md_5.bungee.protocol.DefinedPacket;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class Transfer extends DefinedPacket
|
||||
{
|
||||
|
||||
private String host;
|
||||
private int port;
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
host = readString( buf );
|
||||
port = readVarInt( buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( host, buf );
|
||||
writeVarInt( port, buf );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(AbstractPacketHandler handler) throws Exception
|
||||
{
|
||||
handler.handle( this );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user