keplersj / BoatCraft

Rails had their turn, now out to the Minecraftian seas.
MIT License
6 stars 7 forks source link

Transition Materials to a JSON based format. #253

Closed keplersj closed 7 years ago

keplersj commented 9 years ago

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.

viliml commented 9 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.

viliml commented 9 years ago

PROBLEM: Assets are client-only

keplersj commented 9 years ago

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.

viliml commented 9 years ago

What if a resourcepack wants to change it?

keplersj commented 9 years ago

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.

viliml commented 9 years ago

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...

keplersj commented 9 years ago

Could move them to just be in the jar, seperate from assets.

viliml commented 9 years ago

And then unzip them into the config directory? That could work, if you know how to unzip stuff...

keplersj commented 9 years ago

Why not just read from the JAR?

viliml commented 9 years ago

So, you intend to keep it immutable, only instead of in new classes the new materials shall be defined through JSON?

keplersj commented 9 years ago

Yeah. Less compiling. Less code to update. Just a JSON spec to maintain.

keplersj commented 9 years ago

One day though. I can see making a mutable way of doing it.

viliml commented 9 years ago

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.

viliml commented 9 years ago

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.

keplersj commented 9 years ago

forEach() is Java 8. foreach() is Scala.

viliml commented 9 years ago

See wercker.

keplersj commented 9 years ago

Yes. I saw the error. We can still use the code, it just needs to use the Scala syntax, not the Java 8 syntax.

viliml commented 9 years ago

What exactly is left to do?

keplersj commented 7 years ago

Leaving this branch up, but closing this PR because it's grown stale.

viliml commented 7 years ago

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.