Closed keplersj closed 7 years ago
So I suppose we could read the whole folder in the "current resourcepack", and load the materials and blocks dynamically? They could be indexed by what they're made of, that should still be unique. Instead of our unlocalized material and block names, we could just use the block for from the crafting recipe.
PROBLEM: Assets are client-only
Servers can access the assets directory in the Jarfile. I was just going to have so that the mod recursively searches the JSON asset directory and load accordingly.
What if a resourcepack wants to change it?
Hmm... I don't think it will matter for the most part because the mod will have already loaded the JSON before the client makes its changes.
Then there would be discrepancies between the client and server. What if a resourcepack sets the crash resistance to 100? When you crash, the boat is fine on the client but broken on the server Instead of assets, it should be in a config file, but then defaults become problematic...
Could move them to just be in the jar, seperate from assets.
And then unzip them into the config directory? That could work, if you know how to unzip stuff...
Why not just read from the JAR?
So, you intend to keep it immutable, only instead of in new classes the new materials shall be defined through JSON?
Yeah. Less compiling. Less code to update. Just a JSON spec to maintain.
One day though. I can see making a mutable way of doing it.
So, all that's left is to read find a way to read the JSON from the mod jar. You have fun with that, I failed.
Oopsie, it seems that forEach() is only available in Java 8. I'm sure that can be replaced with a range for. I currently only have access to my mobile internet with limited bandwidth, so I don't want to do git pushes and pulls.
forEach() is Java 8. foreach() is Scala.
See wercker.
Yes. I saw the error. We can still use the code, it just needs to use the Scala syntax, not the Java 8 syntax.
What exactly is left to do?
Leaving this branch up, but closing this PR because it's grown stale.
Which part of this project hasn't?
Vilim Lendvaj On 17-Jul-16 8:46 AM, Kepler Sticka-Jones wrote:
Leaving this branch up, but closing this PR because it's grown stale.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Open-Code-Developers/BoatCraft/pull/253#issuecomment-233168128, or mute the thread https://github.com/notifications/unsubscribe-auth/ACkvcuCkS_VvqGK29lZDxmkuFHIz2Veuks5qWc_MgaJpZM4DsuQP.
This should clean up the code base up a bit I hope and make expanding the mod, and moving forward in the future, less painful.