Skip to content

Commit ce561dd

Browse files
committed
Fix anti-AI Mixin on 1.21.1+
1 parent c4eac6f commit ce561dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/org/polyfrost/polyplus/mixin/Mixin_NoAI.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@
1717
@Mixin(CrashReport.class)
1818
public class Mixin_NoAI {
1919
@SuppressWarnings("StringBufferReplaceableByString")
20-
@Inject(method = "getCompleteReport", at = @At("RETURN"), cancellable = true)
20+
@Inject(
21+
//#if MC >= 1.21.1
22+
//$$ method = "getFriendlyReport(Lnet/minecraft/ReportType;Ljava/util/List;)Ljava/lang/String;",
23+
//#else
24+
method = "getCompleteReport",
25+
//#endif
26+
at = @At("RETURN"),
27+
cancellable = true
28+
)
2129
private void addNoAIComment(CallbackInfoReturnable<String> cir) {
2230
StringBuilder builder = new StringBuilder(cir.getReturnValue());
2331
builder.append("\n\n").append("---").append("\n");

0 commit comments

Comments
 (0)