MinicraftPlus / minicraft-plus-revived

Minicraft+, an extension of Notch's original minicraft project, with tons more features.
GNU General Public License v3.0
466 stars 93 forks source link

Canvas Initialization Failure on macOS Sonoma #576

Closed Kurtjwest closed 10 months ago

Kurtjwest commented 10 months ago

Describe the bug Minicraft crashes seconds after starting

To Reproduce Steps to reproduce the behavior:

  1. open jar from finder
  2. Receive: "Crash Unexpected Error" "Canvas Initiation Failure" "The canvas is unable to be initialized." "java.awt.AWTException: Only double buffering is supported at java.desktop/sun.java2d.metal.MTLGraphicsConfig.assertOperationSupported(MTLGraphicsConfig.java:274) at java.desktop/sun.lwawt.LWComponentPeer.createBuffers(LWComponentPeer.java:515) at java.desktop/java.awt.Component$FlipBufferStrategy.createBuffers(Component.java:4117) at java.desktop/java.awt.Component$FlipBufferStrategy.(Component.java:4059) at java.desktop/java.awt.Component$FlipSubRegionBufferStrategy.(Component.java:4593) at java.desktop/java.awt.Component.createBufferStrategy(Component.java:3922) at java.desktop/java.awt.Canvas.createBufferStrategy(Canvas.java:201) at minicraft.core.Renderer.initScreen(Renderer.java:114) at minicraft.core.Game.main(Game.java:80) "

Expected behavior The game to start

Screenshots

Screenshot 2023-10-13 at 11 12 21 PM

Desktop (please complete the following information):

Kurtjwest commented 10 months ago

when run in terminal it additionally says: "2023-10-13 23:24:40.482 java[40757:753337] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:."

BenCheung0422 commented 10 months ago

Duplicate of #465

BenCheung0422 commented 10 months ago

when run in terminal it additionally says: "2023-10-13 23:24:40.482 java[40757:753337] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:."

For this warning, it is common for all Java (even non-Java, but it may be more difficult to be resolved in higher level programming languages) applications nowadays on macOS 14 (since a warning is emitted). This might need to be discussed later.

BenCheung0422 commented 10 months ago

There is seemingly no such a solution for languages that are built from C/C++/Objective C suppressing the warning about macOS secure coding. It is currently unresolvable. At the same time, this does not affect application running normally.