@@ -122,12 +122,14 @@ public static void addSelectedUnit(LivingEntity unit) {
122
122
selectedUnits .sort (Comparator .comparing (HudClientEvents ::getSimpleEntityName ));
123
123
selectedUnits .sort (Comparator .comparing (Entity ::getId ));
124
124
BuildingClientEvents .clearSelectedBuildings ();
125
+ NonUnitClientEvents .isMoveCheckpointGreen = true ;
125
126
}
126
127
public static void clearPreselectedUnits () {
127
128
preselectedUnits .clear ();
128
129
}
129
130
public static void clearSelectedUnits () {
130
131
selectedUnits .clear ();
132
+ NonUnitClientEvents .isMoveCheckpointGreen = true ;
131
133
}
132
134
133
135
private static long lastLeftClickTime = 0 ; // to track double clicks
@@ -325,13 +327,7 @@ MC.level, selectedUnits, getPreselectedBlockPos()
325
327
int entityId = pair .getFirst ();
326
328
BlockPos targetPos = pair .getSecond ();
327
329
Entity entity = MC .level .getEntity (entityId );
328
- if (entity instanceof Unit unit &&
329
- unit .getMoveGoal () != null ) {
330
-
331
- //sendUnitCommandManual(UnitAction.MOVE, -1, new int[]{entityId}, targetPos, true, false);
332
-
333
- sendUnitCommandManual (UnitAction .MOVE , -1 , new int []{entityId }, targetPos );
334
- }
330
+ sendUnitCommandManual (UnitAction .MOVE , -1 , new int []{entityId }, targetPos );
335
331
}
336
332
for (LivingEntity le : selectedUnits )
337
333
if (le instanceof Unit unit && unit .getMoveGoal () != null )
@@ -574,10 +570,10 @@ else if (selectedUnits.size() == 1 && MC.level != null && !Keybindings.shiftMod.
574
570
selectedUnits .get (0 ).getClass (),
575
571
MC .level
576
572
);
577
- if (getPlayerToEntityRelationship (selectedUnit ) == Relationship .OWNED ) {
573
+ if (getPlayerToEntityRelationship (selectedUnit ) == Relationship .OWNED || NonUnitClientEvents . canControlNonUnits () ) {
578
574
clearSelectedUnits ();
579
575
for (LivingEntity entity : nearbyEntities )
580
- if (getPlayerToEntityRelationship (entity ) == Relationship .OWNED )
576
+ if (getPlayerToEntityRelationship (entity ) == Relationship .OWNED || NonUnitClientEvents . canControlNonUnits () )
581
577
addSelectedUnit (entity );
582
578
HudClientEvents .setLowestCdHudEntity ();
583
579
}
@@ -610,8 +606,11 @@ else if (!deselected) { // select a single unit - this should be the only code p
610
606
}
611
607
// deselect any non-owned units if we managed to select them with owned units
612
608
// and disallow selecting > 1 non-owned unit or the client player
613
- if (selectedUnits .size () > 1 )
614
- selectedUnits .removeIf (e -> getPlayerToEntityRelationship (e ) != Relationship .OWNED || e .getId () == MC .player .getId ());
609
+ if (selectedUnits .size () > 1 ) {
610
+ selectedUnits .removeIf (e ->
611
+ (getPlayerToEntityRelationship (e ) != Relationship .OWNED && !NonUnitClientEvents .canControlNonUnits ()) || e .getId () == MC .player .getId ()
612
+ );
613
+ }
615
614
616
615
lastLeftClickTime = System .currentTimeMillis ();
617
616
}
0 commit comments