截图
介绍
This mod was just the 2nd step to my final goal: Localizator.
Therefore, this mod won’t get updates, bug fixes or anything.
Instead of downloading this mod, download Localizator. It does what this mod does, even better and much much more!
This is a Server and Client side mod, powered by Mixin which adds “locTitle” and “locAuthor” NBT tag support for Written Books.
The feature language-aware modpack creators need! (You are free to include this in your modpack)
You’ll need to add the Mixin Bootstrap into your mods folder (only if your modpack doesn’t already have it) so Mixins can load up!

You ever wanted to add written books that tell a story (lore) about your modpack,
-either using commands or mod’s config files (like Recurrent complex‘s loot, Dregora‘s loot, etc.)-
but your users are constrained by language barriers?
Normally, modpack creators use these tags to create a written book:
{pages:[“{“text“:
“Do not run but hide as they will come.\nHowls in the night, Dark red eyes… They will hunt…\nThey will grunt… Stay hidden, close the doors\nFootsteps on the nearby floors… It is too late\nThey found their prey…”
}”],
title: “At Twilight”,
author: “The Dark Witch”,
display:{Lore:[“Dark Omen”], ench:[{id:10,lvl:1}]}
To solve part of this problem, Minecraft 1.12.2 supports the “translate” tag, which allows you to use a language key for each page.
And with this Mixin, now you can change the written book NBT data to this:
{pages:[“{“translate“: “book.dregorarl.AtTwilight.page.1″}”],
locTitle: “book.dregorarl.AtTwilight.title”,
locAuthor: “book.dregorarl.AtTwilight.author”,
display:{LocLore:[“book.dregorarl.AtTwilight.lore”], ench:[{id:10,lvl:1}]}
(for the LocLore tag, you’ll need my “Localized Lore” Mixin)
If you want to immediately try out this Mixin, you can write this command:
/give @p written_book 1 0 {pages:[“{\”translate\”:\”book.locwrittenbooksmixin.Example.page.1\”}”],locTitle:”book.locwrittenbooksmixin.Example.title”,locAuthor:”book.locwrittenbooksmixin.Example.author”}
Combination examples:
“title” and “author”
“title” and “locAuthor”
“locTitle” and “author”
“locTitle” and “locAuthor”
If you set both “title” AND “locTitle”, or “author” AND “locAuthor” tags, the localized tags will take precedence.
Why setting both, you ask?
This is if your mod is server-side and you want to accept vanilla clients.
Vanilla clients will only see the information from “title” and “author”.
Clients with this Mixin will see the information from “locTitle” and “locAuthor” instead.
Tested with RLCraft, a heavily customized modpack that includes tons of mods and Mixins.
For Written Book’s data structure, check this link.
Remember to add your custom lang file with your language keys into the resources folder or Resource Pack!
常见问题
[DISCONTINUED] Localized Written Books 支持哪些 Minecraft 版本?
[DISCONTINUED] Localized Written Books 支持 Minecraft Java 版 1.12.2,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。
[DISCONTINUED] Localized Written Books 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
KameiB 的其他作品
查看全部 →CIT for Doomlike Dungeons
DLD Novelty物品自定义材质
CIT for Roguelike Dungeons
RLD 趣味物品与交易卡牌自定义材质
CIT for Fishing Made Better
钓鱼增强的自定义物品纹理
Localizator
不再有硬编码文本!将它们本地化!

评论
登录后评论和评分