mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Implemented effects support, as a command, chat notification and added in TUI mode
This commit is contained in:
parent
a7a3566756
commit
f6446b198d
15 changed files with 728 additions and 15 deletions
|
|
@ -2513,11 +2513,12 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
var entityId = dataTypes.ReadNextVarInt(packetData);
|
||||
var effectId = protocolVersion >= MC_1_18_2_Version
|
||||
? dataTypes.ReadNextVarInt(packetData)
|
||||
? dataTypes.ReadNextVarInt(packetData) + 1
|
||||
: dataTypes.ReadNextByte(packetData);
|
||||
|
||||
if (Enum.TryParse(effectId.ToString(), out Effects effect))
|
||||
if (Enum.IsDefined(typeof(Effects), effectId))
|
||||
{
|
||||
var effect = (Effects)effectId;
|
||||
var amplifier = dataTypes.ReadNextByte(packetData);
|
||||
var duration = dataTypes.ReadNextVarInt(packetData);
|
||||
var flags = dataTypes.ReadNextByte(packetData);
|
||||
|
|
@ -2536,6 +2537,22 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case PacketTypesIn.RemoveEntityEffect:
|
||||
if (handler.GetEntityHandlingEnabled())
|
||||
{
|
||||
var entityId = dataTypes.ReadNextVarInt(packetData);
|
||||
var effectId = protocolVersion >= MC_1_18_2_Version
|
||||
? dataTypes.ReadNextVarInt(packetData) + 1
|
||||
: dataTypes.ReadNextByte(packetData);
|
||||
|
||||
if (Enum.IsDefined(typeof(Effects), effectId))
|
||||
{
|
||||
var effect = (Effects)effectId;
|
||||
handler.OnRemoveEntityEffect(entityId, effect);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case PacketTypesIn.DestroyEntities:
|
||||
if (handler.GetEntityHandlingEnabled())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue