Continue mapping migration
This commit is contained in:
parent
99ade39404
commit
f03fd03bd0
499 changed files with 12567 additions and 12723 deletions
|
@ -4,13 +4,11 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.core.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
@ -19,13 +17,13 @@ public class TranslationHelper {
|
|||
public static void printMissingNames() {
|
||||
List<String> missingNamesEn = Lists.newArrayList();
|
||||
List<String> missingNamesRu = Lists.newArrayList();
|
||||
|
||||
|
||||
Gson gson = new Gson();
|
||||
InputStream streamEn = BetterEnd.class.getResourceAsStream("/assets/betterend/lang/en_us.json");
|
||||
InputStream streamRu = BetterEnd.class.getResourceAsStream("/assets/betterend/lang/ru_ru.json");
|
||||
JsonObject translationEn = gson.fromJson(new InputStreamReader(streamEn), JsonObject.class);
|
||||
JsonObject translationRu = gson.fromJson(new InputStreamReader(streamRu), JsonObject.class);
|
||||
|
||||
|
||||
Registry.BLOCK.forEach((block) -> {
|
||||
if (Registry.BLOCK.getKey(block).getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||
String name = block.getName().getString();
|
||||
|
@ -37,9 +35,9 @@ public class TranslationHelper {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
EndItems.getModItems().forEach((item) -> {
|
||||
String name = item.getName().getString();
|
||||
String name = item.getDescription().getString();
|
||||
if (!translationEn.has(name)) {
|
||||
missingNamesEn.add(name);
|
||||
}
|
||||
|
@ -47,7 +45,7 @@ public class TranslationHelper {
|
|||
missingNamesRu.add(name);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
EndBiomes.getModBiomes().forEach((endBiome) -> {
|
||||
if (endBiome.getID().getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||
String name = "biome." + BetterEnd.MOD_ID + "." + endBiome.getID().getPath();
|
||||
|
@ -59,9 +57,9 @@ public class TranslationHelper {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Registry.ENTITY_TYPE.forEach((entity) -> {
|
||||
ResourceLocation id = Registry.ENTITY_TYPE.getId(entity);
|
||||
ResourceLocation id = Registry.ENTITY_TYPE.getKey(entity);
|
||||
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||
String name = "entity." + BetterEnd.MOD_ID + "." + id.getPath();
|
||||
if (!translationEn.has(name)) {
|
||||
|
@ -72,12 +70,12 @@ public class TranslationHelper {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (!missingNamesEn.isEmpty() || !missingNamesRu.isEmpty()) {
|
||||
|
||||
|
||||
System.out.println("========================================");
|
||||
System.out.println(" MISSING NAMES LIST");
|
||||
|
||||
|
||||
if (!missingNamesEn.isEmpty()) {
|
||||
Collections.sort(missingNamesEn);
|
||||
System.out.println("========================================");
|
||||
|
@ -87,7 +85,7 @@ public class TranslationHelper {
|
|||
System.out.println(" \"" + name + "\": \"" + fastTranslateEn(name) + "\",");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (!missingNamesRu.isEmpty()) {
|
||||
Collections.sort(missingNamesRu);
|
||||
System.out.println("========================================");
|
||||
|
@ -97,11 +95,11 @@ public class TranslationHelper {
|
|||
System.out.println(" \"" + name + "\": \"\",");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
System.out.println("========================================");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String fastTranslateEn(String text) {
|
||||
String[] words = text.substring(text.lastIndexOf('.') + 1).split("_");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue