BramStoutProductions / MiEx

A modern Minecraft Exporter
BSD 3-Clause "New" or "Revised" License
55 stars 7 forks source link

Could not update base_resource_pack (faulty path on macOS) #3

Open OfficialCRUGG opened 5 months ago

OfficialCRUGG commented 5 months ago

When trying to update the base resource pack, I get an error. In the console I get:

Installing base_resource_pack
java.io.FileNotFoundException: null/.minecraft/versions/version_manifest_v2.json (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileReader.<init>(FileReader.java:75)
    at nl.bramstout.mcworldexporter.resourcepack.ResourcePack.updateBaseResourcePack(ResourcePack.java:328)
    at nl.bramstout.mcworldexporter.resourcepack.ResourcePack.setupDefaults(ResourcePack.java:238)
    at nl.bramstout.mcworldexporter.MCWorldExporter.<init>(MCWorldExporter.java:80)
    at nl.bramstout.mcworldexporter.MCWorldExporter.main(MCWorldExporter.java:159)
Installing base_resource_pack/miex_config.json
Installing base_resource_pack/materials/minecraft/templates/base.json
Installing base_resource_pack/materials/minecraft/templates/emission.json
Installing base_resource_pack/materials/minecraft/templates/grass_block_side.json
Installing base_resource_pack/materials/minecraft/templates/grass_block_snow.json
Can't find biome data for biome minecraft:plains
java.io.FileNotFoundException: null/.minecraft/versions/version_manifest_v2.json (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileReader.<init>(FileReader.java:75)
    at nl.bramstout.mcworldexporter.resourcepack.ResourcePack.updateBaseResourcePack(ResourcePack.java:328)
    at nl.bramstout.mcworldexporter.ui.ResourcePackManager$2.actionPerformed(ResourcePackManager.java:175)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
    at java.desktop/java.awt.Component.processEvent(Component.java:6391)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
java.io.IOException: Channel not open for writing - cannot extend file to required size
    at java.base/sun.nio.ch.FileChannelImpl.mapInternal(FileChannelImpl.java:1069)
    at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:1008)
    at nl.bramstout.mcworldexporter.world.anvil.ChunkAnvil._load(ChunkAnvil.java:96)
    at nl.bramstout.mcworldexporter.world.Chunk.load(Chunk.java:174)
    at nl.bramstout.mcworldexporter.ui.Renderer2D$LoadChunkTask.run(Renderer2D.java:260)
    at nl.bramstout.mcworldexporter.parallel.ThreadPool$Worker.run(ThreadPool.java:121)
    at java.base/java.lang.Thread.run(Thread.java:833)
java.io.IOException: Channel not open for writing - cannot extend file to required size
    at java.base/sun.nio.ch.FileChannelImpl.mapInternal(FileChannelImpl.java:1069)
    at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:1008)
    at nl.bramstout.mcworldexporter.world.anvil.ChunkAnvil._load(ChunkAnvil.java:281)
    at nl.bramstout.mcworldexporter.world.Chunk.load(Chunk.java:174)
    at nl.bramstout.mcworldexporter.ui.Renderer2D$LoadChunkTask.run(Renderer2D.java:260)
    at nl.bramstout.mcworldexporter.parallel.ThreadPool$Worker.run(ThreadPool.java:121)
    at java.base/java.lang.Thread.run(Thread.java:833)

It appears, there is a faulty path (null/.minecraft/versions/version_manifest_v2.json) I am on macOS Sonoma. The correct base path would be ~/Library/Application Support/minecraft (/Users/<user>/Library/Application Support/minecraft)

BramStout commented 5 months ago

Hi, I have just released a new version that should now be able to find the Minecraft install on MacOS. You can find it here: https://github.com/BramStoutProductions/MiEx/releases/tag/v1.2.1

Please let me know whether it works now!

mrfireflyer commented 5 months ago

Just downloaded v1.2.2 and still having the same issue. MiEx "could not find a Minecraft Java Edition install so cannot automatically create a base_resource_pack..."

Fyoncle commented 5 months ago

Just downloaded v1.2.2 and still having the same issue. MiEx "could not find a Minecraft Java Edition install so cannot automatically create a base_resource_pack..."

Can you try https://github.com/BramStoutProductions/MiEx/releases/tag/v1.4.0 ?

BramStout commented 5 months ago

Just downloaded v1.2.2 and still having the same issue. MiEx "could not find a Minecraft Java Edition install so cannot automatically create a base_resource_pack..."

If this issue is still happening in the latest version of MiEx, would you be able to try specifying the MIEX_MINECRAFT_VERSIONS_DIR environment variable or the -mcVersionsDir <path> command-line argument, which then points to the versions folder in your Minecraft install? If you find a path that works, would you then be able to share it here? I don't have access to MacOS myself, but if I can get a path to the versions folder that works on MacOS, then I can update MiEx to better be able to find it on its own.

mrfireflyer commented 5 months ago

Issue is still happening in v1.4.0. Tried doing some stuff with the environment variable and command-line argument. I have little experience, so I don't know if it's not working or if I'm doing it wrong.

On another note, I found the "resources" folder generates in the private section on MacOS. This made it really difficult to find, but I was able to backtrack after finding where MiEx exports files. I haven't been able to get the base resource pack working manually. I made a testing resource pack using Minecraft assets and put that into the "resources" folder and that looks to be working.

I was also able to find this log which looks different than the log OfficialCRUGG opened up the issue with. Might be helpful so I put it here:

Installing base_resource_pack
java.lang.NullPointerException: Cannot invoke "nl.bramstout.mcworldexporter.world.World.getHeight(int, int)" because the return value of "nl.bramstout.mcworldexporter.MCWorldExporter.getWorld()" is null
    at nl.bramstout.mcworldexporter.export.Exporter.export(Exporter.java:81)
    at nl.bramstout.mcworldexporter.ui.ToolBar$20.actionPerformed(ToolBar.java:725)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
    at java.desktop/java.awt.Component.processEvent(Component.java:6391)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
BramStout commented 5 months ago

Issue is still happening in v1.4.0. Tried doing some stuff with the environment variable and command-line argument. I have little experience, so I don't know if it's not working or if I'm doing it wrong.

On another note, I found the "resources" folder generates in the private section on MacOS. This made it really difficult to find, but I was able to backtrack after finding where MiEx exports files. I haven't been able to get the base resource pack working manually. I made a testing resource pack using Minecraft assets and put that into the "resources" folder and that looks to be working.

I was also able to find this log which looks different than the log OfficialCRUGG opened up the issue with. Might be helpful so I put it here:

Installing base_resource_pack
java.lang.NullPointerException: Cannot invoke "nl.bramstout.mcworldexporter.world.World.getHeight(int, int)" because the return value of "nl.bramstout.mcworldexporter.MCWorldExporter.getWorld()" is null
  at nl.bramstout.mcworldexporter.export.Exporter.export(Exporter.java:81)
  at nl.bramstout.mcworldexporter.ui.ToolBar$20.actionPerformed(ToolBar.java:725)
  at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
  at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
  at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
  at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
  at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
  at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
  at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
  at java.desktop/java.awt.Component.processEvent(Component.java:6391)
  at java.desktop/java.awt.Container.processEvent(Container.java:2266)
  at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
  at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
  at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
  at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
  at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
  at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
  at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
  at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
  at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
  at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
  at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
  at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
  at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
  at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
  at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
  at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
  at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
  at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
  at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
  at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
  at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

The exception displayed in the log that you've shared has been fixed in the latest release.

Regarding the actual issue here if MiEx not working well on MacOS; It looks like MacOS works quite a bit differently from both Windows and Linux which would require some additional code to make it work well on MacOS. Unfortunately, I don't have access to MacOS myself and so I can't fix this at this moment. Maybe there's somebody else who knows Java and has access to MacOS who could submit a fix for it. If I ever get access to MacOS, I'll fix it immediately.

Luckily though, MiEx only needs access to a Minecraft installation in order to automatically extract the base_resource_pack from the Minecraft jar file. If you manually create it, then MiEx should just work. It's far from ideal, but at least it's something.

If you do end up figuring some stuff out regarding MiEx and MacOS, please share it here so that I can include it in a next release to hopefully improve MacOS support!