mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
More events (#1660)
* + OnBlockBreakAnimation * + OnBlockBreakAnimation * + OnEntityAnimation * Add checks * + OnBlockChange * + OnMultiBlockChange * Fix * Fix * Fix * add summary * Fix * fix other summary
This commit is contained in:
parent
c0f128f632
commit
48577bf034
4 changed files with 97 additions and 19 deletions
|
|
@ -628,7 +628,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
byte blockMeta = dataTypes.ReadNextByte(packetData);
|
||||
handler.GetWorld().SetBlock(new Location(blockX, blockY, blockZ), new Block(blockId, blockMeta));
|
||||
}
|
||||
else handler.GetWorld().SetBlock(dataTypes.ReadNextLocation(packetData), new Block((ushort)dataTypes.ReadNextVarInt(packetData)));
|
||||
else
|
||||
{
|
||||
handler.GetWorld().SetBlock(dataTypes.ReadNextLocation(packetData), new Block((ushort)dataTypes.ReadNextVarInt(packetData)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PacketTypesIn.MapChunkBulk:
|
||||
|
|
@ -1112,6 +1115,23 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
value = dataTypes.ReadNextVarInt(packetData);
|
||||
handler.OnUpdateScore(entityname, action3, objectivename2, value);
|
||||
break;
|
||||
case PacketTypesIn.BlockBreakAnimation:
|
||||
if (handler.GetEntityHandlingEnabled() && handler.GetTerrainEnabled())
|
||||
{
|
||||
int playerId = dataTypes.ReadNextVarInt(packetData);
|
||||
Location blockLocation = dataTypes.ReadNextLocation(packetData);
|
||||
byte stage = dataTypes.ReadNextByte(packetData);
|
||||
handler.OnBlockBreakAnimation(playerId, blockLocation, stage);
|
||||
}
|
||||
break;
|
||||
case PacketTypesIn.EntityAnimation:
|
||||
if (handler.GetEntityHandlingEnabled())
|
||||
{
|
||||
int playerId2 = dataTypes.ReadNextVarInt(packetData);
|
||||
byte animation = dataTypes.ReadNextByte(packetData);
|
||||
handler.OnEntityAnimation(playerId2, animation);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false; //Ignored packet
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,22 @@ namespace MinecraftClient.Protocol
|
|||
/// <param name="text">Text received from the server</param>
|
||||
/// <param name="isJson">TRUE if the text is JSON-Encoded</param>
|
||||
void OnTextReceived(string text, bool isJson);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Will be called every animations of the hit and place block
|
||||
/// </summary>
|
||||
/// <param name="entityID">Player ID</param>
|
||||
/// <param name="animation">0 = LMB, 1 = RMB (RMB Corrent not work)</param>
|
||||
void OnEntityAnimation(int entityID, byte animation);
|
||||
|
||||
/// <summary>
|
||||
/// Will be called every player break block in gamemode 0
|
||||
/// </summary>
|
||||
/// <param name="entityId">Player ID</param>
|
||||
/// <param name="location">Block location</param>
|
||||
/// <param name="stage">Destroy stage, maximum 255</param>
|
||||
void OnBlockBreakAnimation(int entityID, Location location, byte stage);
|
||||
|
||||
/// <summary>
|
||||
/// This method is called when the protocol handler receives a title
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue