Skip to content

Commit

Permalink
better mod restriction display in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Feb 28, 2022
1 parent 7f320e2 commit 0342e65
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 52 deletions.
50 changes: 25 additions & 25 deletions docs/document-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ Modify the maximum number of history messages stored in the chat hud
- Maximum value: `10000`
- Mod restrictions:
- Conflicted mods:
- `compactchat`
- `morechathistory`
- `parachute`
- `raise-chat-limit`
- `wmch`
- CompactChat (`compactchat`)
- MoreChatHistory (`morechathistory`)
- Parachute (`parachute`)
- Raise Chat Limit (`raise-chat-limit`)
- Where's My Chat History (`wmch`)


### connectionSimulatedDelay
Expand Down Expand Up @@ -120,7 +120,7 @@ Remove block breaking particles when pistons break blocks
- Default value: *no hotkey*, `false`
- Mod restrictions:
- Required mods:
- `minecraft >=1.17`
- Minecraft (`minecraft`) ` >=1.17`


### disableRedstoneWireParticle
Expand All @@ -141,7 +141,7 @@ The items that will NOT trigger tweakHandRestock
- Default value: `[minecraft:lava_bucket]`
- Mod restrictions:
- Required mods:
- `tweakeroo`
- Tweakeroo (`tweakeroo`)


### handRestockListType
Expand All @@ -154,7 +154,7 @@ The item restriction type for tweakHandRestock
- Available options: `None`, `Black List`
- Mod restrictions:
- Required mods:
- `tweakeroo`
- Tweakeroo (`tweakeroo`)


### handRestockWhiteList
Expand All @@ -166,7 +166,7 @@ The items that will trigger tweakHandRestock
- Default value: `[minecraft:bucket]`
- Mod restrictions:
- Required mods:
- `tweakeroo`
- Tweakeroo (`tweakeroo`)


### legacyF3NLogic
Expand All @@ -180,7 +180,7 @@ Modify the logic of hotkey F3 + N back to 1.15 and before
- Default value: `false`
- Mod restrictions:
- Required mods:
- `minecraft >=1.16`
- Minecraft (`minecraft`) ` >=1.16`


### maxChatHudHeight
Expand Down Expand Up @@ -281,7 +281,7 @@ and then close the container
- Default value: *no hotkey*, `false`
- Mod restrictions:
- Required mods:
- `itemscroller`
- Item Scroller (`itemscroller`)


### tweakmAutoFillContainer
Expand All @@ -297,7 +297,7 @@ and then close the container
- Default value: *no hotkey*, `false`
- Mod restrictions:
- Required mods:
- `itemscroller`
- Item Scroller (`itemscroller`)


### tweakmAutoPickSchematicBlock
Expand All @@ -313,8 +313,8 @@ Does not work with easy place mode
- Default value: *no hotkey*, `false`
- Mod restrictions:
- Required mods:
- `tweakeroo`
- `litematica`
- Tweakeroo (`tweakeroo`)
- Litematica (`litematica`)


### tweakmFlawlessFrames
Expand All @@ -330,7 +330,7 @@ WARNING: Expect client lag spike with enabled
- Default value: *no hotkey*, `false`
- Mod restrictions:
- Required mods:
- `replaymod`
- Replay mod (`replaymod`)


### tweakmSafeAfk
Expand Down Expand Up @@ -390,8 +390,8 @@ e.g. broken mass craft
- Default value: `false`
- Mod restrictions:
- Required mods:
- `easiercrafting`
- `itemscroller`
- EasierCrafting (`easiercrafting`)
- Item Scroller (`itemscroller`)

![eCraftItemScrollerCompact](assets/eCraftItemScrollerCompact.png)

Expand All @@ -407,7 +407,7 @@ Back to vanilla behavior where sign text is always rendered together with the si
- Default value: `false`
- Mod restrictions:
- Required mods:
- `optifabric`
- Optifine (`optifabric`)


### ofUnlockF3FpsLimit
Expand All @@ -419,8 +419,8 @@ Removed 10 FPS render limit for F3 debug hud
- Default value: `false`
- Mod restrictions:
- Required mods:
- `optifabric`
- `minecraft >=1.15`
- Optifine (`optifabric`)
- Minecraft (`minecraft`) ` >=1.15`


### replayAccurateTimelineTimestamp
Expand All @@ -432,7 +432,7 @@ Display timestamps accurate to milliseconds on the timeline in replay mod
- Default value: `false`
- Mod restrictions:
- Required mods:
- `replaymod`
- Replay mod (`replaymod`)

![replayAccurateTimelineTimestamp](assets/replayAccurateTimelineTimestamp.png)

Expand All @@ -450,7 +450,7 @@ So the maximum fly speed can be increased
- Maximum value: `30`
- Mod restrictions:
- Required mods:
- `replaymod`
- Replay mod (`replaymod`)


### shaderGameTimeAsWorldTime
Expand All @@ -464,12 +464,12 @@ So with gamerule doDaylightCycle false this timer variable still increases
- Default value: `false`
- Mod restrictions:
- Required mods:
- `optifabric`
- Optifine (`optifabric`)

*or*

- Required mods:
- `iris`
- Iris (`iris`)


### xmapNoSessionFinalizationWait
Expand All @@ -485,7 +485,7 @@ Might have some side effects though
- Default value: `false`
- Mod restrictions:
- Required mods:
- `xaeroworldmap`
- Xaero's World Map (`xaeroworldmap`)


## Setting
Expand Down
50 changes: 25 additions & 25 deletions docs/document-zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
- 最大值: `10000`
- 模组约束:
- 冲突模组:
- `compactchat`
- `morechathistory`
- `parachute`
- `raise-chat-limit`
- `wmch`
- CompactChat (`compactchat`)
- MoreChatHistory (`morechathistory`)
- Parachute (`parachute`)
- Raise Chat Limit (`raise-chat-limit`)
- Where's My Chat History (`wmch`)


### 网络连接延迟模拟 (connectionSimulatedDelay)
Expand Down Expand Up @@ -120,7 +120,7 @@
- 默认值: *无快捷键*, `false`
- 模组约束:
- 依赖模组:
- `minecraft >=1.17`
- Minecraft (`minecraft`) ` >=1.17`


### 禁用红石粉粒子效果 (disableRedstoneWireParticle)
Expand All @@ -141,7 +141,7 @@
- 默认值: `[minecraft:lava_bucket]`
- 模组约束:
- 依赖模组:
- `tweakeroo`
- Tweakeroo (`tweakeroo`)


### 自动补货名单约束类型 (handRestockListType)
Expand All @@ -154,7 +154,7 @@ tweakHandRestock功能的物品名单约束类型
- 可用选项: `None`, `Black List`
- 模组约束:
- 依赖模组:
- `tweakeroo`
- Tweakeroo (`tweakeroo`)


### 自动补货白名单 (handRestockWhiteList)
Expand All @@ -166,7 +166,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `[minecraft:bucket]`
- 模组约束:
- 依赖模组:
- `tweakeroo`
- Tweakeroo (`tweakeroo`)


### 旧版F3+N逻辑 (legacyF3NLogic)
Expand All @@ -180,7 +180,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `minecraft >=1.16`
- Minecraft (`minecraft`) ` >=1.16`


### 最大聊天界面高度 (maxChatHudHeight)
Expand Down Expand Up @@ -281,7 +281,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: *无快捷键*, `false`
- 模组约束:
- 依赖模组:
- `itemscroller`
- Item Scroller (`itemscroller`)


### 自动装填容器 (tweakmAutoFillContainer)
Expand All @@ -297,7 +297,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: *无快捷键*, `false`
- 模组约束:
- 依赖模组:
- `itemscroller`
- Item Scroller (`itemscroller`)


### 自动选择原理图方块 (tweakmAutoPickSchematicBlock)
Expand All @@ -313,8 +313,8 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: *无快捷键*, `false`
- 模组约束:
- 依赖模组:
- `tweakeroo`
- `litematica`
- Tweakeroo (`tweakeroo`)
- Litematica (`litematica`)


### 无瑕世界渲染 (tweakmFlawlessFrames)
Expand All @@ -330,7 +330,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: *无快捷键*, `false`
- 模组约束:
- 依赖模组:
- `replaymod`
- Replay mod (`replaymod`)


### 安全挂机 (tweakmSafeAfk)
Expand Down Expand Up @@ -390,8 +390,8 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `easiercrafting`
- `itemscroller`
- EasierCrafting (`easiercrafting`)
- Item Scroller (`itemscroller`)

![eCraftItemScrollerCompact](assets/eCraftItemScrollerCompact.png)

Expand All @@ -407,7 +407,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `optifabric`
- Optifine (`optifabric`)


### Optifine解锁F3帧数限制 (ofUnlockF3FpsLimit)
Expand All @@ -419,8 +419,8 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `optifabric`
- `minecraft >=1.15`
- Optifine (`optifabric`)
- Minecraft (`minecraft`) ` >=1.15`


### Replay精准时间戳显示 (replayAccurateTimelineTimestamp)
Expand All @@ -432,7 +432,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `replaymod`
- Replay mod (`replaymod`)

![replayAccurateTimelineTimestamp](assets/replayAccurateTimelineTimestamp.png)

Expand All @@ -450,7 +450,7 @@ tweakHandRestock功能的物品名单约束类型
- 最大值: `30`
- 模组约束:
- 依赖模组:
- `replaymod`
- Replay mod (`replaymod`)


### 光影使用游戏时间作为世界时间 (shaderGameTimeAsWorldTime)
Expand All @@ -464,12 +464,12 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `optifabric`
- Optifine (`optifabric`)

**

- 依赖模组:
- `iris`
- Iris (`iris`)


### xaero世界地图跳过会话结束等待 (xmapNoSessionFinalizationWait)
Expand All @@ -485,7 +485,7 @@ tweakHandRestock功能的物品名单约束类型
- 默认值: `false`
- 模组约束:
- 依赖模组:
- `xaeroworldmap`
- Xaero's World Map (`xaeroworldmap`)


## 配置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import fi.dy.masa.malilib.config.*;
import fi.dy.masa.malilib.hotkeys.IHotkey;
import fi.dy.masa.malilib.util.StringUtils;
import me.fallenbreath.conditionalmixin.util.ModPredicate;
import me.fallenbreath.conditionalmixin.util.ModRestriction;
import me.fallenbreath.tweakermore.TweakerMoreMod;
import me.fallenbreath.tweakermore.config.Config;
Expand Down Expand Up @@ -40,6 +41,17 @@ private static String italic(String text)
return "*" + text + "*";
}

private static String prettyPredicate(ModPredicate modPredicate)
{
String ret = String.format("%s (`%s`)", StringUtils.translate("tweakermore.util.mod." + modPredicate.modId), modPredicate.modId);
String predicate = modPredicate.getVersionPredicatesString();
if (!predicate.isEmpty())
{
ret += " " + codeBlock(predicate);
}
return ret;
}

private static String getConfigType(IConfigBase config)
{
String id = config instanceof IHotkeyTogglable ? "hotkey_togglable" : config.getType().name().toLowerCase();
Expand Down Expand Up @@ -201,12 +213,12 @@ private static void printOption(Consumer<String> writeln, TweakerMoreOption twea
if (!modRestriction.getRequirements().isEmpty())
{
writeln.accept(String.format(" - %s:", tr("requirements")));
modRestriction.getRequirements().forEach(req -> writeln.accept(String.format(" - `%s`", req.toString())));
modRestriction.getRequirements().forEach(req -> writeln.accept(String.format(" - %s", prettyPredicate(req))));
}
if (!modRestriction.getConflictions().isEmpty())
{
writeln.accept(String.format(" - %s:", tr("conflictions")));
modRestriction.getConflictions().forEach(cfl -> writeln.accept(String.format(" - `%s`", cfl.toString())));
modRestriction.getConflictions().forEach(cfl -> writeln.accept(String.format(" - %s", prettyPredicate(cfl))));
}
}
}
Expand Down

0 comments on commit 0342e65

Please sign in to comment.