I'm making a minecraft-forge mod and I'm having problems putting an String into Block#getBlockFromName(String name). the String:
String oreName = "minecraft:iron_ore -replace:minecraft:stone.minecraft:netherrack.minecraft:end_stone;";
And like you see after -replace: I have an block name (minecraft:stone) and a dot and than again block name and a dot. I want to split each block name into a separate String and read it one by one so I can insert it into Block#getBlockFromName and get 1 block out of each String. I tried using String#split(".") to split it into an array, but when I print out the array when I switched it back to String by using Arrays#toString it was empty. I want to split it by dots because I have an config file so those blocks can be changed to anything, I can't just pull out minecraft:stone out of the String because the ones who are using my mod will be able to configure that minecraft:stone to something else and add another block name by using a dot after the first block name. This is what I've done so far:
String oreName = "minecraft:iron_ore -replace:minecraft:stone.minecraft:netherrack.minecraft:end_stone;";
String block1 = oreName.substring(oreName.indexOf("-replace:"));
String block2 = block1.replace("-replace:", "");
String block3 = block2.contains(" -") ? block2.substring(0, block2.indexOf(" ")) : block2.replace(";", "");
System.out.println("The Block Names Are: " + block3); // It prints it just without "minecraft:iron_ore -replace:" and ";" at the end
String[] block4 = block3.split(".");
System.out.println("The array: " + Arrays.toString(block4)); // only prints out "The array: []"