Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Textures with dynamic paths


Xie
 Share

Recommended Posts

I'm having a problem with dynamic pathing for texture files. For example, say I have a bunch of textures in .minecraft/mods/Xie/... somewhere, but I don't know where they'll be until runtime, and I don't want to have to cram them all into the minecraft.jar. In the past, I was able to provide the path relative to the mod .zip file, and the class loader found it. Is this still the case and I'm a total noob, or is there another way and I'm only slightly noob? :P

 

Apologies if this question has been answered somewhere else, I did look, promise. Also I love the new Forge, keep up the good work ;)

Link to comment
Share on other sites

Sorry, I should have framed my question better. My mod doesn't come with any textures built in, you install whatever content you like and it gets dynamically added at runtime. In the past users installed content for my mod (plain text and textures) by copying it into ./mods/Xie/. So I was hoping for a way to refer to textures not inside the .jar or .zip.

 

It's all good, if I can't figure it out we'll just have to install content files into the mod zip instead.

 

Cheers for the quick reply.

Link to comment
Share on other sites

You could always use the net.minecraft.src.client.Minecraft.getMinecraftDir(); I believe it was like that, but it could be something similar, it's been a while since I had to use it. After that, you just make a file using that folder, then adding the rest of the path you want, like: "folder/another folder/as many folders as you need/file.extention". That should work, and if it doesn't, just ask again, and I'll try to do my best to help you.

Link to comment
Share on other sites

You'd have to add your folders specfically to the class path and then tell MC to load then properly.

There isnt much I can do to explain basic of java to you.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • 1.14 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • So I create my server and everything goes well, until I run the run.bat file which contains java -Xmx3072M -Xms3072M -jar forgeserver.jar nogui PAUSE I run that and then I get this out of the commands prompt Desktop\forge 1.14.4 server>java -Xmx3072M -Xms3072M -jar forgeserver.jar nogui 2021-10-15 17:55:54,519 main WARN Advanced terminal features are not available in this environment ←[32m[17:55:54] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 28.2.0, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, nogui] ←[m←[32m[17:55:54] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 15.0.2 by Oracle Corporation ←[m←[32m[17:55:54] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust ←[mException in thread "main" ←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]: java.lang.NoClassDefFoundError: jdk/nashorn/api/scripting/NashornScriptEngineFactory ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.coremod.CoreModEngine.loadCoreMod(CoreModEngine.java:48) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.coremod.CoreModProvider.addCoreMod(CoreModProvider.java:12) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.fml.loading.LoadingModList.addCoreMods(LoadingModList.java:88) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:125) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:208) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.fml.loading.FMLServiceProvider.runScan(FMLServiceProvider.java:105) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:111) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:115) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1766) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:116) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:63) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at cpw.mods.modlauncher.Launcher.run(Launcher.java:75) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1048]:       at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]: Caused by: java.lang.ClassNotFoundException: jdk.nashorn.api.scripting.NashornScriptEngineFactory ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]:       at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]:       at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]:       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ←[m←[32m[17:55:55] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1057]:       ... 35 more ←[m
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • What version of Minecraft are you using? Have you bothered to look at the food method for hints?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.