diff --git a/MinecraftClient/Scripting/DynamicRun/Builder/Compiler.cs b/MinecraftClient/Scripting/DynamicRun/Builder/Compiler.cs index 9bd865c2e2..1e99f226ea 100644 --- a/MinecraftClient/Scripting/DynamicRun/Builder/Compiler.cs +++ b/MinecraftClient/Scripting/DynamicRun/Builder/Compiler.cs @@ -94,7 +94,15 @@ private static CSharpCompilation GenerateCode(string sourceCode, string fileName { 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; } }