|
49 | 49 | import javafx.stage.Stage; |
50 | 50 | import javafx.util.converter.NumberStringConverter; |
51 | 51 | import se.llbit.chunky.PersistentSettings; |
| 52 | +import se.llbit.chunky.block.Block; |
52 | 53 | import se.llbit.chunky.launcher.LauncherSettings; |
53 | 54 | import se.llbit.chunky.main.Chunky; |
54 | 55 | import se.llbit.chunky.map.WorldMapLoader; |
|
57 | 58 | import se.llbit.chunky.renderer.scene.AsynchronousSceneManager; |
58 | 59 | import se.llbit.chunky.renderer.scene.Camera; |
59 | 60 | import se.llbit.chunky.ui.render.RenderControlsFx; |
60 | | -import se.llbit.chunky.block.Block; |
61 | 61 | import se.llbit.chunky.world.ChunkPosition; |
62 | 62 | import se.llbit.chunky.world.ChunkSelectionListener; |
63 | 63 | import se.llbit.chunky.world.ChunkView; |
64 | 64 | import se.llbit.chunky.world.Icon; |
65 | 65 | import se.llbit.chunky.world.World; |
66 | 66 | import se.llbit.chunky.world.listeners.ChunkUpdateListener; |
67 | | -import se.llbit.fx.LuxColorPalette; |
68 | 67 | import se.llbit.fx.LuxColorPicker; |
69 | 68 | import se.llbit.fxutil.GroupedChangeListener; |
70 | 69 | import se.llbit.log.Level; |
@@ -276,7 +275,7 @@ public ChunkyFxController(Chunky chunky) { |
276 | 275 | alert.setTitle("Delete Selected Chunks"); |
277 | 276 | alert.setContentText( |
278 | 277 | "Do you really want to delete the selected chunks? This can not be undone."); |
279 | | - if (alert.showAndWait().get() == ButtonType.OK) { |
| 278 | + if (alert.showAndWait().orElse(ButtonType.CANCEL) == ButtonType.OK) { |
280 | 279 | mapLoader.deleteSelectedChunks(ProgressTracker.NONE); |
281 | 280 | } |
282 | 281 | }); |
@@ -502,7 +501,7 @@ public void createNew3DScene() { |
502 | 501 | alert.setHeaderText("Overwrite existing scene?"); |
503 | 502 | alert.setContentText( |
504 | 503 | "It seems like a scene already exists. Do you wish to overwrite it?"); |
505 | | - if (alert.showAndWait().get() != ButtonType.OK) { |
| 504 | + if (alert.showAndWait().orElse(ButtonType.CANCEL) != ButtonType.OK) { |
506 | 505 | return; |
507 | 506 | } |
508 | 507 | } |
|
0 commit comments