Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to find textures: "java.io.FileNotFoundException: Couldn't find assets/minecraft/textures/..." #179

Closed
andykais opened this issue Dec 8, 2021 · 8 comments

Comments

@andykais
Copy link

andykais commented Dec 8, 2021

I ran this command:
obj-exporter# java -jar jMc2Obj-115.jar --output=output --chunks=-1,-1,1,1 minecraft-server/world
(where minecraft-server is a minecraft server running 1.18, and world is the world folder.

these are the logs I received:
j-mc-2-obj-error.log

it is worth noting that this was a server running 1.17 that I upgraded to 1.18. There are both 1.17 and 1.18 generated chunks being converted to obj.

@andykais
Copy link
Author

andykais commented Dec 8, 2021

additional info:
java -version

openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17+35-Ubuntu-120.04, mixed mode, sharing)
root@ubuntu-s-4vcpu-8gb-amd-nyc1-01:~#

minecraft server version minecraft_server.1.18.jar

running Version 115 of j-mc-2-obj

@mmdanggg2
Copy link
Collaborator

Does it work ok with the gui, not using command line? Do you have minecraft 1.18 installed, seems like it can't find the minecraft .jar. If you do have it, maybe try setting the 1.18.jar file as the --texturepack argument.

@andykais
Copy link
Author

andykais commented Dec 9, 2021

oh of course. That makes sense. My minecraft server is in this folder minecraft-server/minecraft_server.1.18.jar. This is running on a remote server, so it cant just use a launcher version of minecraft. Interestingly it doesnt look like you actually read the --texturepack argument https://github.com/jmc2obj/j-mc-2-obj/blob/master/src/org/jmc/CmdLineParser.java

Error: Unrecognized option: --texturepack=minecraft-server/minecraft_server.1.18.jar

despite it still being included in the --help output

I guess

  1. has --texturepack been superseded by something?
  2. is this program able to work just using a server version of minecraft?

@mmdanggg2
Copy link
Collaborator

You're right, I changed it to --resourcepack, didn't update the help printout. It does have to be the client .jar because the server doesn't inclue any models or textures. Technically you could use/create a resource pack instead, as long as it includes models and textures for all the blocks you want to export.

mmdanggg2 added a commit that referenced this issue Dec 14, 2021
Update command line help text
Should address #179
@andykais
Copy link
Author

andykais commented Dec 15, 2021

alright. I tried downloading what I believe is the default resource pack. I got it here https://texture-packs.com/resourcepack/default-pack/. I have tried every variation of this command

java -jar jMc2Obj-115.jar --output=output --chunks=-1,-1,1,1 --resourcepack=~/minecraft-default-texture-pack-1.18/ minecraft-server/world

e.g.

  • --resourcepack=~/minecraft-default-texture-pack-1.18.zip
  • --resourcepack=~/minecraft-default-texture-pack-1.18/assets/minecraft
  • --resourcepack=minecraft-default-texture-pack-1.18/assets/minecraft/textures
  • --resourcepack=minecraft-default-texture-pack-1.18/pack.mcmeta

They all produce the same initial error.

folder structure of the resource pack in question: tree.txt

@andykais
Copy link
Author

andykais commented Dec 15, 2021

update: I tried one more command where my cwd is in the resource pack in question.

root:~/minecraft-default-texture-pack-1.18# java -jar ~/minecraft-discord-bot/obj-exporter/jMc2Obj-115.jar --output=/root/obj-output --chunks=-1,-1,1,1 --resourcepack=~/minecraft-default-texture-pack-1.18/pack.mcmeta ~/minecraft-discord-bot/minecraft-server/world

so errors like this one:

..........................Couldn't export texture minecraft:block/lava_still
java.io.FileNotFoundException: Couldn't find assets/minecraft/textures/block/lava_still.png in current resource packs
	at org.jmc.util.ResourcePackIO.loadResource(ResourcePackIO.java:71)
	at org.jmc.util.ResourcePackIO.loadResourceAsStream(ResourcePackIO.java:43)
	at org.jmc.util.ResourcePackIO.loadImage(ResourcePackIO.java:26)
	at org.jmc.registry.TextureEntry.getImage(TextureEntry.java:108)
	at org.jmc.TextureExporter.exportTextures(TextureExporter.java:155)
	at org.jmc.ObjExporter.export(ObjExporter.java:391)
	at org.jmc.Main.runConsole(Main.java:107)
	at org.jmc.Main.main(Main.java:50)
..........................]

dont make a lot of sense since the path it is erroring on is exactly the path in the cwd.

root:~/minecraft-default-texture-pack-1.18# ls assets/minecraft/textures/block/lava_still.png
assets/minecraft/textures/block/lava_still.png

all I can think of is that somewhere in this program we are setting the cwd to something else

@mmdanggg2
Copy link
Collaborator

mmdanggg2 commented Dec 15, 2021

I think your problem is because you are not specifying the pack with a real path but instead with the tilde which according to this will not always be expanded to a full path depending on your shell so jmc can't find the pack.
The paths it gives in those errors are relative to the resource packs, since you can specify multiple and they are usually zipped.

if in the home directory I have these files

james@James-PC:~$ ls -l
total 24712
-rwxr-xr-x 1 james james 20038427 Dec 15 22:31 1.18.jar
drwxr-xr-x 1 james james     4096 Dec 15 22:32 conf
-rwxr-xr-x 1 james james  1144749 Dec 15 22:28 jMc2Obj-115.jar
-rw-r--r-- 1 james james     6259 Dec 15 22:35 minecraft.mtl
-rw-r--r-- 1 james james        0 Dec 15 22:36 minecraft.obj
drwxr-xr-x 1 james james     4096 Dec 15 22:32 tex

Trying these different versions of the command you see the ~ causes the problem:

james@James-PC:~$ java -jar jMc2Obj-115.jar --resourcepack=1.18.jar /path/to/world/
james@James-PC:~$ java -jar jMc2Obj-115.jar --resourcepack=./1.18.jar /path/to/world/
james@James-PC:~$ java -jar jMc2Obj-115.jar --resourcepack=/home/james/1.18.jar /path/to/world/
james@James-PC:~$ java -jar jMc2Obj-115.jar --resourcepack=$HOME/1.18.jar /path/to/world/

james@James-PC:~$ java -jar jMc2Obj-115.jar --resourcepack=~/1.18.jar /path/to/world/

They all work except the last one with the ~

The files in the zip look like it should work instead of just the actual minecraft jar. Also as a note, I would recommend pointing it to the zip/jar file, it should work pointing to an extracted pack folder or the pack.mcmeta within an extracted pack folder but it's not so well tested.

@andykais
Copy link
Author

Screen Shot 2021-12-16 at 9 48 16 AM

that was it! Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants