Applied Energistics 2

Applied Energistics 2

137M Downloads

Adding AE2 disables Liahim85's mods models/textures

davqvist opened this issue ยท 7 comments

commented

Description

Environment

  • Minecraft Version: 1.12.1
  • AE2 Version: rv5-alpha-4
  • Forge Version: 2485

Mods from Liahim85 like Misty World are working fine until I add AE2 and then 80% of the textures are broken. Log says it can't read the model json anymore.
Please read Liahim85/MistyWorld_Open#10 for details.
Liahim85 doesn't know why it is happening. Maybe you have an idea why this is happening.

commented

An easy way would be tail -c +4 fileWithBOM> fileWithoutBOM. But that is completely unconditional and throws the first 4 bytes of any file away. Thus applying it to files without BOM it will most likely corrupt them. You could combine it with file fileWithBOM which will generate some output contain (with BOM) as part of it. Of course this requires linux or at least something like cygwin for windows (git for windows contains it as part of the git bash).

And then just use something like this to remove it from all files in the current directory.

for file in .
do
   tail -c +4 $f > $f
done

Of course no gurantees that it works.

A quick google search might even provide a couple of ready to use scripts, which are tested and can probably also check for an actual BOM before changing it. But I do not have any at hand currently.

As a quick note. Using a fast return to ignore any resources outside of the AE2 jar is possible, but would be really dumb. It is perfectly fine for AE2 addons to reuse it for their models should they want to use our custom lightmaps. Without having to reimplement everything or reflecting into our core code and potentially break randomly. It would just be an annoyance for them.

commented

A one-line solution:

  • Search in current directory ./, all files ending with .json (You may want to adapt it, to your Jison files extension).
  • Process each file with dos2unix utility, to remove Byte Order Mark if there is one.
find ./ -type f -iname \*.json -exec dos2unix --remove-bom {} \;
commented

@Liahim85 This due to using BOM for the json files which is explicitly not supported by GSON in any means. Vanilla might be a bit more forgiving. But suppressing an actual issue is never a good option and it can certainly also happen with the forge_marker, which are using a similar approach. Or at any point in the future should mojang/forge decide to enforce standards.

commented

What do you recommend to do with my json?

commented

remove the BOM?

commented

Can this be done automatically. There are so many of these files!
Maybe I need to change something in gradlew.bat?
I'm not very versed in the format of json.
Thank you )

commented

Thank you all!
Fixed.