mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix for EntityEffect packet
This commit is contained in:
parent
db17babe58
commit
dfc310b3f2
1 changed files with 5 additions and 2 deletions
|
|
@ -1339,7 +1339,9 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
{
|
{
|
||||||
int entityid = dataTypes.ReadNextVarInt(packetData);
|
int entityid = dataTypes.ReadNextVarInt(packetData);
|
||||||
Inventory.Effects effect = Effects.Speed;
|
Inventory.Effects effect = Effects.Speed;
|
||||||
if (Enum.TryParse(dataTypes.ReadNextByte(packetData).ToString(), out effect))
|
int effectId = protocolVersion >= MC_1_18_2_Version ?
|
||||||
|
dataTypes.ReadNextVarInt(packetData) : dataTypes.ReadNextByte(packetData);
|
||||||
|
if (Enum.TryParse(effectId.ToString(), out effect))
|
||||||
{
|
{
|
||||||
int amplifier = dataTypes.ReadNextByte(packetData);
|
int amplifier = dataTypes.ReadNextByte(packetData);
|
||||||
int duration = dataTypes.ReadNextVarInt(packetData);
|
int duration = dataTypes.ReadNextVarInt(packetData);
|
||||||
|
|
@ -1351,7 +1353,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
if (protocolVersion >= MC_1_19_Version)
|
if (protocolVersion >= MC_1_19_Version)
|
||||||
{
|
{
|
||||||
hasFactorData = dataTypes.ReadNextBool(packetData);
|
hasFactorData = dataTypes.ReadNextBool(packetData);
|
||||||
factorCodec = dataTypes.ReadNextNbt(packetData);
|
if (hasFactorData)
|
||||||
|
factorCodec = dataTypes.ReadNextNbt(packetData);
|
||||||
}
|
}
|
||||||
|
|
||||||
handler.OnEntityEffect(entityid, effect, amplifier, duration, flags, hasFactorData, factorCodec);
|
handler.OnEntityEffect(entityid, effect, amplifier, duration, flags, hasFactorData, factorCodec);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue