Skip to content

Commit

Permalink
Translate tater chat messages and respect child gender
Browse files Browse the repository at this point in the history
(swiped from Quark)
  • Loading branch information
TheRealWormbo committed May 12, 2024
1 parent 08ea98b commit 806f8ab
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@
import vazkii.botania.common.handler.BotaniaSounds;
import vazkii.botania.common.helper.PlayerHelper;
import vazkii.botania.common.helper.VecHelper;
import vazkii.botania.common.item.block.TinyPotatoBlockItem;

import java.time.LocalDateTime;
import java.time.Month;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;

Expand All @@ -59,6 +62,39 @@ public class TinyPotatoBlockEntity extends ExposedSimpleInventoryBlockEntity imp
private static final boolean IS_BIRTHDAY = isTinyPotatoBirthday();
private static final String TAG_NAME = "name";
private static final int JUMP_EVENT = 0;
private static final Map<String, String> GENDER = new HashMap<>(Map.ofEntries(
Map.entry("girlstater", "daughter"),
Map.entry("lesbiabtater", "daughter"),
Map.entry("lesbiamtater", "daughter"),
Map.entry("lesbiantater", "daughter"),
Map.entry("lesbitater", "daughter"),
Map.entry("lessbientater", "daughter"),

Map.entry("agendertater", "child"),
Map.entry("enbytater", "child"),
Map.entry("nbtater", "child"),
Map.entry("nonbinarytater", "child"),
Map.entry("robotater", "child"),
Map.entry("wiretater", "child"),
Map.entry("eutrotater", "child"),
Map.entry("bob", "child"),
Map.entry("snences", "child"),

Map.entry("genderfluidtater", "child"),
Map.entry("taterfluid", "child"),
Map.entry("eggtater", "child"),
Map.entry("tategg", "child"),
Map.entry("transtater", "child"),

Map.entry("manytater", "children"),
Map.entry("pluraltater", "children"),
Map.entry("snorps", "children"),
Map.entry("systater", "children"),
Map.entry("systemtater", "children"),

// The best gender
Map.entry("tomater", "tomato")
));

public int jumpTicks = 0;
public Component name = Component.literal("");
Expand Down Expand Up @@ -95,11 +131,28 @@ public void interact(Player player, InteractionHand hand, ItemStack stack, Direc
level.playSound(null, worldPosition, BotaniaSounds.doit, SoundSource.BLOCKS, 1F, 1F);
}

for (int i = 0; i < inventorySize(); i++) {
var son = getItemHandler().getItem(i);
if (!son.isEmpty() && son.is(BotaniaBlocks.tinyPotato.asItem())) {
player.sendSystemMessage(Component.literal("Don't talk to me or my son ever again."));
return;
ItemStack tater = ItemStack.EMPTY;
boolean manyTater = false;
for (int i = 0; i < getContainerSize(); i++) {
ItemStack otherStack = getItem(i);
if (!otherStack.isEmpty() && otherStack.is(BotaniaBlocks.tinyPotato.asItem())) {
if (tater.isEmpty()) {
tater = otherStack;
} else {
manyTater = true;
break;
}
}
}
if (!tater.isEmpty()) {
String taterGender = manyTater ? "children" : "son";
if (!manyTater && tater.hasCustomHoverName()) {
StringBuilder childNameBuilder = new StringBuilder();
TinyPotatoBlockItem.isEnchantedName(tater.getHoverName(), childNameBuilder);
taterGender = GENDER.getOrDefault(childNameBuilder.toString(), taterGender);
}
if (player instanceof ServerPlayer serverPlayer) {
serverPlayer.sendSystemMessage(Component.translatable("botania.tater.my_" + taterGender), true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import vazkii.botania.common.item.ItemWithBannerPattern;
import vazkii.botania.common.lib.BotaniaTags;

import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;

Expand All @@ -39,26 +40,9 @@ public class TinyPotatoBlockItem extends BlockItem implements ItemWithBannerPatt
+ "^v[ao]{1,2}[sz]{0,2}[ak]{1,2}(i){1,2}l{0,2}$",
Pattern.CASE_INSENSITIVE
);
private static final List<String> ENCHANTMENT_NAMES = List.of("enchanted", "glowy", "shiny", "gay");

private static final String[] NOT_MY_NAME = {
"Six letter word just to get me along",
"It's a intricacy and I'm coding on my mod and I,",
"I keep fixin', and keepin' it together",
"People around gotta find something to play now",
"Holding back, every mod's the same",
"Don't wanna be a loser",
"Listen to me, oh no, I don't break anything at all",
"But with nothing to consider they forget my name",
"'ame, 'ame, 'ame",
"They call me Vaskii",
"They call me Vazki",
"They call me Voskii",
"They call me Vazkki",
"That's not my name",
"That's not my name",
"That's not my name",
"That's not my name"
};
private static final int NOT_MY_NAME = 17;

private static final String TAG_TICKS = "notMyNameTicks";

Expand All @@ -76,8 +60,10 @@ public void inventoryTick(ItemStack stack, Level world, Entity e, int t, boolean
if (!world.isClientSide && e instanceof Player player && e.tickCount % 30 == 0
&& TYPOS.matcher(stack.getHoverName().getString()).matches()) {
int ticks = ItemNBTHelper.getInt(stack, TAG_TICKS, 0);
if (ticks < NOT_MY_NAME.length) {
player.sendSystemMessage(Component.literal(NOT_MY_NAME[ticks]).withStyle(ChatFormatting.RED));
if (ticks < NOT_MY_NAME) {
player.sendSystemMessage(Component
.translatable("botania.tater.you_came_to_the_wrong_neighborhood." + ticks)
.withStyle(ChatFormatting.RED));
ItemNBTHelper.setInt(stack, TAG_TICKS, ticks + 1);
}
}
Expand Down
23 changes: 23 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,34 @@
"botaniamisc.invalidDodge": "Invalid Dodge Packet",
"botaniamisc.rannuncarpus.state_sensitive": "Match Exact State",
"botaniamisc.rannuncarpus.state_insensitive": "Match Block Only",

"botania.tater_birthday.0": "Wow, is this for me?",
"botania.tater_birthday.1": "It's my birthday today; I'm %d years old now!",
"botania.tater_birthday.2": "Thank you so much! I hope this has been a good year for you too.",
"botania.tater_birthday.3": "Always remember: I believe in you, and you can do the thing! \u2764",
"botania.tater_birthday.4": "Woohoo!!!",
"botania.tater.my_son": "Don't talk to me or my son ever again.",
"botania.tater.my_daughter": "Don't talk to me or my daughter ever again.",
"botania.tater.my_child": "Don't talk to me or my child ever again.",
"botania.tater.my_tomato": "Don't talk to me or my tomato ever again.",
"botania.tater.my_children": "Don't talk to me or my children ever again.",
"botania.tater.you_came_to_the_wrong_neighborhood.0": "Six letter word just to get me along",
"botania.tater.you_came_to_the_wrong_neighborhood.1": "It's a intricacy and I'm coding on my mod and I,",
"botania.tater.you_came_to_the_wrong_neighborhood.2": "I keep fixin', and keepin' it together",
"botania.tater.you_came_to_the_wrong_neighborhood.3": "People around gotta find something to play now",
"botania.tater.you_came_to_the_wrong_neighborhood.4": "Holding back, every mod's the same",
"botania.tater.you_came_to_the_wrong_neighborhood.5": "Don't wanna be a loser",
"botania.tater.you_came_to_the_wrong_neighborhood.6": "Listen to me, oh no, I don't break anything at all",
"botania.tater.you_came_to_the_wrong_neighborhood.7": "But with nothing to consider they forget my name",
"botania.tater.you_came_to_the_wrong_neighborhood.8": "'ame, 'ame, 'ame",
"botania.tater.you_came_to_the_wrong_neighborhood.9": "They call me Vaskii",
"botania.tater.you_came_to_the_wrong_neighborhood.10": "They call me Vazki",
"botania.tater.you_came_to_the_wrong_neighborhood.11": "They call me Voskii",
"botania.tater.you_came_to_the_wrong_neighborhood.12": "They call me Vazkki",
"botania.tater.you_came_to_the_wrong_neighborhood.13": "That's not my name",
"botania.tater.you_came_to_the_wrong_neighborhood.14": "That's not my name",
"botania.tater.you_came_to_the_wrong_neighborhood.15": "That's not my name",
"botania.tater.you_came_to_the_wrong_neighborhood.16": "That's not my name",

"botania.nei.brewery": "Botanical Brewery",
"botania.nei.elvenTrade": "Elven Trade",
Expand Down
21 changes: 21 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/es_ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@
"botaniamisc.bottleTooltip": "Ha adquirido gusto",
"botaniamisc.shardLevel": "Shard Power %s",
"botaniamisc.lexiconIndex": "Índice del Lexicon",
"botania.tater.my_son": "No me vuelvas a hablar ni a mí ni a mi hijo nunca más.",
"botania.tater.my_daughter": "No me vuelvas a hablar ni a mí ni a mi hija nunca más.",
"botania.tater.my_child": "No me vuelvas a hablar ni a mí ni a mi crío nunca más.",
"botania.tater.my_children": "No me vuelvas a hablar ni a mí ni a mis hijos nunca más.",
"botania.tater.you_came_to_the_wrong_neighborhood.0": "Una palabra de seis letras para ayudarme a seguir",
"botania.tater.you_came_to_the_wrong_neighborhood.1": "Es una complejidad y estoy programando mi mod y yo,",
"botania.tater.you_came_to_the_wrong_neighborhood.2": "Sigo arreglando, y manteniéndolo en orden",
"botania.tater.you_came_to_the_wrong_neighborhood.3": "Las personas de alrededor tiene que encontrar con qué jugar",
"botania.tater.you_came_to_the_wrong_neighborhood.4": "Me contengo, todos los mods son iguales",
"botania.tater.you_came_to_the_wrong_neighborhood.5": "No quiero ser un perdedor",
"botania.tater.you_came_to_the_wrong_neighborhood.6": "Escuchame, oh no, nunca rompo nada en lo absoluto",
"botania.tater.you_came_to_the_wrong_neighborhood.7": "Pero sin considerarlo se olvidan de mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.8": "-bre, -bre, -bre",
"botania.tater.you_came_to_the_wrong_neighborhood.9": "Me llaman Vaskii",
"botania.tater.you_came_to_the_wrong_neighborhood.10": "Me llaman Vazki",
"botania.tater.you_came_to_the_wrong_neighborhood.11": "Me llaman Voskii",
"botania.tater.you_came_to_the_wrong_neighborhood.12": "Me llaman Vazkki",
"botania.tater.you_came_to_the_wrong_neighborhood.13": "Ese no es mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.14": "Ese no es mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.15": "Ese no es mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.16": "Ese no es mi nombre",

"botania.color.rainbow": "Arco Iris",

Expand Down
21 changes: 21 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/es_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,27 @@
"botaniamisc.challenges": "Desafíos",
"botaniamisc.challengeInfo": "Conozca más sobre los desafíos",
"botaniamisc.pay2win": "Mejora la pila de maná para infundir ese objeto",
"botania.tater.my_son": "No me vuelvas a hablar ni a mí ni a mi hijo nunca más.",
"botania.tater.my_daughter": "No me vuelvas a hablar ni a mí ni a mi hija nunca más.",
"botania.tater.my_child": "No me vuelvas a hablar ni a mí ni a mi crío nunca más.",
"botania.tater.my_children": "No me vuelvas a hablar ni a mí ni a mis hijos nunca más.",
"botania.tater.you_came_to_the_wrong_neighborhood.0": "Una palabra de seis letras para ayudarme a seguir",
"botania.tater.you_came_to_the_wrong_neighborhood.1": "Es una complejidad y estoy programando mi mod y yo,",
"botania.tater.you_came_to_the_wrong_neighborhood.2": "Sigo arreglando, y manteniéndolo en orden",
"botania.tater.you_came_to_the_wrong_neighborhood.3": "Las personas de alrededor tiene que encontrar con qué jugar",
"botania.tater.you_came_to_the_wrong_neighborhood.4": "Me contengo, todos los mods son iguales",
"botania.tater.you_came_to_the_wrong_neighborhood.5": "No quiero ser un perdedor",
"botania.tater.you_came_to_the_wrong_neighborhood.6": "Escúchame, oh no, nunca rompo nada en lo absoluto",
"botania.tater.you_came_to_the_wrong_neighborhood.7": "Pero sin considerarlo se olvidan de mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.8": "-bre, -bre, -bre",
"botania.tater.you_came_to_the_wrong_neighborhood.9": "Me llaman Vaskii",
"botania.tater.you_came_to_the_wrong_neighborhood.10": "Me llaman Vazki",
"botania.tater.you_came_to_the_wrong_neighborhood.11": "Me llaman Voskii",
"botania.tater.you_came_to_the_wrong_neighborhood.12": "Me llaman Vazkki",
"botania.tater.you_came_to_the_wrong_neighborhood.13": "Ese no es mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.14": "Ese no es mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.15": "Ese no es mi nombre",
"botania.tater.you_came_to_the_wrong_neighborhood.16": "Ese no es mi nombre",

"botania.nei.brewery": "Fermentador botánico",
"botania.nei.elvenTrade": "Intercambio élfico",
Expand Down
4 changes: 4 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
"botania.tater_birthday.2": "Merci beaucoup ! J'espère aussi que ton année s'est bien passée",
"botania.tater_birthday.3": "N'oublies pas: J'ai confiance en toi, tu peux y arriver ! \u2764",
"botania.tater_birthday.4": "Woohoo !!!",
"botania.tater.my_son": "Non parlare mai più con me o con mio figlio.",
"botania.tater.my_daughter": "Non parlare mai più con me o con mia figlia.",
"botania.tater.my_child": "Non parlare mai più con me o con mi* figli*.",
"botania.tater.my_children": "Non parlare mai più con me o con miei figli.",

"botania.nei.brewery": "Alambic botanique",
"botania.nei.elvenTrade": "Commerce elfique",
Expand Down
21 changes: 21 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,27 @@
"botania.tater_birthday.2": "本当にありがとう!あなたにとっても素敵な一年だったら私も嬉しいです!",
"botania.tater_birthday.3": "覚えておいてね!私はいつでもあなたを信じてます!あなたはなんだって出来る!\u2764",
"botania.tater_birthday.4": "Woohoo!!!",
"botania.tater.my_daughter": "二度と私と娘に話しかけないでください。",
"botania.tater.my_child": "二度と私と子どもに話しかけないでください。",
"botania.tater.my_tomato": "二度と私とトマトに話しかけないでください。",
"botania.tater.my_children": "二度と私と子どもたちに話しかけないでください。",
"botania.tater.you_came_to_the_wrong_neighborhood.0": "6つの文字は、私を理解するためのもの",
"botania.tater.you_came_to_the_wrong_neighborhood.1": "それは複雑で、私は自分のModをコーディングしていて、",
"botania.tater.you_came_to_the_wrong_neighborhood.2": "修正し続け、一緒に保ち続けている",
"botania.tater.you_came_to_the_wrong_neighborhood.3": "周りの人は何か遊ぶものを探している",
"botania.tater.you_came_to_the_wrong_neighborhood.4": "我慢して、どのModも同じ",
"botania.tater.you_came_to_the_wrong_neighborhood.5": "負け犬になりたくない",
"botania.tater.you_came_to_the_wrong_neighborhood.6": "聞いて、私は何も壊してなんかない",
"botania.tater.you_came_to_the_wrong_neighborhood.7": "だけど、何も考えることがないと、あいつらは僕の名前を忘れてしまう",
"botania.tater.you_came_to_the_wrong_neighborhood.8": "名前、名前、名前",
"botania.tater.you_came_to_the_wrong_neighborhood.9": "彼らは私をVaskiiと呼ぶ",
"botania.tater.you_came_to_the_wrong_neighborhood.10": "彼らは私をVazkiと呼ぶ",
"botania.tater.you_came_to_the_wrong_neighborhood.11": "彼らは私をVoskiiと呼ぶ",
"botania.tater.you_came_to_the_wrong_neighborhood.12": "彼らは私をVazkkiと呼ぶ",
"botania.tater.you_came_to_the_wrong_neighborhood.13": "それは私の名前ではありません",
"botania.tater.you_came_to_the_wrong_neighborhood.14": "それは私の名前ではありません",
"botania.tater.you_came_to_the_wrong_neighborhood.15": "それは私の名前ではありません",
"botania.tater.you_came_to_the_wrong_neighborhood.16": "それは私の名前ではありません",

"botania.nei.brewery": "ボタニア的醸造",
"botania.nei.elvenTrade": "エルフとの交易",
Expand Down
4 changes: 4 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
"botaniamisc.santaweaveInfo": "Манаткань, изменилась за \u00a7cs\u00a7fe\u00a7ca\u00a7fs\u00a7co\u00a7fn",
"botaniamisc.scaleChange": "Изменение масштаба",
"botaniamisc.invalidDodge": "Неверный пакет",
"botania.tater.my_son": "Никогда больше не разговаривай со мной или моим сыном.",
"botania.tater.my_daughter": "Никогда больше не разговаривай со мной или моей дочерью.",
"botania.tater.my_child": "Никогда больше не разговаривай со мной или моим ребёнком.",
"botania.tater.my_children": "Никогда больше не разговаривай со мной или моими детьми.",

"botania.nei.brewery": "Ботаническая варочная стойка",
"botania.nei.elvenTrade": "Торговля с эльфами",
Expand Down
21 changes: 21 additions & 0 deletions Xplat/src/main/resources/assets/botania/lang/uk_ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,27 @@
"botania.tater_birthday.2": "Дуже дякую! Я сподіваюся, що цей рік також був хорошим для вас.",
"botania.tater_birthday.3": "Завжди пам’ятайте: я вірю в вас, і ви можете зробити все! \u2764",
"botania.tater_birthday.4": "Юхууу!!!",
"botania.tater.my_son": "Ніколи більше не розмовляй ні зі мною, ні з моїм сином.",
"botania.tater.my_daughter": "Ніколи більше не розмовляй ні зі мною, ні з моєю донькою.",
"botania.tater.my_child": "Ніколи більше не розмовляй ні зі мною, ні з моєю дитиною.",
"botania.tater.my_children": "Ніколи більше не розмовляй ні зі мною, ні з моїми дітьми.",
"botania.tater.you_came_to_the_wrong_neighborhood.0": "Слово з шести літер просто для того, щоб Я тримався далі",
"botania.tater.you_came_to_the_wrong_neighborhood.1": "Це складно, і Я кодую у своєму настрої, і Я",
"botania.tater.you_came_to_the_wrong_neighborhood.2": "Я продовжую виправляти, і тримати це разом",
"botania.tater.you_came_to_the_wrong_neighborhood.3": "Люди навколо мають знайти у що зараз пограти",
"botania.tater.you_came_to_the_wrong_neighborhood.4": "Вгамуйся, всі моди однакові",
"botania.tater.you_came_to_the_wrong_neighborhood.5": "Не хочу бути невдахою",
"botania.tater.you_came_to_the_wrong_neighborhood.6": "Послухай мене, о ні, Я взагалі нічого не ламаю",
"botania.tater.you_came_to_the_wrong_neighborhood.7": "Але не маючи про що думати, вони забувають моє ім'я",
"botania.tater.you_came_to_the_wrong_neighborhood.8": "Я, Я, Я",
"botania.tater.you_came_to_the_wrong_neighborhood.9": "Вони кличуть мене Vaskii",
"botania.tater.you_came_to_the_wrong_neighborhood.10": "Вони кличуть мене Vazki",
"botania.tater.you_came_to_the_wrong_neighborhood.11": "Вони кличуть мене Voskii",
"botania.tater.you_came_to_the_wrong_neighborhood.12": "Вони кличуть мене Vazkki",
"botania.tater.you_came_to_the_wrong_neighborhood.13": "Це не моє ім'я",
"botania.tater.you_came_to_the_wrong_neighborhood.14": "Це не моє ім'я",
"botania.tater.you_came_to_the_wrong_neighborhood.15": "Це не моє ім'я",
"botania.tater.you_came_to_the_wrong_neighborhood.16": "Це не моє ім'я",

"botania.nei.brewery": "Ботанічна бродильня",
"botania.nei.elvenTrade": "Торгівля з ельфами",
Expand Down

0 comments on commit 806f8ab

Please sign in to comment.