mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix AutoDig
This commit is contained in:
parent
d7471e3741
commit
e954801a0d
5 changed files with 55 additions and 24 deletions
|
|
@ -33,7 +33,7 @@ namespace MinecraftClient.ChatBots
|
||||||
[TomlInlineComment("$config.ChatBot.AutoDig.Mode$")]
|
[TomlInlineComment("$config.ChatBot.AutoDig.Mode$")]
|
||||||
public ModeType Mode = ModeType.lookat;
|
public ModeType Mode = ModeType.lookat;
|
||||||
|
|
||||||
[TomlInlineComment("$config.ChatBot.AutoDig.Locations$")]
|
[TomlPrecedingComment("$config.ChatBot.AutoDig.Locations$")]
|
||||||
public Coordination[] Locations = new Coordination[] { new(123.5, 64, 234.5), new(124.5, 63, 235.5) };
|
public Coordination[] Locations = new Coordination[] { new(123.5, 64, 234.5), new(124.5, 63, 235.5) };
|
||||||
|
|
||||||
[TomlInlineComment("$config.ChatBot.AutoDig.Location_Order$")]
|
[TomlInlineComment("$config.ChatBot.AutoDig.Location_Order$")]
|
||||||
|
|
|
||||||
|
|
@ -749,10 +749,13 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
// Teleport confirm packet
|
// Teleport confirm packet
|
||||||
SendPacket(PacketTypesOut.TeleportConfirm, dataTypes.GetVarInt(teleportID));
|
SendPacket(PacketTypesOut.TeleportConfirm, dataTypes.GetVarInt(teleportID));
|
||||||
|
if (Config.Main.Advanced.TemporaryFixBadpacket)
|
||||||
|
{
|
||||||
SendLocationUpdate(location, true, yaw, pitch, true);
|
SendLocationUpdate(location, true, yaw, pitch, true);
|
||||||
if (teleportID == 1)
|
if (teleportID == 1)
|
||||||
SendLocationUpdate(location, true, yaw, pitch, true);
|
SendLocationUpdate(location, true, yaw, pitch, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler.UpdateLocation(location, yaw, pitch);
|
handler.UpdateLocation(location, yaw, pitch);
|
||||||
|
|
@ -2550,7 +2553,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
/// <returns>True if the location update was successfully sent</returns>
|
/// <returns>True if the location update was successfully sent</returns>
|
||||||
public bool SendLocationUpdate(Location location, bool onGround, float? yaw, float? pitch)
|
public bool SendLocationUpdate(Location location, bool onGround, float? yaw, float? pitch)
|
||||||
{
|
{
|
||||||
return SendLocationUpdate(location, onGround, yaw, pitch, false);
|
return SendLocationUpdate(location, onGround, yaw, pitch, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SendLocationUpdate(Location location, bool onGround, float? yaw = null, float? pitch = null, bool forceUpdate = false)
|
public bool SendLocationUpdate(Location location, bool onGround, float? yaw = null, float? pitch = null, bool forceUpdate = false)
|
||||||
|
|
@ -2560,6 +2563,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
byte[] yawpitch = Array.Empty<byte>();
|
byte[] yawpitch = Array.Empty<byte>();
|
||||||
PacketTypesOut packetType = PacketTypesOut.PlayerPosition;
|
PacketTypesOut packetType = PacketTypesOut.PlayerPosition;
|
||||||
|
|
||||||
|
if (Config.Main.Advanced.TemporaryFixBadpacket)
|
||||||
|
{
|
||||||
if (yaw.HasValue && pitch.HasValue && (forceUpdate || yaw.Value != LastYaw || pitch.Value != LastPitch))
|
if (yaw.HasValue && pitch.HasValue && (forceUpdate || yaw.Value != LastYaw || pitch.Value != LastPitch))
|
||||||
{
|
{
|
||||||
yawpitch = dataTypes.ConcatBytes(dataTypes.GetFloat(yaw.Value), dataTypes.GetFloat(pitch.Value));
|
yawpitch = dataTypes.ConcatBytes(dataTypes.GetFloat(yaw.Value), dataTypes.GetFloat(pitch.Value));
|
||||||
|
|
@ -2567,6 +2572,17 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
LastYaw = yaw.Value; LastPitch = pitch.Value;
|
LastYaw = yaw.Value; LastPitch = pitch.Value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (yaw.HasValue && pitch.HasValue)
|
||||||
|
{
|
||||||
|
yawpitch = dataTypes.ConcatBytes(dataTypes.GetFloat(yaw.Value), dataTypes.GetFloat(pitch.Value));
|
||||||
|
packetType = PacketTypesOut.PlayerPositionAndRotation;
|
||||||
|
|
||||||
|
LastYaw = yaw.Value; LastPitch = pitch.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5649,6 +5649,15 @@ namespace MinecraftClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Temporary fix for Badpacket issue on some servers..
|
||||||
|
/// </summary>
|
||||||
|
internal static string config_Main_Advanced_temporary_fix_badpacket {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("config.Main.Advanced.temporary_fix_badpacket", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Use "none", "bit_4", "bit_8" or "bit_24". This can be checked by opening the debug log..
|
/// Looks up a localized string similar to Use "none", "bit_4", "bit_8" or "bit_24". This can be checked by opening the debug log..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -2669,4 +2669,7 @@ Logging in...</value>
|
||||||
<data name="mcc.backup_old_config" xml:space="preserve">
|
<data name="mcc.backup_old_config" xml:space="preserve">
|
||||||
<value>The old MinecraftClient.ini has been backed up as {0}</value>
|
<value>The old MinecraftClient.ini has been backed up as {0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="config.Main.Advanced.temporary_fix_badpacket" xml:space="preserve">
|
||||||
|
<value>Temporary fix for Badpacket issue on some servers.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
@ -508,6 +508,9 @@ namespace MinecraftClient
|
||||||
[TomlInlineComment("$config.Main.Advanced.movement_speed$")]
|
[TomlInlineComment("$config.Main.Advanced.movement_speed$")]
|
||||||
public int MovementSpeed = 2;
|
public int MovementSpeed = 2;
|
||||||
|
|
||||||
|
[TomlInlineComment("$config.Main.Advanced.temporary_fix_badpacket$")]
|
||||||
|
public bool TemporaryFixBadpacket = false;
|
||||||
|
|
||||||
[TomlInlineComment("$config.Main.Advanced.inventory_handling$")]
|
[TomlInlineComment("$config.Main.Advanced.inventory_handling$")]
|
||||||
public bool InventoryHandling = false;
|
public bool InventoryHandling = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue