Skip to content

Commit

Permalink
Warn players who want extra reach accuracy that they need to add pape…
Browse files Browse the repository at this point in the history
…r.explicit-flush=false
  • Loading branch information
Axionize committed Nov 24, 2024
1 parent 497d72e commit 02d723d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import ac.grim.grimac.GrimAPI;
import ac.grim.grimac.manager.init.Initable;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.anticheat.LogUtil;
import ac.grim.grimac.utils.lists.HookedListWrapper;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.util.reflection.Reflection;
import io.github.retrooper.packetevents.util.SpigotReflectionUtil;
import sun.misc.Unsafe;
Expand All @@ -30,6 +33,10 @@ public void start() {
return;
}

if (PacketEvents.getAPI().getServerManager().getVersion().isNewerThan(ServerVersion.V_1_11_2) && !Boolean.getBoolean("paper.explicit-flush")) {
LogUtil.warn("Reach.enable-post-packet=true but paper.explicit-flush=false, add -Dpaper.explicit-flush=true to your server's startup flags for fully functional extra reach accuracy.");
}

// Inject so we can add the final transaction pre-flush event
try {
Object connection = SpigotReflectionUtil.getMinecraftServerConnectionInstance();
Expand Down

0 comments on commit 02d723d

Please sign in to comment.