Merge branch 'master' into 1.20.6

This commit is contained in:
breadbyte 2025-12-02 00:06:16 +08:00 committed by GitHub
commit 494be0930b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 455 additions and 1655 deletions

View file

@ -1075,11 +1075,12 @@ namespace MinecraftClient.Scripting
/// Attempt to dig a block at the specified location
/// </summary>
/// <param name="location">Location of block to dig</param>
/// <param name="direction">Example: if your player is under a block that is being destroyed, use Down</param>
/// <param name="swingArms">Also perform the "arm swing" animation</param>
/// <param name="lookAtBlock">Also look at the block before digging</param>
protected bool DigBlock(Location location, bool swingArms = true, bool lookAtBlock = true)
protected bool DigBlock(Location location, Direction direction, bool swingArms = true, bool lookAtBlock = true)
{
return Handler.DigBlock(location, swingArms, lookAtBlock);
return Handler.DigBlock(location, direction, swingArms, lookAtBlock);
}
/// <summary>
@ -1633,6 +1634,15 @@ namespace MinecraftClient.Scripting
return Handler.GetProtocolVersion();
}
/// <summary>
/// Gets the horizontal direction of the takeoff.
/// </summary>
/// <returns>Return direction of view</returns>
protected Direction GetHorizontalFacing()
{
return Handler.GetHorizontalFacing();
}
/// <summary>
/// Invoke a task on the main thread, wait for completion and retrieve return value.
/// </summary>

View file

@ -94,7 +94,15 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
{
if (file.EndsWith("mcc-executable"))
{
useExisting = true;
// Check if the file is the same as the current executable.
if (File.ReadAllBytes(file).SequenceEqual(File.ReadAllBytes(executablePath)))
{
useExisting = true;
break;
}
// If not, refresh the cache.
File.Delete(file);
break;
}
}