diff --git a/MinecraftClient/ChatBots/AutoDig.cs b/MinecraftClient/ChatBots/AutoDig.cs index 7c5a17e9..21f93803 100644 --- a/MinecraftClient/ChatBots/AutoDig.cs +++ b/MinecraftClient/ChatBots/AutoDig.cs @@ -33,7 +33,7 @@ namespace MinecraftClient.ChatBots [TomlInlineComment("$config.ChatBot.AutoDig.Mode$")] 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) }; [TomlInlineComment("$config.ChatBot.AutoDig.Location_Order$")] diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 260a3b96..954a3915 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -749,9 +749,12 @@ namespace MinecraftClient.Protocol.Handlers // Teleport confirm packet SendPacket(PacketTypesOut.TeleportConfirm, dataTypes.GetVarInt(teleportID)); - SendLocationUpdate(location, true, yaw, pitch, true); - if (teleportID == 1) + if (Config.Main.Advanced.TemporaryFixBadpacket) + { SendLocationUpdate(location, true, yaw, pitch, true); + if (teleportID == 1) + SendLocationUpdate(location, true, yaw, pitch, true); + } } else { @@ -2550,7 +2553,7 @@ namespace MinecraftClient.Protocol.Handlers /// True if the location update was successfully sent 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) @@ -2560,12 +2563,25 @@ namespace MinecraftClient.Protocol.Handlers byte[] yawpitch = Array.Empty(); PacketTypesOut packetType = PacketTypesOut.PlayerPosition; - if (yaw.HasValue && pitch.HasValue && (forceUpdate || yaw.Value != LastYaw || pitch.Value != LastPitch)) + if (Config.Main.Advanced.TemporaryFixBadpacket) { - yawpitch = dataTypes.ConcatBytes(dataTypes.GetFloat(yaw.Value), dataTypes.GetFloat(pitch.Value)); - packetType = PacketTypesOut.PlayerPositionAndRotation; + if (yaw.HasValue && pitch.HasValue && (forceUpdate || yaw.Value != LastYaw || pitch.Value != LastPitch)) + { + yawpitch = dataTypes.ConcatBytes(dataTypes.GetFloat(yaw.Value), dataTypes.GetFloat(pitch.Value)); + packetType = PacketTypesOut.PlayerPositionAndRotation; - 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 diff --git a/MinecraftClient/Resources/Translations/Translations.Designer.cs b/MinecraftClient/Resources/Translations/Translations.Designer.cs index 1c76429e..aeae5da0 100644 --- a/MinecraftClient/Resources/Translations/Translations.Designer.cs +++ b/MinecraftClient/Resources/Translations/Translations.Designer.cs @@ -5649,6 +5649,15 @@ namespace MinecraftClient { } } + /// + /// Looks up a localized string similar to Temporary fix for Badpacket issue on some servers.. + /// + internal static string config_Main_Advanced_temporary_fix_badpacket { + get { + return ResourceManager.GetString("config.Main.Advanced.temporary_fix_badpacket", resourceCulture); + } + } + /// /// 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.. /// diff --git a/MinecraftClient/Resources/Translations/Translations.resx b/MinecraftClient/Resources/Translations/Translations.resx index 9d2914bf..d620d053 100644 --- a/MinecraftClient/Resources/Translations/Translations.resx +++ b/MinecraftClient/Resources/Translations/Translations.resx @@ -60,45 +60,45 @@ : and then encoded with base64 encoding. --> - + - + - - - - + + + + - - + + - - + + - - - - + + + + - + - + @@ -2669,4 +2669,7 @@ Logging in... The old MinecraftClient.ini has been backed up as {0} + + Temporary fix for Badpacket issue on some servers. + \ No newline at end of file diff --git a/MinecraftClient/Settings.cs b/MinecraftClient/Settings.cs index 514beb95..f56f1979 100644 --- a/MinecraftClient/Settings.cs +++ b/MinecraftClient/Settings.cs @@ -508,6 +508,9 @@ namespace MinecraftClient [TomlInlineComment("$config.Main.Advanced.movement_speed$")] public int MovementSpeed = 2; + [TomlInlineComment("$config.Main.Advanced.temporary_fix_badpacket$")] + public bool TemporaryFixBadpacket = false; + [TomlInlineComment("$config.Main.Advanced.inventory_handling$")] public bool InventoryHandling = false;