-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: improve display of flight plan load errors
Signed-off-by: Octol1ttle <[email protected]>
- Loading branch information
1 parent
631185b
commit cc749f6
Showing
7 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/ru/octol1ttle/flightassistant/serialization/FlightPlanLoadResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package ru.octol1ttle.flightassistant.serialization; | ||
|
||
import java.util.List; | ||
import net.minecraft.text.Text; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import ru.octol1ttle.flightassistant.computers.navigation.Waypoint; | ||
|
||
public class FlightPlanLoadResult { | ||
private final @Nullable List<Waypoint> loaded; | ||
private final LoadResultType type; | ||
|
||
public FlightPlanLoadResult(@Nullable List<Waypoint> loaded, @NotNull LoadResultType type) { | ||
this.loaded = loaded; | ||
this.type = type; | ||
} | ||
|
||
public List<Waypoint> getWaypoints() { | ||
return loaded; | ||
} | ||
|
||
public LoadResultType getType() { | ||
return type; | ||
} | ||
|
||
public enum LoadResultType { | ||
SUCCESS(Text.translatable("commands.flightassistant.flight_plan_loaded")), | ||
NOT_FOUND(Text.translatable("commands.flightassistant.flight_plan_not_found")), | ||
NBT_NOT_SUPPORTED(Text.translatable("commands.flightassistant.flight_plan_not_supported")), | ||
ERROR(Text.translatable("commands.flightassistant.flight_plan_load_error")); | ||
|
||
private final Text text; | ||
|
||
LoadResultType(Text text) { | ||
this.text = text; | ||
} | ||
|
||
public Text getText() { | ||
return text; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters