mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed incorrect handling in 1.18(1.18.1) and 1.18.2
This commit is contained in:
parent
3429989527
commit
59ed18bb40
5 changed files with 15 additions and 7 deletions
|
|
@ -327,7 +327,7 @@ namespace MinecraftClient
|
|||
/// <param name="action">0 to create/update an item. 1 to remove an item.</param>
|
||||
/// <param name="objectivename">The name of the objective the score belongs to</param>
|
||||
/// <param name="value">The score to be displayed next to the entry. Only sent when Action does not equal 1.</param>
|
||||
public virtual void OnUpdateScore(string entityname, byte action, string objectivename, int value) { }
|
||||
public virtual void OnUpdateScore(string entityname, int action, string objectivename, int value) { }
|
||||
|
||||
/// <summary>
|
||||
/// Called when an inventory/container was updated by server
|
||||
|
|
|
|||
|
|
@ -2490,7 +2490,7 @@ namespace MinecraftClient
|
|||
/// <param name="action">0 to create/update an item. 1 to remove an item.</param>
|
||||
/// <param name="objectivename">The name of the objective the score belongs to</param>
|
||||
/// <param name="value">he score to be displayed next to the entry. Only sent when Action does not equal 1.</param>
|
||||
public void OnUpdateScore(string entityname, byte action, string objectivename, int value)
|
||||
public void OnUpdateScore(string entityname, int action, string objectivename, int value)
|
||||
{
|
||||
DispatchBotEvent(bot => bot.OnUpdateScore(entityname, action, objectivename, value));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,6 +410,9 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
|
||||
if (living)
|
||||
{
|
||||
if (protocolversion >= Protocol18Handler.MC1182Version)
|
||||
entityYaw = ReadNextByte(cache);
|
||||
else
|
||||
entityPitch = ReadNextByte(cache);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1208,7 +1208,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
break;
|
||||
case PacketTypesIn.UpdateScore:
|
||||
string entityname = dataTypes.ReadNextString(packetData);
|
||||
byte action3 = dataTypes.ReadNextByte(packetData);
|
||||
int action3 = protocolversion >= MC1182Version ? dataTypes.ReadNextVarInt(packetData) : dataTypes.ReadNextByte(packetData);
|
||||
string objectivename2 = null;
|
||||
int value = -1;
|
||||
if (action3 != 1 || protocolversion >= MC18Version)
|
||||
|
|
@ -1713,7 +1713,12 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
if (protocolversion >= MC19Version)
|
||||
fields.AddRange(dataTypes.GetVarInt(mainHand));
|
||||
if (protocolversion >= MC117Version)
|
||||
fields.Add(1); // 1.17 and above - Disable text filtering. (Always true)
|
||||
{
|
||||
if (protocolversion == MC117Version || protocolversion == MC1171Version)
|
||||
fields.Add(1); // 1.17 and 1.17.1 - Disable text filtering. (Always true)
|
||||
else
|
||||
fields.Add(0); // 1.18 and above - Enable text filtering. (Always false)
|
||||
}
|
||||
if (protocolversion >= MC1181Version)
|
||||
fields.Add(1); // 1.18 and above - Allow server listings
|
||||
SendPacket(PacketTypesOut.ClientSettings, fields);
|
||||
|
|
@ -2040,7 +2045,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
packet.AddRange(arrayOfSlots);
|
||||
}
|
||||
|
||||
packet.AddRange(dataTypes.GetItemSlot(item, itemPalette)); // Clicked item
|
||||
packet.AddRange(dataTypes.GetItemSlot(item, itemPalette)); // Carried item (Clicked item)
|
||||
|
||||
log.Info("Packet data: " + dataTypes.ByteArrayToString(packet.ToArray()));
|
||||
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ namespace MinecraftClient.Protocol
|
|||
/// <param name="action">0 to create/update an item. 1 to remove an item.</param>
|
||||
/// <param name="objectivename">The name of the objective the score belongs to</param>
|
||||
/// <param name="value">he score to be displayed next to the entry. Only sent when Action does not equal 1.</param>
|
||||
void OnUpdateScore(string entityname, byte action, string objectivename, int value);
|
||||
void OnUpdateScore(string entityname, int action, string objectivename, int value);
|
||||
|
||||
/// <summary>
|
||||
/// Called when tradeList is received from server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue