diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 6427baf4f..5205e3074 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -140,7 +140,7 @@ de8a40b7daf1497d5aecee47a43b3e0b1d030b00 assets/create/blockstates/fancy_scoria_ fc9ac0a7e7191b93516719455a17177fa6524ecc assets/create/blockstates/fancy_weathered_limestone_bricks_slab.json b2a7c321b1795f20e7433f81a55ce4683de081b8 assets/create/blockstates/fancy_weathered_limestone_bricks_stairs.json 6372fe02ba0065acb0758121c45a15a1a8fdc5de assets/create/blockstates/fancy_weathered_limestone_bricks_wall.json -499aade14db59f62b46e8a266998feb41e1922a1 assets/create/blockstates/fluid_pipe.json +ddf31e35edba4572e4b916e654794c2fc9355c76 assets/create/blockstates/fluid_pipe.json f0eaab18e16c4f3f65ebf3b55b08f0dc445720fe assets/create/blockstates/fluid_tank.json 5408d92ab02af86539ac42971d4033545970bb3a assets/create/blockstates/fluid_valve.json e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets/create/blockstates/flywheel.json @@ -335,7 +335,7 @@ e8b0a401c10d1ba67ed71ba31bd5f9bc28571b65 assets/create/blockstates/powered_toggl d06cd9a1101b18d306a786320aab12018b1325d6 assets/create/blockstates/purple_sail.json 92957119abd5fbcca36a113b2a80255fd70fc303 assets/create/blockstates/purple_seat.json 61035f8afe75ff7bbd291da5d8690bcbebe679eb assets/create/blockstates/purple_valve_handle.json -9e7ea57c58889fa0021e3c4f19da3f763108399f assets/create/blockstates/radial_chassis.json +100eedce1711b9eea00a4540ebef8a19e834df3a assets/create/blockstates/radial_chassis.json 45877c4d90a7185c2f304edbd67379d800920439 assets/create/blockstates/red_sail.json da1b08387af7afa0855ee8d040f620c01f20660a assets/create/blockstates/red_seat.json 722fc77bbf387af8a4016e42cbf9501d2b968881 assets/create/blockstates/red_valve_handle.json @@ -398,16 +398,16 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json efb6e419a2b1181541032daefc9420a1b0426ba3 assets/create/lang/en_ud.json -36140c5c0a5f593dc6470d659e8b809f7bf90513 assets/create/lang/en_us.json -c3fd899caa2854d0bd8f01042b5161a68e2fb11d assets/create/lang/unfinished/de_de.json -97367216e3c29a93ba41e5e68b3ef1e62eb7bed0 assets/create/lang/unfinished/fr_fr.json -e2b3409d52c793eb15329a2fa191437a04314f25 assets/create/lang/unfinished/it_it.json -b6893bae7bb205eab270596891dfe20cc114037c assets/create/lang/unfinished/ja_jp.json -82537573c3af93df36afff886260fb68d2bc288b assets/create/lang/unfinished/ko_kr.json -ea6569036e30d262da26560123817cf3182d7e62 assets/create/lang/unfinished/nl_nl.json -0ee15746838cb6ea83054d28e598c7f89e44b136 assets/create/lang/unfinished/pt_br.json -0f9d3389ff1598a74ea9739c51b1a309274f46f5 assets/create/lang/unfinished/ru_ru.json -149450cea09a1cf7757a880b1238cbbdea74aee9 assets/create/lang/unfinished/zh_cn.json +d5345200a404fbc824d92656f6b1a543bfaf635d assets/create/lang/en_us.json +b43244225f07231c9fb8b71bbd3b945bd30a5ab8 assets/create/lang/unfinished/de_de.json +3472564e14b7728ee96df813eb49ad3b11a092c3 assets/create/lang/unfinished/fr_fr.json +9074e0c4d47f2e97c112f6897b74c202f2c734c6 assets/create/lang/unfinished/it_it.json +c369058cdfacd8f437d0caea277925db6f8ed6f8 assets/create/lang/unfinished/ja_jp.json +338ea41c2550c80ac304a03713e368d34c737b5c assets/create/lang/unfinished/ko_kr.json +95fbf8d08213878f113ea9875d2d62d712d524f7 assets/create/lang/unfinished/nl_nl.json +d6ab20d3494560ef09708f5ef9b72ee4a9e2c5a0 assets/create/lang/unfinished/pt_br.json +249d647fcf8f5ad45161a992620eebd81821eccc assets/create/lang/unfinished/ru_ru.json +2ac7dee1d72427a557c30d2cab6054ff877ae27e assets/create/lang/unfinished/zh_cn.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 9f1884e78..03541c42d 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -875,6 +875,9 @@ "create.schematicannon.status.schematicNotPlaced": "Schematic Not Deployed", "create.schematicannon.status.schematicExpired": "Schematic File Expired", + "create.materialChecklist": "Material Checklist", + "create.materialChecklist.blocksNotLoaded": "* Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "Deny-List", "create.gui.filter.deny_list.description": "Items pass if they do NOT match any of the above. An empty Deny-List accepts everything.", "create.gui.filter.allow_list": "Allow-List", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 6c30d1157..c6751ac14 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1128", + "_": "Missing Localizations: 1130", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "Bauplan nicht positioniert", "create.schematicannon.status.schematicExpired": "Bauplandatei abgelaufen", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "UNLOCALIZED: Deny-List", "create.gui.filter.deny_list.description": "UNLOCALIZED: Items pass if they do NOT match any of the above. An empty Deny-List accepts everything.", "create.gui.filter.allow_list": "UNLOCALIZED: Allow-List", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 713ea2a26..34599dbd9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 779", + "_": "Missing Localizations: 781", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "Schéma non déployé", "create.schematicannon.status.schematicExpired": "Fichier de schéma arrivé à expiration", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "Liste noire", "create.gui.filter.deny_list.description": "Les articles réussissent s'ils ne correspondent à AUCUN des éléments ci-dessus. Une liste noire vide accepte tout.", "create.gui.filter.allow_list": "Liste blanche", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 021d7d5b3..5a60bbbca 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 763", + "_": "Missing Localizations: 765", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "Schematica Non Implementata", "create.schematicannon.status.schematicExpired": "File Schematica Scaduto", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "Lista Nera", "create.gui.filter.deny_list.description": "Gli oggetti passano se NON corrispondono a nessuno dei precedenti. Una Lista Nera vuota accetta tutto.", "create.gui.filter.allow_list": "Lista Bianca", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index d4d4e3a59..7704492d4 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 762", + "_": "Missing Localizations: 764", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "配置されていない概略図です", "create.schematicannon.status.schematicExpired": "概略図ファイルが期限切れです", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "ブラックリスト", "create.gui.filter.deny_list.description": "上記のいずれにも一致しない場合、アイテムは通り抜けます。 空のブラックリストはすべてを受け入れます。", "create.gui.filter.allow_list": "ホワイトリスト", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 489c8d42e..b99b22da6 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 763", + "_": "Missing Localizations: 765", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "청사진이 전개되지 않음", "create.schematicannon.status.schematicExpired": "청사진 파일이 제거됨", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "블랙리스트", "create.gui.filter.deny_list.description": "위 목록에 맞지않는 아이템이면 통과합니다. 빈 블랙리스트는 모두 통과시킵니다.", "create.gui.filter.allow_list": "화이트리스트", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 3b530a015..2321c8f21 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1069", + "_": "Missing Localizations: 1071", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "Bouwtekening niet geplaatst", "create.schematicannon.status.schematicExpired": "Bouwtekening verlopen", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "UNLOCALIZED: Deny-List", "create.gui.filter.deny_list.description": "UNLOCALIZED: Items pass if they do NOT match any of the above. An empty Deny-List accepts everything.", "create.gui.filter.allow_list": "UNLOCALIZED: Allow-List", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 88d062670..b0c1b4760 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1135", + "_": "Missing Localizations: 1137", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "Esquema não Colocado", "create.schematicannon.status.schematicExpired": "Arquivo de Esquema Expirado", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "UNLOCALIZED: Deny-List", "create.gui.filter.deny_list.description": "UNLOCALIZED: Items pass if they do NOT match any of the above. An empty Deny-List accepts everything.", "create.gui.filter.allow_list": "UNLOCALIZED: Allow-List", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 12bd17cae..9de28cf96 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 436", + "_": "Missing Localizations: 438", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "Схема не загружена", "create.schematicannon.status.schematicExpired": "Срок действия файла схемы истек", + "create.materialChecklist": "UNLOCALIZED: Material Checklist", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "Чёрный список", "create.gui.filter.deny_list.description": "Предметы проходят, если они не соответствуют ни одному из вышеперечисленных. Пустой черный список принимает все.", "create.gui.filter.allow_list": "Белый список", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 20d002e2d..83b22e799 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 445", + "_": "Missing Localizations: 446", "_": "->------------------------] Game Elements [------------------------<-", @@ -876,6 +876,9 @@ "create.schematicannon.status.schematicNotPlaced": "蓝图未部署", "create.schematicannon.status.schematicExpired": "蓝图文件已过期", + "create.materialChecklist": "材料清单", + "create.materialChecklist.blocksNotLoaded": "UNLOCALIZED: * Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "黑名单", "create.gui.filter.deny_list.description": "只通过不在黑名单中的物品,如果黑名单为空,所有物品都可以通过", "create.gui.filter.allow_list": "白名单", diff --git a/src/main/java/com/simibubi/create/content/schematics/MaterialChecklist.java b/src/main/java/com/simibubi/create/content/schematics/MaterialChecklist.java index 704320f78..97dc67317 100644 --- a/src/main/java/com/simibubi/create/content/schematics/MaterialChecklist.java +++ b/src/main/java/com/simibubi/create/content/schematics/MaterialChecklist.java @@ -2,14 +2,13 @@ package com.simibubi.create.content.schematics; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Locale; -import java.util.Map; - import com.google.common.collect.Sets; import com.simibubi.create.content.schematics.ItemRequirement.ItemUseType; +import com.simibubi.create.foundation.utility.Lang; +import it.unimi.dsi.fastutil.objects.Object2IntArrayMap; +import it.unimi.dsi.fastutil.objects.Object2IntMap; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -17,6 +16,8 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.nbt.StringNBT; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.Style; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; @@ -24,17 +25,11 @@ public class MaterialChecklist { public static final int MAX_ENTRIES_PER_PAGE = 5; - public Map gathered; - public Map required; - public Map damageRequired; + public Object2IntMap gathered = new Object2IntArrayMap<>(); + public Object2IntMap required = new Object2IntArrayMap<>(); + public Object2IntMap damageRequired = new Object2IntArrayMap<>(); public boolean blocksNotLoaded; - public MaterialChecklist() { - required = new HashMap<>(); - damageRequired = new HashMap<>(); - gathered = new HashMap<>(); - } - public void warnBlockNotLoaded() { blocksNotLoaded = true; } @@ -53,12 +48,12 @@ public class MaterialChecklist { } } - private void putOrIncrement(Map map, ItemStack stack) { + private void putOrIncrement(Object2IntMap map, ItemStack stack) { Item item = stack.getItem(); if (item == Items.AIR) return; if (map.containsKey(item)) - map.put(item, map.get(item) + stack.getCount()); + map.put(item, map.getInt(item) + stack.getCount()); else map.put(item, stack.getCount()); } @@ -67,7 +62,7 @@ public class MaterialChecklist { Item item = stack.getItem(); if (required.containsKey(item) || damageRequired.containsKey(item)) if (gathered.containsKey(item)) - gathered.put(item, gathered.get(item) + stack.getCount()); + gathered.put(item, gathered.getInt(item) + stack.getCount()); else gathered.put(item, stack.getCount()); } @@ -79,31 +74,30 @@ public class MaterialChecklist { ListNBT pages = new ListNBT(); int itemsWritten = 0; - StringBuilder string = new StringBuilder("{\"text\":\""); + ITextComponent textComponent; if (blocksNotLoaded) { - string.append("\n" + TextFormatting.RED + "* Disclaimer *\n\n"); - string.append("Material List may be inaccurate due to relevant chunks not being loaded."); - string.append("\"}"); - pages.add(StringNBT.of(string.toString())); - string = new StringBuilder("{\"text\":\""); + textComponent = new StringTextComponent("\n" + TextFormatting.RED); + textComponent = textComponent + .appendSibling(Lang.createTranslationTextComponent( + "materialChecklist.blocksNotLoaded")); + pages.add(StringNBT + .of(ITextComponent.Serializer.toJson(textComponent))); } List keys = new ArrayList<>(Sets.union(required.keySet(), damageRequired.keySet())); Collections.sort(keys, (item1, item2) -> { - Locale locale = Locale.ENGLISH; - String name1 = - new TranslationTextComponent(((Item) item1).getTranslationKey()).getFormattedText().toLowerCase(locale); - String name2 = - new TranslationTextComponent(((Item) item2).getTranslationKey()).getFormattedText().toLowerCase(locale); + String name1 = item1.getRegistryName().getPath(); + String name2 = item2.getRegistryName().getPath(); return name1.compareTo(name2); }); + textComponent = new StringTextComponent(""); List completed = new ArrayList<>(); for (Item item : keys) { int amount = getRequiredAmount(item); if (gathered.containsKey(item)) - amount -= gathered.get(item); + amount -= gathered.getInt(item); if (amount <= 0) { completed.add(item); @@ -112,59 +106,63 @@ public class MaterialChecklist { if (itemsWritten == MAX_ENTRIES_PER_PAGE) { itemsWritten = 0; - string.append("\"}"); - pages.add(StringNBT.of(string.toString())); - string = new StringBuilder("{\"text\":\""); + pages.add(StringNBT + .of(ITextComponent.Serializer.toJson(textComponent))); + textComponent = new StringTextComponent(""); } itemsWritten++; - string.append(unfinishedEntry(new ItemStack(item), amount)); + textComponent + .appendSibling(entry(new ItemStack(item), amount, true)); } for (Item item : completed) { if (itemsWritten == MAX_ENTRIES_PER_PAGE) { itemsWritten = 0; - string.append("\"}"); - pages.add(StringNBT.of(string.toString())); - string = new StringBuilder("{\"text\":\""); + pages.add(StringNBT + .of(ITextComponent.Serializer.toJson(textComponent))); + textComponent = new StringTextComponent(""); } itemsWritten++; - string.append(gatheredEntry(new ItemStack(item), getRequiredAmount(item))); + textComponent.appendSibling( + entry(new ItemStack(item), getRequiredAmount(item), false)); } - string.append("\"}"); - pages.add(StringNBT.of(string.toString())); + pages.add( + StringNBT.of(ITextComponent.Serializer.toJson(textComponent))); tag.put("pages", pages); tag.putString("author", "Schematicannon"); tag.putString("title", TextFormatting.BLUE + "Material Checklist"); + textComponent = Lang.createTranslationTextComponent("materialChecklist") + .setStyle(new Style().setColor(TextFormatting.BLUE) + .setItalic(Boolean.FALSE)); + book.getOrCreateChildTag("display").putString("Name", + ITextComponent.Serializer.toJson(textComponent)); book.setTag(tag); return book; } - public Integer getRequiredAmount(Item item) { + public int getRequiredAmount(Item item) { int amount = required.getOrDefault(item, 0); if (damageRequired.containsKey(item)) - amount += Math.ceil(damageRequired.get(item) / (float) new ItemStack(item).getMaxDamage()); + amount += Math.ceil(damageRequired.getInt(item) / (float) new ItemStack(item).getMaxDamage()); return amount; } - private String gatheredEntry(ItemStack item, int amount) { + private ITextComponent entry(ItemStack item, int amount, boolean unfinished) { int stacks = amount / 64; int remainder = amount % 64; - ITextComponent tc = new TranslationTextComponent(item.getTranslationKey()); - return TextFormatting.DARK_GREEN + tc.getFormattedText() + " \\u2714\n x" + amount + TextFormatting.GRAY + " | " - + stacks + "\\u25A4 +" + remainder + "\n"; - } - - private String unfinishedEntry(ItemStack item, int amount) { - int stacks = amount / 64; - int remainder = amount % 64; - ITextComponent tc = new TranslationTextComponent(item.getTranslationKey()); - return TextFormatting.BLUE + tc.getFormattedText() + "\n x" + amount + TextFormatting.GRAY + " | " + stacks - + "\\u25A4 +" + remainder + "\n"; + ITextComponent tc = new TranslationTextComponent( + item.getTranslationKey()); + if (!unfinished) + tc.appendText(" \u2714"); + tc.applyTextStyle( + unfinished ? TextFormatting.BLUE : TextFormatting.DARK_GREEN); + return tc.appendText("\n" + TextFormatting.BLACK + " x" + amount + + TextFormatting.GRAY + " | " + stacks + "\u25A4 +" + remainder + "\n"); } } diff --git a/src/main/java/com/simibubi/create/foundation/data/LangMerger.java b/src/main/java/com/simibubi/create/foundation/data/LangMerger.java index 6c672ee18..d51631052 100644 --- a/src/main/java/com/simibubi/create/foundation/data/LangMerger.java +++ b/src/main/java/com/simibubi/create/foundation/data/LangMerger.java @@ -162,8 +162,8 @@ public class LangMerger implements IDataProvider { if (key.endsWith(".tooltip")) return true; - key = new String(key).replaceFirst("\\.", ""); - previousKey = new String(previousKey).replaceFirst("\\.", ""); + key = key.replaceFirst("\\.", ""); + previousKey = previousKey.replaceFirst("\\.", ""); String[] split = key.split("\\."); String[] split2 = previousKey.split("\\."); @@ -243,7 +243,7 @@ public class LangMerger implements IDataProvider { } private class LangEntry { - static final String ENTRY_FORMAT = "\t\"%s\": \"%s\",\n"; + static final String ENTRY_FORMAT = "\t\"%s\": %s,\n"; private String key; private String value; @@ -255,7 +255,7 @@ public class LangMerger implements IDataProvider { @Override public String toString() { - return String.format(ENTRY_FORMAT, key, value); + return String.format(ENTRY_FORMAT, key, GSON.toJson(value, String.class)); } } diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index badd48a55..175a66baa 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -314,7 +314,10 @@ "create.schematicannon.status.schematicInvalid": "Schematic Invalid", "create.schematicannon.status.schematicNotPlaced": "Schematic Not Deployed", "create.schematicannon.status.schematicExpired": "Schematic File Expired", - + + "create.materialChecklist": "Material Checklist", + "create.materialChecklist.blocksNotLoaded": "* Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.", + "create.gui.filter.deny_list": "Deny-List", "create.gui.filter.deny_list.description": "Items pass if they do NOT match any of the above. An empty Deny-List accepts everything.", "create.gui.filter.allow_list": "Allow-List", diff --git a/src/main/resources/assets/create/lang/zh_cn.json b/src/main/resources/assets/create/lang/zh_cn.json index 4ce4d52c1..93395e84f 100644 --- a/src/main/resources/assets/create/lang/zh_cn.json +++ b/src/main/resources/assets/create/lang/zh_cn.json @@ -743,7 +743,9 @@ "create.schematicannon.status.schematicInvalid": "蓝图无效", "create.schematicannon.status.schematicNotPlaced": "蓝图未部署", "create.schematicannon.status.schematicExpired": "蓝图文件已过期", - + + "create.materialChecklist": "材料清单", + "create.gui.filter.deny_list": "黑名单", "create.gui.filter.deny_list.description": "只通过不在黑名单中的物品,如果黑名单为空,所有物品都可以通过", "create.gui.filter.allow_list": "白名单",