Fix Entity effect packet mappings

This commit is contained in:
Shane Freeder 2020-06-24 00:15:55 +01:00
parent d61b93a1e7
commit 52291f00be
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
2 changed files with 32 additions and 30 deletions

View File

@ -1,4 +1,4 @@
From 65d5fb5b4c95876db09106773d3aeb3647422b3a Mon Sep 17 00:00:00 2001
From 81432ed75386d3ab43b6b3caabf661020bf5a7a2 Mon Sep 17 00:00:00 2001
From: Aaron Hill <aa1ronham@gmail.com>
Date: Thu, 15 Sep 2016 22:38:37 +0200
Subject: [PATCH] Fix potion race condition on Forge 1.8.9
@ -33,7 +33,7 @@ index ac31e435..252389bd 100644
+ // Waterfall end
}
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 fa34de48..ecf07c2e 100644
index fa34de48..3214b30d 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
@@ -17,6 +17,8 @@ import net.md_5.bungee.protocol.packet.EncryptionRequest;
@ -45,7 +45,7 @@ index fa34de48..ecf07c2e 100644
import net.md_5.bungee.protocol.packet.Handshake;
import net.md_5.bungee.protocol.packet.KeepAlive;
import net.md_5.bungee.protocol.packet.Kick;
@@ -103,6 +105,29 @@ public enum Protocol
@@ -103,6 +105,31 @@ public enum Protocol
map( ProtocolConstants.MINECRAFT_1_15, 0x0D ),
map( ProtocolConstants.MINECRAFT_1_16, 0x0C )
);
@ -59,7 +59,8 @@ index fa34de48..ecf07c2e 100644
+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x4F),
+ map(ProtocolConstants.MINECRAFT_1_13, 0x53),
+ map(ProtocolConstants.MINECRAFT_1_14, 0x59),
+ map(ProtocolConstants.MINECRAFT_1_15, 0x5A)
+ map(ProtocolConstants.MINECRAFT_1_15, 0x5A),
+ map(ProtocolConstants.MINECRAFT_1_16, 0x59)
+ );
+ TO_CLIENT.registerPacket(
+ EntityRemoveEffect.class,
@ -69,7 +70,8 @@ index fa34de48..ecf07c2e 100644
+ map(ProtocolConstants.MINECRAFT_1_12_1, 0x33),
+ map(ProtocolConstants.MINECRAFT_1_13, 0x36),
+ map(ProtocolConstants.MINECRAFT_1_14, 0x38),
+ map(ProtocolConstants.MINECRAFT_1_15, 0x39)
+ map(ProtocolConstants.MINECRAFT_1_15, 0x39),
+ map(ProtocolConstants.MINECRAFT_1_16, 0x58)
+ );
+ // Waterfall end
TO_CLIENT.registerPacket(

View File

@ -1,11 +1,11 @@
From b5548fda27c9f5bc3f6d9da0bb18085d3b17d118 Mon Sep 17 00:00:00 2001
From e413f0e0f0a2f303075c1ae8d7b5074caa30b96d Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Wed, 17 Apr 2019 09:24:38 +0300
Subject: [PATCH] Speed up packet construction
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 ecf07c2e..9a5a7982 100644
index 3214b30d..bf282cf0 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
@@ -54,6 +54,7 @@ public enum Protocol
@ -64,7 +64,7 @@ index ecf07c2e..9a5a7982 100644
map(ProtocolConstants.MINECRAFT_1_8, 0x1D),
map(ProtocolConstants.MINECRAFT_1_9, 0x4C),
map(ProtocolConstants.MINECRAFT_1_9_4, 0x4B),
@@ -119,6 +126,7 @@ public enum Protocol
@@ -120,6 +127,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
EntityRemoveEffect.class,
@ -72,7 +72,7 @@ index ecf07c2e..9a5a7982 100644
map(ProtocolConstants.MINECRAFT_1_8, 0x1E),
map(ProtocolConstants.MINECRAFT_1_9, 0x31),
map(ProtocolConstants.MINECRAFT_1_12, 0x32),
@@ -130,6 +138,7 @@ public enum Protocol
@@ -132,6 +140,7 @@ public enum Protocol
// Waterfall end
TO_CLIENT.registerPacket(
PlayerListItem.class, // PlayerInfo
@ -80,7 +80,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x38 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x2D ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x2E ),
@@ -140,6 +149,7 @@ public enum Protocol
@@ -142,6 +151,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
TabCompleteResponse.class,
@ -88,7 +88,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x3A ),
map( ProtocolConstants.MINECRAFT_1_9, 0x0E ),
map( ProtocolConstants.MINECRAFT_1_13, 0x10 ),
@@ -148,6 +158,7 @@ public enum Protocol
@@ -150,6 +160,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
ScoreboardObjective.class,
@ -96,7 +96,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x3B ),
map( ProtocolConstants.MINECRAFT_1_9, 0x3F ),
map( ProtocolConstants.MINECRAFT_1_12, 0x41 ),
@@ -158,6 +169,7 @@ public enum Protocol
@@ -160,6 +171,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
ScoreboardScore.class,
@ -104,7 +104,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x3C ),
map( ProtocolConstants.MINECRAFT_1_9, 0x42 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x44 ),
@@ -168,6 +180,7 @@ public enum Protocol
@@ -170,6 +182,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
ScoreboardDisplay.class,
@ -112,7 +112,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x3D ),
map( ProtocolConstants.MINECRAFT_1_9, 0x38 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x3A ),
@@ -178,6 +191,7 @@ public enum Protocol
@@ -180,6 +193,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
Team.class,
@ -120,7 +120,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x3E ),
map( ProtocolConstants.MINECRAFT_1_9, 0x41 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x43 ),
@@ -188,6 +202,7 @@ public enum Protocol
@@ -190,6 +204,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
PluginMessage.class,
@ -128,7 +128,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x3F ),
map( ProtocolConstants.MINECRAFT_1_9, 0x18 ),
map( ProtocolConstants.MINECRAFT_1_13, 0x19 ),
@@ -197,6 +212,7 @@ public enum Protocol
@@ -199,6 +214,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
Kick.class,
@ -136,7 +136,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x40 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x1A ),
map( ProtocolConstants.MINECRAFT_1_13, 0x1B ),
@@ -206,6 +222,7 @@ public enum Protocol
@@ -208,6 +224,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
Title.class,
@ -144,7 +144,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x45 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x47 ),
map( ProtocolConstants.MINECRAFT_1_12_1, 0x48 ),
@@ -216,6 +233,7 @@ public enum Protocol
@@ -218,6 +235,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
PlayerListHeaderFooter.class,
@ -152,7 +152,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x47 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x48 ),
map( ProtocolConstants.MINECRAFT_1_9_4, 0x47 ),
@@ -228,6 +246,7 @@ public enum Protocol
@@ -230,6 +248,7 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
EntityStatus.class,
@ -160,7 +160,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x1A ),
map( ProtocolConstants.MINECRAFT_1_9, 0x1B ),
map( ProtocolConstants.MINECRAFT_1_13, 0x1C ),
@@ -237,17 +256,21 @@ public enum Protocol
@@ -239,17 +258,21 @@ public enum Protocol
);
TO_CLIENT.registerPacket(
Commands.class,
@ -183,7 +183,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_14, 0x41 ),
map( ProtocolConstants.MINECRAFT_1_15, 0x42 ),
map( ProtocolConstants.MINECRAFT_1_16, 0x41 )
@@ -255,6 +278,7 @@ public enum Protocol
@@ -257,6 +280,7 @@ public enum Protocol
TO_SERVER.registerPacket(
KeepAlive.class,
@ -191,7 +191,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x00 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x0B ),
map( ProtocolConstants.MINECRAFT_1_12, 0x0C ),
@@ -265,6 +289,7 @@ public enum Protocol
@@ -267,6 +291,7 @@ public enum Protocol
);
TO_SERVER.registerPacket(
Chat.class,
@ -199,7 +199,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x01 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x02 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x03 ),
@@ -273,6 +298,7 @@ public enum Protocol
@@ -275,6 +300,7 @@ public enum Protocol
);
TO_SERVER.registerPacket(
TabCompleteRequest.class,
@ -207,7 +207,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x14 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x01 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x02 ),
@@ -282,6 +308,7 @@ public enum Protocol
@@ -284,6 +310,7 @@ public enum Protocol
);
TO_SERVER.registerPacket(
ClientSettings.class,
@ -215,7 +215,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x15 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x04 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x05 ),
@@ -290,6 +317,7 @@ public enum Protocol
@@ -292,6 +319,7 @@ public enum Protocol
);
TO_SERVER.registerPacket(
PluginMessage.class,
@ -223,7 +223,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x17 ),
map( ProtocolConstants.MINECRAFT_1_9, 0x09 ),
map( ProtocolConstants.MINECRAFT_1_12, 0x0A ),
@@ -306,19 +334,23 @@ public enum Protocol
@@ -308,19 +336,23 @@ public enum Protocol
{
TO_CLIENT.registerPacket(
StatusResponse.class,
@ -247,7 +247,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_8, 0x01 )
);
}
@@ -330,35 +362,43 @@ public enum Protocol
@@ -332,35 +364,43 @@ public enum Protocol
{
TO_CLIENT.registerPacket(
Kick.class,
@ -291,7 +291,7 @@ index ecf07c2e..9a5a7982 100644
map( ProtocolConstants.MINECRAFT_1_13, 0x02 )
);
}
@@ -409,7 +449,7 @@ public enum Protocol
@@ -411,7 +451,7 @@ public enum Protocol
private final int protocolVersion;
private final TObjectIntMap<Class<? extends DefinedPacket>> packetMap = new TObjectIntHashMap<>( MAX_PACKET_ID );
@ -300,7 +300,7 @@ index ecf07c2e..9a5a7982 100644
}
@Data
@@ -477,21 +517,24 @@ public enum Protocol
@@ -479,21 +519,24 @@ public enum Protocol
throw new BadPacketException( "Packet with id " + id + " outside of range " );
}
@ -329,7 +329,7 @@ index ecf07c2e..9a5a7982 100644
int mappingIndex = 0;
ProtocolMapping mapping = mappings[mappingIndex];
@@ -520,11 +563,32 @@ public enum Protocol
@@ -522,11 +565,32 @@ public enum Protocol
data.packetMap.put( packetClass, mapping.packetID );
data.packetConstructors[mapping.packetID] = constructor;
}