From eb577a64115a39b84b7234a3d56333b165ed7ea1 Mon Sep 17 00:00:00 2001 From: moo Date: Fri, 6 Mar 2026 12:26:38 -0800 Subject: [PATCH] changed to robot.getalliance --- src/main/java/frc/robot/util/HubActive.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/util/HubActive.java b/src/main/java/frc/robot/util/HubActive.java index dd5b762..05e0b43 100644 --- a/src/main/java/frc/robot/util/HubActive.java +++ b/src/main/java/frc/robot/util/HubActive.java @@ -4,15 +4,16 @@ import java.util.Optional; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation.Alliance; +import frc.robot.Robot; public class HubActive { static public boolean isHubActive() { - Optional alliance = DriverStation.getAlliance(); + Alliance alliance = Robot.getAlliance(); // If we have no alliance, we cannot be enabled, therefore no hub. - if (alliance.isEmpty()) { - return false; - } + // if (alliance.isEmpty()) { + // return false; + // } // Hub is always enabled in autonomous. if (DriverStation.isAutonomousEnabled()) { return true; @@ -41,7 +42,7 @@ public class HubActive { } // Shift was is active for blue if red won auto, or red if blue won auto. - boolean shift1Active = switch (alliance.get()) { + boolean shift1Active = switch (alliance) { case Red -> !redInactiveFirst; case Blue -> redInactiveFirst; }; @@ -69,11 +70,11 @@ public class HubActive { static public Optional timeToActive() { - Optional alliance = DriverStation.getAlliance(); + Alliance alliance = Robot.getAlliance(); // If we have no alliance, we cannot be enabled, therefore no hub. - if (alliance.isEmpty()) { - return Optional.empty(); - } + // if (alliance.isEmpty()) { + // return Optional.empty(); + // } // Hub is always enabled in autonomous. if (DriverStation.isAutonomousEnabled()) { return Optional.of(0.0); @@ -102,7 +103,7 @@ public class HubActive { } // Shift was is active for blue if red won auto, or red if blue won auto. - boolean shift1Active = switch (alliance.get()) { + boolean shift1Active = switch (alliance) { case Red -> !redInactiveFirst; case Blue -> redInactiveFirst; }; -- 2.39.5