piegamesde / BlockMap

An out-of-game map renderer and viewer for Minecraft 1.13–1.18 worlds [unmaintained]
MIT License
92 stars 22 forks source link

Could not show 'open' dialog #75

Closed ShingZhanho closed 2 years ago

ShingZhanho commented 2 years ago

Environment info

Description

When the program runs for the first time, it works fine. But after exiting and launching the program for the second time, it shows the error "Could not show 'open' dialog", which prevents me from loading any other worlds into the program.

Steps to reproduce

  1. Load a world into the program (which is from the server client in my case.)
  2. Close the program.
  3. Open it again, and it shows the error.

Expected result:

Show 'open' dialog and let me load a world.

Screenshots

image

Debug log

Feb 16, 2022 8:57:17 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @4e004cf8'
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
22-02-16 08:57:20 INFO  RegionFolderCache [73] - Removed 0 worlds from cache
22-02-16 08:57:23 ERROR GuiController [375] - Could not show 'open' dialog, please file a bug report
java.lang.NullPointerException: Cannot invoke "java.util.Optional.map(java.util.function.Function)" because "item.iconURL" is null
        at de.piegames.blockmap.gui.standalone.OpenDialog$MinecraftListCell.updateItem(OpenDialog.java:247) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at de.piegames.blockmap.gui.standalone.OpenDialog$MinecraftListCell.updateItem(OpenDialog.java:207) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.ListCell.updateItem(ListCell.java:481) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.ListCell.indexChanged(ListCell.java:337) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:120) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1807) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.getCell(VirtualFlow.java:1791) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.getOrCreateCellSize(VirtualFlow.java:2966) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.getOrCreateCellSize(VirtualFlow.java:2949) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.recalculateAndImproveEstimatedSize(VirtualFlow.java:3021) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.recalculateEstimatedSize(VirtualFlow.java:3013) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1052) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow$5.invalidated(VirtualFlow.java:885) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:113) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:148) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.VirtualFlow.setCellCount(VirtualFlow.java:899) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.ListViewSkin.updateItemCount(ListViewSkin.java:357) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.skin.ListViewSkin.<init>(ListViewSkin.java:241) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.ListView.createDefaultSkin(ListView.java:989) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.Control.doProcessCSS(Control.java:897) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.Control$1.doProcessCSS(Control.java:89) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:67) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:146) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Parent.doProcessCSS(Parent.java:1400) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Parent$1.doProcessCSS(Parent.java:125) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:146) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Parent.doProcessCSS(Parent.java:1400) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Parent$1.doProcessCSS(Parent.java:125) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:146) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Node.processCSS(Node.java:9456) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Scene.doCSSPass(Scene.java:572) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Scene.preferredSize(Scene.java:1774) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.Scene$2.preferredSize(Scene.java:396) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:66) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.stage.Window$12.invalidated(Window.java:1114) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.stage.Window.setShowing(Window.java:1190) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.stage.Window.show(Window.java:1205) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.stage.Stage.show(Stage.java:273) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.stage.Stage.showAndWait(Stage.java:463) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at javafx.scene.control.Dialog.showAndWait(Dialog.java:346) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at de.piegames.blockmap.gui.standalone.GuiController.showLoadDialog(GuiController.java:373) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at de.piegames.blockmap.gui.standalone.GuiMain.lambda$start$3(GuiMain.java:94) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at java.util.Optional.ifPresentOrElse(Optional.java:198) ~[?:?]
        at de.piegames.blockmap.gui.standalone.GuiMain.start(GuiMain.java:89) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) ~[BlockMap-gui-2.4.0-windows.jar:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
piegamesde commented 2 years ago

I ran into this too not long ago. I hope that I can have a look at this soon because it's a total show breaker.

piegamesde commented 2 years ago

The issue happens when you load a (corrupt) world where no preview image could be generated. Deleting your history in .cache/blockmap/recent.json should temporarily resolve the issue. Alternatively, you can edit besaid JSON file so that every entry contains an iconURL field.

ShingZhanho commented 2 years ago

On my Windows machine, it doesn't even have the .cache/blockmap directory under C:\Users\<User>. But 79d471497430bfe9e09e858a80fde4d5adbde646 worked just fine on my Ubuntu machine. Thanks for the fix.

piegamesde commented 2 years ago

Oh sorry, I hadn't checked that you're on Windows. So basically the file is blockmap/recent.json relative to wherever your OS usually puts application cache data.

velzenor commented 2 years ago

For anyone in the same boat, the json file was in C:\Users\<User>\AppData\Local\piegames\blockmap\cache on my Windows 10 machine. Deleting that worked for me.

piegamesde commented 2 years ago

I released version 2.4.1, containing the fix. (Windows build will be uploaded during the next days)

ShingZhanho commented 2 years ago

I've managed to build the Windows binary on my machine

BlockMap-gui-2.4.1-windows.zip

Do rename the file extension to .jar by the way, since that is not supported in issues.