Only cursor aim players may set or clear a node's cursor

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVREx3uo7nz1FEhzveWTUh
This commit is contained in:
Claude committed 2026-11-11 18:29:27 +01:00
1 parent 2f4f90c773
commit 9f10ff08ff
1 file changed
+5 -1
@@ -10,6 +10,10 @@ public final class CursorAimServer {
} }
public static void accept(ServerPlayer player, boolean active, double cf, double cr, double cu) { public static void accept(ServerPlayer player, boolean active, double cf, double cr, double cu) {
// Only a player who chose cursor aim may set or clear the cursor of a node
if (!ControlMode.isCursorAim(player)) {
return;
}
Entity vehicle = player.getVehicle(); Entity vehicle = player.getVehicle();
if (!(vehicle instanceof SeatEntityEntity)) { if (!(vehicle instanceof SeatEntityEntity)) {
return; return;
@@ -20,7 +24,7 @@ public final class CursorAimServer {
} }
long nodeKey = basis.nodePos().asLong(); long nodeKey = basis.nodePos().asLong();
double length = Math.sqrt(cf * cf + cr * cr + cu * cu); double length = Math.sqrt(cf * cf + cr * cr + cu * cu);
if (!active || !ControlMode.isCursorAim(player) || !CursorAimConfig.ENABLED.get() || !(length > 1.0E-6) || !Double.isFinite(length)) { if (!active || !CursorAimConfig.ENABLED.get() || !(length > 1.0E-6) || !Double.isFinite(length)) {
CursorAimRegistry.clear(nodeKey); CursorAimRegistry.clear(nodeKey);
return; return;
} }