Skip to content

Commit b4f9d2d

Browse files
committed
New feature highlightBeamTime
Signed-off-by: Hendrix-Shen <[email protected]>
1 parent 49e0a42 commit b4f9d2d

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

src/main/java/com/plusls/ommc/config/Configs.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ public static void checkIsStringListChanged() {
8080
@Config(category = ConfigCategory.GENERIC)
8181
public static boolean forceParseWaypointFromChat = false;
8282

83+
@Numeric(minValue = 0, maxValue = Integer.MAX_VALUE)
84+
@Config(category = ConfigCategory.GENERIC)
85+
public static int highlightBeamTime = 10;
86+
8387
@Hotkey(hotkey = "O,C")
8488
@Config(category = ConfigCategory.GENERIC)
8589
public static ConfigHotkey openConfigGui;
@@ -104,7 +108,6 @@ public static void checkIsStringListChanged() {
104108
public static IConfigOptionListEntry sortInventoryShulkerBoxLast = SortInventoryShulkerBoxLastType.AUTO;
105109

106110
// FEATURE_TOGGLE
107-
108111
@Hotkey
109112
@Config(category = ConfigCategory.FEATURE_TOGGLE)
110113
public static boolean autoSwitchElytra = false;
@@ -175,7 +178,6 @@ public static void checkIsStringListChanged() {
175178

176179

177180
// LISTS
178-
179181
@Config(category = ConfigCategory.LISTS)
180182
public static ArrayList<String> blockModelNoOffsetBlacklist = new ArrayList<>();
181183

src/main/java/com/plusls/ommc/feature/highlithtWaypoint/HighlightWaypointUtil.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,15 @@ public static void setHighlightPos(@NotNull BlockPos pos, boolean directHighligh
545545
}
546546

547547
if (directHighlight || !posChanged) {
548-
HighlightWaypointUtil.lastBeamTime = System.currentTimeMillis() + 10 * 1000;
548+
HighlightWaypointUtil.lastBeamTime = System.currentTimeMillis() + Configs.highlightBeamTime * 1000L;
549549
}
550550
}
551551

552+
public static BlockPos getHighlightPos() {
553+
Player player = Minecraft.getInstance().player;
554+
return player == null ? BlockPos.ZERO : HighlightWaypointUtil.getHighlightPos(player);
555+
}
556+
552557
public static BlockPos getHighlightPos(Player player) {
553558
return HighlightWaypointUtil.inNether(player) ?
554559
HighlightWaypointUtil.highlightPos.getB() : HighlightWaypointUtil.highlightPos.getA();

src/main/resources/assets/ommc/lang/en_us.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
"ommc.config.generic.dontClearChatHistory.comment": "Don't clear chat history and input history.",
1616
"ommc.config.generic.clearWaypoint.name": "clearWaypoint",
1717
"ommc.config.generic.clearWaypoint.comment": "A hotkey to clear highlight waypoint.",
18-
"ommc.config.generic.parseWaypointFromChat.name": "parseWaypointFromChat",
19-
"ommc.config.generic.parseWaypointFromChat.comment": "Parse waypoint from chat.",
2018
"ommc.config.generic.forceParseWaypointFromChat.name": "forceParseWaypointFromChat",
2119
"ommc.config.generic.forceParseWaypointFromChat.comment": "Force parse waypoint from chat (such it will override the clickevent of rtext).",
20+
"ommc.config.generic.highlightBeamTime.name": "highlightBeamTime",
21+
"ommc.config.generic.highlightBeamTime.comment": "Highlighted waypoint beam display time.",
22+
"ommc.config.generic.parseWaypointFromChat.name": "parseWaypointFromChat",
23+
"ommc.config.generic.parseWaypointFromChat.comment": "Parse waypoint from chat.",
2224
"ommc.config.generic.sendLookingAtBlockPos.name": "sendLookingAtPos",
2325
"ommc.config.generic.sendLookingAtBlockPos.comment": "A hotkey to send looking at pos.",
2426
"ommc.config.generic.sortInventory.name": "sortInventory",
@@ -89,5 +91,5 @@
8991
"ommc.config.advanced_integrated_server.flight.comment": "Integrated server enable flight.",
9092
"ommc.config.advanced_integrated_server.port.name": "port",
9193
"ommc.config.advanced_integrated_server.port.comment": "Integrated server lan port, 0 to use default port.",
92-
"ommc.highlight_waypoint.tooltip": "Click to highlight waypoint."
94+
"ommc.highlight_waypoint.tooltip": "Click to highlight waypoint. Click again to display the beam."
9395
}

src/main/resources/assets/ommc/lang/zh_cn.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
"ommc.config.generic.dontClearChatHistory.comment": "不清空聊天历史记录,以及输入的历史记录",
1616
"ommc.config.generic.clearWaypoint.name": "取消高亮坐标点",
1717
"ommc.config.generic.clearWaypoint.comment": "取消高亮坐标点的快捷键",
18-
"ommc.config.generic.parseWaypointFromChat.name": "从聊天中解析路径点",
19-
"ommc.config.generic.parseWaypointFromChat.comment": "从聊天中解析路径点",
2018
"ommc.config.generic.forceParseWaypointFromChat.name": "强制从聊天中解析路径点",
2119
"ommc.config.generic.forceParseWaypointFromChat.comment": "强制从聊天中解析路径点,就算该信息中存在 click event 也会将其覆盖",
20+
"ommc.config.generic.highlightBeamTime.name": "高亮光柱时间",
21+
"ommc.config.generic.highlightBeamTime.comment": "高亮坐标点光束展示时间.",
22+
"ommc.config.generic.parseWaypointFromChat.name": "从聊天中解析路径点",
23+
"ommc.config.generic.parseWaypointFromChat.comment": "从聊天中解析路径点",
2224
"ommc.config.generic.sendLookingAtBlockPos.name": "发送当前注视的方块的坐标",
2325
"ommc.config.generic.sendLookingAtBlockPos.comment": "发送当前注视的方块的坐标",
2426
"ommc.config.generic.sortInventory.name": "整理仓库",
@@ -89,5 +91,5 @@
8991
"ommc.config.advanced_integrated_server.flight.comment": "本地服务器允许飞行",
9092
"ommc.config.advanced_integrated_server.port.name": "局域网端口",
9193
"ommc.config.advanced_integrated_server.port.comment": "本地服务器的局域网端口,0 表示使用随机端口",
92-
"ommc.highlight_waypoint.tooltip": "点击以高亮坐标点"
94+
"ommc.highlight_waypoint.tooltip": "点击以高亮坐标点。再次点击展示光束。"
9395
}

0 commit comments

Comments
 (0)