mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fully implemented Map Data packet + Fixed 1.14 not working.
Fully implemented Map Data packet + Fixed 1.14 not working.
This commit is contained in:
commit
a03bab277b
8 changed files with 208 additions and 45 deletions
18
MinecraftClient/Mapping/MapIcon.cs
Normal file
18
MinecraftClient/Mapping/MapIcon.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MinecraftClient.Protocol.Handlers;
|
||||||
|
|
||||||
|
namespace MinecraftClient.Mapping
|
||||||
|
{
|
||||||
|
public class MapIcon
|
||||||
|
{
|
||||||
|
public MapIconType Type { set; get; }
|
||||||
|
public byte X { set; get; }
|
||||||
|
public byte Z { set; get; }
|
||||||
|
public byte Direction { set; get; }
|
||||||
|
public string? DisplayName { set; get; } = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
39
MinecraftClient/Mapping/MapIconType.cs
Normal file
39
MinecraftClient/Mapping/MapIconType.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MinecraftClient.Mapping
|
||||||
|
{
|
||||||
|
public enum MapIconType
|
||||||
|
{
|
||||||
|
White_Arrow = 0,
|
||||||
|
Green_Arrow,
|
||||||
|
Red_Arrow,
|
||||||
|
Blue_Arrow,
|
||||||
|
White_Cross,
|
||||||
|
Red_Pointer,
|
||||||
|
White_Circle,
|
||||||
|
Small_White_Circle,
|
||||||
|
Mansion,
|
||||||
|
Temple,
|
||||||
|
White_Banner,
|
||||||
|
Orange_Banner,
|
||||||
|
Magenta_Banner,
|
||||||
|
Light_Blue_Banner,
|
||||||
|
Yellow_Banner,
|
||||||
|
Lime_Banner,
|
||||||
|
Pink_Banner,
|
||||||
|
Gray_Banner,
|
||||||
|
Light_Gray_Banner,
|
||||||
|
Cyan_Banner,
|
||||||
|
Purple_Banner,
|
||||||
|
Blue_Banner,
|
||||||
|
Brown_Banner,
|
||||||
|
Green_Banner,
|
||||||
|
Red_Banner,
|
||||||
|
Black_Banner,
|
||||||
|
Treasure_Marker
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3064,16 +3064,22 @@ namespace MinecraftClient
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called map data
|
/// Called when an update of the map is sent by the server, take a look at https://wiki.vg/Protocol#Map_Data for more info on the fields
|
||||||
|
/// Map format and colors: https://minecraft.fandom.com/wiki/Map_item_format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mapid"></param>
|
/// <param name="mapid">Map ID of the map being modified</param>
|
||||||
/// <param name="scale"></param>
|
/// <param name="scale">A scale of the Map, from 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)</param>
|
||||||
/// <param name="trackingposition"></param>
|
/// <param name="trackingposition">Specifies whether player and item frame icons are shown </param>
|
||||||
/// <param name="locked"></param>
|
/// <param name="locked">True if the map has been locked in a cartography table </param>
|
||||||
/// <param name="iconcount"></param>
|
/// <param name="icons">A list of MapIcon objects of map icons, send only if trackingPosition is true</param>
|
||||||
public void OnMapData(int mapid, byte scale, bool trackingposition, bool locked, int iconcount)
|
/// <param name="columnsUpdated">Numbs of columns that were updated (map width) (NOTE: If it is 0, the next fields are not used/are set to default values of 0 and null respectively)</param>
|
||||||
|
/// <param name="rowsUpdated">Map height</param>
|
||||||
|
/// <param name="mapCoulmnX">x offset of the westernmost column</param>
|
||||||
|
/// <param name="mapRowZ">z offset of the northernmost row</param>
|
||||||
|
/// <param name="colors">a byte array of colors on the map</param>
|
||||||
|
public void OnMapData(int mapid, byte scale, bool trackingPosition, bool locked, List<MapIcon> icons, byte columnsUpdated, byte rowsUpdated, byte mapCoulmnX, byte mapCoulmnZ, byte[]? colors)
|
||||||
{
|
{
|
||||||
DispatchBotEvent(bot => bot.OnMapData(mapid, scale, trackingposition, locked, iconcount));
|
DispatchBotEvent(bot => bot.OnMapData(mapid, scale, trackingPosition, locked, icons, columnsUpdated, rowsUpdated, mapCoulmnX, mapCoulmnZ, colors));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -584,6 +584,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
{
|
{
|
||||||
Dictionary<int, object?> data = new();
|
Dictionary<int, object?> data = new();
|
||||||
byte key = ReadNextByte(cache);
|
byte key = ReadNextByte(cache);
|
||||||
|
|
||||||
while (key != 0xff)
|
while (key != 0xff)
|
||||||
{
|
{
|
||||||
int type = ReadNextVarInt(cache);
|
int type = ReadNextVarInt(cache);
|
||||||
|
|
@ -599,6 +600,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
type += 1;
|
type += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Value's data type is depended on Type
|
// Value's data type is depended on Type
|
||||||
object? value = null;
|
object? value = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
p = new PacketPalette112();
|
p = new PacketPalette112();
|
||||||
else if (protocol <= Protocol18Handler.MC_1_12_2_Version)
|
else if (protocol <= Protocol18Handler.MC_1_12_2_Version)
|
||||||
p = new PacketPalette1122();
|
p = new PacketPalette1122();
|
||||||
else if (protocol <= Protocol18Handler.MC_1_14_Version)
|
else if (protocol < Protocol18Handler.MC_1_14_Version)
|
||||||
p = new PacketPalette113();
|
p = new PacketPalette113();
|
||||||
else if (protocol <= Protocol18Handler.MC_1_15_Version)
|
else if (protocol <= Protocol18Handler.MC_1_15_Version)
|
||||||
p = new PacketPalette114();
|
p = new PacketPalette114();
|
||||||
|
|
|
||||||
|
|
@ -4,23 +4,22 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using MinecraftClient.Crypto;
|
using MinecraftClient.Crypto;
|
||||||
using MinecraftClient.Proxy;
|
using MinecraftClient.Proxy;
|
||||||
using System.Security.Cryptography;
|
|
||||||
using MinecraftClient.Mapping;
|
using MinecraftClient.Mapping;
|
||||||
using MinecraftClient.Mapping.BlockPalettes;
|
using MinecraftClient.Mapping.BlockPalettes;
|
||||||
using MinecraftClient.Mapping.EntityPalettes;
|
using MinecraftClient.Mapping.EntityPalettes;
|
||||||
using MinecraftClient.Protocol.Handlers.Forge;
|
using MinecraftClient.Protocol.Handlers.Forge;
|
||||||
using MinecraftClient.Inventory;
|
using MinecraftClient.Inventory;
|
||||||
using System.Diagnostics;
|
|
||||||
using MinecraftClient.Inventory.ItemPalettes;
|
using MinecraftClient.Inventory.ItemPalettes;
|
||||||
using MinecraftClient.Protocol.Handlers.PacketPalettes;
|
using MinecraftClient.Protocol.Handlers.PacketPalettes;
|
||||||
using MinecraftClient.Logger;
|
using MinecraftClient.Logger;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MinecraftClient.Protocol.Keys;
|
using MinecraftClient.Protocol.Keys;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using MinecraftClient.Protocol.Session;
|
using MinecraftClient.Protocol.Session;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using MinecraftClient.Protocol.Message;
|
using MinecraftClient.Protocol.Message;
|
||||||
|
|
||||||
namespace MinecraftClient.Protocol.Handlers
|
namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
@ -45,6 +44,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
internal const int MC_1_12_Version = 335;
|
internal const int MC_1_12_Version = 335;
|
||||||
internal const int MC_1_12_2_Version = 340;
|
internal const int MC_1_12_2_Version = 340;
|
||||||
internal const int MC_1_13_Version = 393;
|
internal const int MC_1_13_Version = 393;
|
||||||
|
internal const int MC_1_13_2_Version = 404;
|
||||||
internal const int MC_1_14_Version = 477;
|
internal const int MC_1_14_Version = 477;
|
||||||
internal const int MC_1_15_Version = 573;
|
internal const int MC_1_15_Version = 573;
|
||||||
internal const int MC_1_15_2_Version = 578;
|
internal const int MC_1_15_2_Version = 578;
|
||||||
|
|
@ -781,20 +781,106 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketTypesIn.MapData:
|
case PacketTypesIn.MapData:
|
||||||
|
if (protocolVersion < MC_1_8_Version)
|
||||||
|
break;
|
||||||
|
|
||||||
int mapid = dataTypes.ReadNextVarInt(packetData);
|
int mapid = dataTypes.ReadNextVarInt(packetData);
|
||||||
byte scale = dataTypes.ReadNextByte(packetData);
|
byte scale = dataTypes.ReadNextByte(packetData);
|
||||||
bool trackingposition = protocolVersion >= MC_1_17_Version ? false : dataTypes.ReadNextBool(packetData);
|
|
||||||
|
|
||||||
|
// 1.9 +
|
||||||
|
bool trackingPosition = true;
|
||||||
|
|
||||||
|
// 1.14+
|
||||||
bool locked = false;
|
bool locked = false;
|
||||||
if (protocolVersion >= MC_1_14_Version)
|
|
||||||
{
|
// 1.17+ (locked and trackingPosition switched places)
|
||||||
locked = dataTypes.ReadNextBool(packetData);
|
|
||||||
}
|
|
||||||
if (protocolVersion >= MC_1_17_Version)
|
if (protocolVersion >= MC_1_17_Version)
|
||||||
{
|
{
|
||||||
trackingposition = dataTypes.ReadNextBool(packetData);
|
if (protocolVersion >= MC_1_14_Version)
|
||||||
|
locked = dataTypes.ReadNextBool(packetData);
|
||||||
|
|
||||||
|
if (protocolVersion >= MC_1_9_Version)
|
||||||
|
trackingPosition = dataTypes.ReadNextBool(packetData);
|
||||||
}
|
}
|
||||||
int iconcount = dataTypes.ReadNextVarInt(packetData);
|
else
|
||||||
handler.OnMapData(mapid, scale, trackingposition, locked, iconcount);
|
{
|
||||||
|
if (protocolVersion >= MC_1_9_Version)
|
||||||
|
trackingPosition = dataTypes.ReadNextBool(packetData);
|
||||||
|
|
||||||
|
if (protocolVersion >= MC_1_14_Version)
|
||||||
|
locked = dataTypes.ReadNextBool(packetData);
|
||||||
|
}
|
||||||
|
|
||||||
|
int iconcount = 0;
|
||||||
|
List<MapIcon> icons = new();
|
||||||
|
|
||||||
|
// 1,9 + = needs tracking position to be true to get the icons
|
||||||
|
if (protocolVersion > MC_1_9_Version ? trackingPosition : true)
|
||||||
|
{
|
||||||
|
iconcount = dataTypes.ReadNextVarInt(packetData);
|
||||||
|
|
||||||
|
for (int i = 0; i < iconcount; i++)
|
||||||
|
{
|
||||||
|
MapIcon mapIcon = new();
|
||||||
|
|
||||||
|
// 1.8 - 1.13
|
||||||
|
if (protocolVersion < MC_1_13_2_Version)
|
||||||
|
{
|
||||||
|
byte directionAndtype = dataTypes.ReadNextByte(packetData);
|
||||||
|
byte direction, type;
|
||||||
|
|
||||||
|
// 1.12.2+
|
||||||
|
if (protocolVersion >= MC_1_12_2_Version)
|
||||||
|
{
|
||||||
|
direction = (byte)(directionAndtype & 0xF);
|
||||||
|
type = (byte)((directionAndtype >> 4) & 0xF);
|
||||||
|
}
|
||||||
|
else // 1.8 - 1.12
|
||||||
|
{
|
||||||
|
direction = (byte)((directionAndtype >> 4) & 0xF);
|
||||||
|
type = (byte)(directionAndtype & 0xF);
|
||||||
|
}
|
||||||
|
|
||||||
|
mapIcon.Type = (MapIconType)type;
|
||||||
|
mapIcon.Direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1.13.2+
|
||||||
|
if (protocolVersion >= MC_1_13_2_Version)
|
||||||
|
mapIcon.Type = (MapIconType)dataTypes.ReadNextVarInt(packetData);
|
||||||
|
|
||||||
|
mapIcon.X = dataTypes.ReadNextByte(packetData);
|
||||||
|
mapIcon.Z = dataTypes.ReadNextByte(packetData);
|
||||||
|
|
||||||
|
// 1.13.2+
|
||||||
|
if (protocolVersion >= MC_1_13_2_Version)
|
||||||
|
{
|
||||||
|
mapIcon.Direction = dataTypes.ReadNextByte(packetData);
|
||||||
|
|
||||||
|
if (dataTypes.ReadNextBool(packetData)) // Has Display Name?
|
||||||
|
mapIcon.DisplayName = ChatParser.ParseText(dataTypes.ReadNextString(packetData));
|
||||||
|
}
|
||||||
|
|
||||||
|
icons.Add(mapIcon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
byte columnsUpdated = dataTypes.ReadNextByte(packetData); // width
|
||||||
|
byte rowsUpdated = 0; // height
|
||||||
|
byte mapCoulmnX = 0;
|
||||||
|
byte mapRowZ = 0;
|
||||||
|
byte[]? colors = null;
|
||||||
|
|
||||||
|
if (columnsUpdated > 0)
|
||||||
|
{
|
||||||
|
rowsUpdated = dataTypes.ReadNextByte(packetData); // height
|
||||||
|
mapCoulmnX = dataTypes.ReadNextByte(packetData);
|
||||||
|
mapRowZ = dataTypes.ReadNextByte(packetData);
|
||||||
|
colors = dataTypes.ReadNextByteArray(packetData);
|
||||||
|
}
|
||||||
|
|
||||||
|
handler.OnMapData(mapid, scale, trackingPosition, locked, icons, columnsUpdated, rowsUpdated, mapCoulmnX, mapRowZ, colors);
|
||||||
break;
|
break;
|
||||||
case PacketTypesIn.TradeList:
|
case PacketTypesIn.TradeList:
|
||||||
if ((protocolVersion >= MC_1_14_Version) && (handler.GetInventoryEnabled()))
|
if ((protocolVersion >= MC_1_14_Version) && (handler.GetInventoryEnabled()))
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ namespace MinecraftClient.Protocol
|
||||||
/// This method is called when the protocol handler receives a title
|
/// This method is called when the protocol handler receives a title
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void OnTitle(int action, string titletext, string subtitletext, string actionbartext, int fadein, int stay, int fadeout, string json);
|
void OnTitle(int action, string titletext, string subtitletext, string actionbartext, int fadein, int stay, int fadeout, string json);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when receiving a connection keep-alive from the server
|
/// Called when receiving a connection keep-alive from the server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -216,7 +216,7 @@ namespace MinecraftClient.Protocol
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="entity">Spawned entity</param>
|
/// <param name="entity">Spawned entity</param>
|
||||||
void OnSpawnEntity(Entity entity);
|
void OnSpawnEntity(Entity entity);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when an entity has spawned
|
/// Called when an entity has spawned
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -224,7 +224,7 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="slot">Equipment slot. 0: main hand, 1: off hand, 2–5: armor slot (2: boots, 3: leggings, 4: chestplate, 5: helmet)/param>
|
/// <param name="slot">Equipment slot. 0: main hand, 1: off hand, 2–5: armor slot (2: boots, 3: leggings, 4: chestplate, 5: helmet)/param>
|
||||||
/// <param name="item">Item/param>
|
/// <param name="item">Item/param>
|
||||||
void OnEntityEquipment(int entityid, int slot, Item item);
|
void OnEntityEquipment(int entityid, int slot, Item item);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a player spawns or enters the client's render distance
|
/// Called when a player spawns or enters the client's render distance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -312,7 +312,7 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="entityID">Entity ID</param>
|
/// <param name="entityID">Entity ID</param>
|
||||||
/// <param name="health">The health of the entity</param>
|
/// <param name="health">The health of the entity</param>
|
||||||
void OnEntityHealth(int entityID, float health);
|
void OnEntityHealth(int entityID, float health);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when entity metadata or metadata changed.
|
/// Called when entity metadata or metadata changed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -334,14 +334,14 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="uuid">Affected player's UUID</param>
|
/// <param name="uuid">Affected player's UUID</param>
|
||||||
/// <param name="gamemode">New game mode</param>
|
/// <param name="gamemode">New game mode</param>
|
||||||
void OnGamemodeUpdate(Guid uuid, int gamemode);
|
void OnGamemodeUpdate(Guid uuid, int gamemode);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a player's latency has changed
|
/// Called when a player's latency has changed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">Affected player's UUID</param>
|
/// <param name="uuid">Affected player's UUID</param>
|
||||||
/// <param name="latency">latency</param>
|
/// <param name="latency">latency</param>
|
||||||
void OnLatencyUpdate(Guid uuid, int latency);
|
void OnLatencyUpdate(Guid uuid, int latency);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when Experience bar is updated
|
/// Called when Experience bar is updated
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -356,17 +356,23 @@ namespace MinecraftClient.Protocol
|
||||||
/// <remarks>Used for setting player slot after joining game</remarks>
|
/// <remarks>Used for setting player slot after joining game</remarks>
|
||||||
/// <param name="slot"></param>
|
/// <param name="slot"></param>
|
||||||
void OnHeldItemChange(byte slot);
|
void OnHeldItemChange(byte slot);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called map data
|
/// Called when an update of the map is sent by the server, take a look at https://wiki.vg/Protocol#Map_Data for more info on the fields
|
||||||
|
/// Map format and colors: https://minecraft.fandom.com/wiki/Map_item_format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mapid"></param>
|
/// <param name="mapid">Map ID of the map being modified</param>
|
||||||
/// <param name="scale"></param>
|
/// <param name="scale">A scale of the Map, from 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)</param>
|
||||||
/// <param name="trackingposition"></param>
|
/// <param name="trackingposition">Specifies whether player and item frame icons are shown </param>
|
||||||
/// <param name="locked"></param>
|
/// <param name="locked">True if the map has been locked in a cartography table </param>
|
||||||
/// <param name="iconcount"></param>
|
/// <param name="icons">A list of MapIcon objects of map icons, send only if trackingPosition is true</param>
|
||||||
void OnMapData(int mapid, byte scale, bool trackingposition, bool locked, int iconcount);
|
/// <param name="columnsUpdated">Numbs of columns that were updated (map width) (NOTE: If it is 0, the next fields are not used/are set to default values of 0 and null respectively)</param>
|
||||||
|
/// <param name="rowsUpdated">Map height</param>
|
||||||
|
/// <param name="mapCoulmnX">x offset of the westernmost column</param>
|
||||||
|
/// <param name="mapRowZ">z offset of the northernmost row</param>
|
||||||
|
/// <param name="colors">a byte array of colors on the map</param>
|
||||||
|
void OnMapData(int mapid, byte scale, bool trackingPosition, bool locked, List<MapIcon> icons, byte columnsUpdated, byte rowsUpdated, byte mapCoulmnX, byte mapRowZ, byte[]? colors);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the Player entity ID has been received from the server
|
/// Called when the Player entity ID has been received from the server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -393,7 +399,7 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="objectivevalue">Only if mode is 0 or 2. The text to be displayed for the score</param>
|
/// <param name="objectivevalue">Only if mode is 0 or 2. The text to be displayed for the score</param>
|
||||||
/// <param name="type">Only if mode is 0 or 2. 0 = "integer", 1 = "hearts".</param>
|
/// <param name="type">Only if mode is 0 or 2. 0 = "integer", 1 = "hearts".</param>
|
||||||
void OnScoreboardObjective(string objectivename, byte mode, string objectivevalue, int type);
|
void OnScoreboardObjective(string objectivename, byte mode, string objectivevalue, int type);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when DisplayScoreboard
|
/// Called when DisplayScoreboard
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -264,14 +264,20 @@ namespace MinecraftClient
|
||||||
public virtual void OnLatencyUpdate(Entity entity, string playername, Guid uuid, int latency) { }
|
public virtual void OnLatencyUpdate(Entity entity, string playername, Guid uuid, int latency) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a map was updated
|
/// Called when an update of the map is sent by the server, take a look at https://wiki.vg/Protocol#Map_Data for more info on the fields
|
||||||
|
/// Map format and colors: https://minecraft.fandom.com/wiki/Map_item_format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mapid"></param>
|
/// <param name="mapid">Map ID of the map being modified</param>
|
||||||
/// <param name="scale"></param>
|
/// <param name="scale">A scale of the Map, from 0 for a fully zoomed-in map (1 block per pixel) to 4 for a fully zoomed-out map (16 blocks per pixel)</param>
|
||||||
/// <param name="trackingposition"></param>
|
/// <param name="trackingposition">Specifies whether player and item frame icons are shown </param>
|
||||||
/// <param name="locked"></param>
|
/// <param name="locked">True if the map has been locked in a cartography table </param>
|
||||||
/// <param name="iconcount"></param>
|
/// <param name="icons">A list of MapIcon objects of map icons, send only if trackingPosition is true</param>
|
||||||
public virtual void OnMapData(int mapid, byte scale, bool trackingposition, bool locked, int iconcount) { }
|
/// <param name="columnsUpdated">Numbs of columns that were updated (map width) (NOTE: If it is 0, the next fields are not used/are set to default values of 0 and null respectively)</param>
|
||||||
|
/// <param name="rowsUpdated">Map height</param>
|
||||||
|
/// <param name="mapCoulmnX">x offset of the westernmost column</param>
|
||||||
|
/// <param name="mapRowZ">z offset of the northernmost row</param>
|
||||||
|
/// <param name="colors">a byte array of colors on the map</param>
|
||||||
|
public virtual void OnMapData(int mapid, byte scale, bool trackingPosition, bool locked, List<MapIcon> icons, byte columnsUpdated, byte rowsUpdated, byte mapCoulmnX, byte mapRowZ, byte[]? colors) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when tradeList is received from server
|
/// Called when tradeList is received from server
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue