Moved Auto attack and auto fishing to ChatBots and added ChatBotAPI for entity handling

This commit is contained in:
ReinforceZwei 2020-03-23 19:59:00 +08:00 committed by ORelio
parent 8b8f3a719b
commit dbf5334758
16 changed files with 602 additions and 465 deletions

View file

@ -137,6 +137,17 @@ namespace MinecraftClient
/// <param name="data">The payload for the message</param>
public virtual void OnPluginMessage(string channel, byte[] data) { }
public virtual void OnPlayerProperty(Dictionary<string, Double> prop) { }
public virtual void OnServerTpsUpdate(Double tps) { }
public virtual void OnEntityMove(Mapping.Entity entity) { }
public virtual void OnEntitySpawn(Mapping.Entity entity) { }
public virtual void OnEntityDespawn(int EntityID) { }
/* =================================================================== */
/* ToolBox - Methods below might be useful while creating your bot. */
/* You should not need to interact with other classes of the program. */
@ -599,6 +610,16 @@ namespace MinecraftClient
return Handler.SetTerrainEnabled(enabled);
}
/// <summary>
/// Get entity handling status
/// </summary>
/// <returns></returns>
/// <remarks>Entity Handling cannot be enabled in runtime (or after joining server)</remarks>
public bool GetEntityHandlingEnabled()
{
return Handler.GetEntityHandlingEnabled();
}
/// <summary>
/// Get the current Minecraft World
/// </summary>
@ -764,5 +785,26 @@ namespace MinecraftClient
}
return Handler.SendPluginChannelMessage(channel, data, sendEvenIfNotRegistered);
}
protected Double GetServerTPS()
{
return Handler.GetServerTPS();
}
/// <summary>
/// Interact with an entity
/// </summary>
/// <param name="EntityID"></param>
/// <param name="type">0: interact, 1: attack, 2: interact at</param>
/// <returns></returns>
protected bool InteractEntity(int EntityID, int type)
{
return Handler.InteractEntity(EntityID, type);
}
protected bool UseItemOnHand()
{
return Handler.UseItemOnHand();
}
}
}