Jump to content

Updating to 1.11: File Contents to lowercase


Tschipp

Recommended Posts

I am in the process of updating my 1.10 mod to 1.11. I used uppercase and lowercase letters for model and texture names, but as of 1.11 it all needs to be lowercase (for some reason...)

I found a program that could bulk rename all the files to lowercase, so that is done. Now I *just* need to change all the contents of the files to lowercase.

Do you know of any program/command that can convert entire folder contents to lowercase?

I have like 1 million model files, so editing them all by hand would be a pain...

 

 

Link to comment
Share on other sites

You could write the program very easily by scanning through the file and grabbing it a character at a time.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

2 hours ago, Tschipp said:

as of 1.11 it all needs to be lowercase (for some reason...)

Mojang is enforcing it because Capitilization screws things up.  Windows sees Uppercase and lowercase as being The Same Thing, but the zip format (jar files are zip files with a different extension) does not.  By enforcing lower case and only lower case, this problem goes away magically.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

2 minutes ago, Draco18s said:

Mojang is enforcing it because Capitilization screws things up.  Windows sees Uppercase and lowercase as being The Same Thing, but the zip format (jar files are zip files with a different extension) does not.  By enforcing lower case and only lower case, this problem goes away magically.

Ah, I see. Yes, that has actually happened to me. I had named some files differently while working on them, but when I built it into a jar the textures didn't show up ingame.

Link to comment
Share on other sites

21 hours ago, LexManos said:

Note, the CONTENTS of resources don't need to be lowercase, just the file path.

You are talking about the file path in the model files, right? Because that would mean that I have to change every file, as I said.

 

Anyway, I have already written a script that does the job just fine.

Link to comment
Share on other sites

  • 1 year later...

Have a look at this article for how to read from files in Java - you can read each character and then convert it to lower case.

 

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

public class ReadFile_Files_ReadAllBytes {
  public static void main(String [] pArgs) throws IOException {
    String fileName = "c:\\temp\\sample-10KB.txt";
    File file = new File(fileName);

    byte [] fileBytes = Files.readAllBytes(file.toPath());
    char singleChar;
    char singleCharLower;
    for(byte b : fileBytes) {
      singleChar = (char) b;
      singleCharLower = Character.toLowerCase(singleChar);
      System.out.print(singleCharLower);
    }
  }
}

 

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

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



×
×
  • Create New...

Important Information

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