Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

    Hello, I do not normally post on the forums because almost every question I have to ask is pretty much already answered, but I am having a rather frustrating issue with the way textures are being loaded by my mod. I currently am developing alongside a graphic designer a mod which is distributed via a custom launcher to players when we release an update.  Currently we have to include the textures and language assets directly in the released jar file for them to load properly in a production build (this is the norm).

 

    The reason this is a problem is because I want to be able to only send updated assets to clients instead of the entire package (which could soon exceed 40+ MB by itself).  With the current system I have to send the entire packaged jar to every player every time we release an update.  This is very inefficient and a total waste of good bandwidth since the mod code itself is only around 200KB.

 

    My first idea was to simply move the assets into the "mods" directory and preceed the ResourceLocation constructor's resource path (not resource domain) with the correct parent directory chain (../).  However, having a ResourceLocation(ASSET_ROOT, "../../../textures/blah/blah/blah.png") to get outside of the jar file does not work.

 

    My next idea is to have our custom launcher dynamically rebuild the downloaded mod.jar file with the proper assets that are on our servers.  This, however, is a major pain in the butt and I really do not want to have to implement such a complex solution for something that should be very simple.

   

TL;DR

    I need a way to access textures, sounds and other resources outside of the distributed mod.jar file so that they can be dynamically updated by a custom client without having to re-download the entire jar.

 

    Does anyone have any solutions to this?  If you need any more information let me know, but I feel like I am overlooking something very simple in order to get these textures loaded properly.  Thank you for the long read, I know it was not the most interesting.

 

Edit: Now that I think about it some more, I wouldn't mind using a custom resource pack, but I don't know how to access it from within my mod.  I will do some research on that.

Create a custom ResourcePack just like FML does for every mod jar.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

Wow, totally overlooked that interface.  Thank you very much for the lead!

  • Author

Brilliant, thank you!  It works perfectly and I can now access all of the files through a custom IResourcePack instance (maybe even files on the web).  I just have one question.  Currently I load my implementation through the following call

 

((SimpleReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).reloadResourcePack(IResourcePack)

 

Is this the correct way of doing it.  It works perfectly, but I just want to make sure I am following the correct methods.  And once again, thank you so much for that hint.

  • Author

Final shameless bump to see if anyone has an answer to the last question.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.