Skip to content

Commit 7802103

Browse files
committed
fix(server): resolve two compile errors blocking CI
- GameOrchestrator: remove duplicate local 'cupName' declaration inside loadNextMap() lambda (variable already declared at top of block) - ElytraPhysicsSystem: replace player.isGliding() (not available in Minestom) with player.isOnGround() as the landing detection proxy; when the server confirms ground contact, flight.setFlying(false) is set so LandingResetSystem can detect the flying→landed transition
1 parent 82c98d6 commit 7802103

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

server/src/main/java/net/elytrarace/server/ecs/system/ElytraPhysicsSystem.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ public void process(Entity entity, float deltaTime) {
4747
var flight = entity.getComponent(ElytraFlightComponent.class);
4848
var playerRef = entity.getComponent(PlayerRefComponent.class);
4949

50-
if (!flight.isFlying()) {
51-
return;
50+
var player = playerRef.getPlayer();
51+
// Minestom does not expose isGliding(); use isOnGround() as the landing proxy.
52+
// When the server confirms the player has touched down, clear the flying flag so
53+
// LandingResetSystem detects the transition and resets per-map state.
54+
if (player.isOnGround()) {
55+
flight.setFlying(false);
5256
}
5357

54-
var player = playerRef.getPlayer();
55-
flight.setFlying(player.isGliding());
5658
if (!flight.isFlying()) {
5759
return;
5860
}

server/src/main/java/net/elytrarace/server/ecs/system/LandingResetSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* <p>
1818
* Landing is defined as the flying flag transitioning from {@code true} to
1919
* {@code false}. {@link ElytraPhysicsSystem} syncs this flag from
20-
* {@code player.isGliding()} every tick, so it always reflects the real state.
20+
* {@code player.isOnGround()} every tick, so it reflects the server-confirmed ground state.
2121
* <p>
2222
* Reset is skipped for players who have already finished the map
2323
* ({@link ScoreComponent#hasFinished()}), so a legitimate finish does not wipe

server/src/main/java/net/elytrarace/server/game/GameOrchestrator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ public CompletableFuture<Void> loadNextMap() {
334334
}
335335

336336
// Show HUD elements via each player's HudComponent
337-
String cupName = cupProgress.getCup().name();
338337
int mapIndex = cupProgress.getCurrentMapIndex() + 1;
339338
int totalMaps = cupProgress.totalMaps();
340339
for (Entity entity : entityManager.getEntities()) {

0 commit comments

Comments
 (0)