Skip to content

Commit 0e680c6

Browse files
committed
Merge branch '2023.3' into 2024.1
2 parents 781e3c7 + 181b30d commit 0e680c6

7 files changed

+215
-10
lines changed

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ plugins {
3434
mcdev
3535
groovy
3636
idea
37-
id("org.jetbrains.intellij") version "1.16.0"
37+
id("org.jetbrains.intellij") version "1.17.0"
3838
id("org.cadixdev.licenser")
3939
id("org.jlleitschuh.gradle.ktlint") version "10.3.0"
4040
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ kotlin.code.style=official
2424
ideaVersion = 241.10840-EAP-CANDIDATE-SNAPSHOT
2525
ideaVersionName = 2024.1
2626

27-
coreVersion = 1.7.0
27+
coreVersion = 1.7.1
2828
downloadIdeaSources = true
2929

3030
pluginTomlVersion = 241.10840.7

src/main/kotlin/facet/MinecraftFacet.kt

+10-4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import com.demonwav.mcdev.platform.AbstractModuleType
2727
import com.demonwav.mcdev.platform.PlatformType
2828
import com.demonwav.mcdev.util.SourceType
2929
import com.demonwav.mcdev.util.filterNotNull
30+
import com.demonwav.mcdev.util.invokeAndWait
3031
import com.demonwav.mcdev.util.mapFirstNotNull
3132
import com.google.common.collect.HashMultimap
3233
import com.intellij.facet.Facet
@@ -44,6 +45,7 @@ import com.intellij.openapi.vfs.VirtualFile
4445
import com.intellij.psi.PsiClass
4546
import com.intellij.psi.PsiElement
4647
import com.intellij.psi.PsiMethod
48+
import com.intellij.util.application
4749
import java.util.concurrent.ConcurrentHashMap
4850
import javax.swing.Icon
4951
import org.jetbrains.jps.model.java.JavaResourceRootType
@@ -120,7 +122,11 @@ class MinecraftFacet(
120122
ProjectView.getInstance(module.project).refresh()
121123
}
122124

123-
private fun updateRoots() {
125+
private fun updateRoots() = invokeAndWait {
126+
if (module.isDisposed) {
127+
return@invokeAndWait
128+
}
129+
124130
roots.clear()
125131
val rootManager = ModuleRootManager.getInstance(module)
126132

@@ -231,18 +237,18 @@ class MinecraftFacet(
231237
private class RefreshRootsException : Exception()
232238

233239
@Throws(RefreshRootsException::class)
234-
private fun findFile0(path: String, type: SourceType): VirtualFile? {
240+
private fun findFile0(path: String, type: SourceType): VirtualFile? = application.runReadAction<VirtualFile?> {
235241
val roots = roots[type]
236242

237243
for (root in roots) {
238244
val r = root ?: continue
239245
if (!r.isValid) {
240246
throw RefreshRootsException()
241247
}
242-
return r.findFileByRelativePath(path) ?: continue
248+
return@runReadAction r.findFileByRelativePath(path) ?: continue
243249
}
244250

245-
return null
251+
return@runReadAction null
246252
}
247253

248254
companion object {

src/main/kotlin/facet/MinecraftFacetDetector.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import kotlinx.coroutines.CoroutineScope
5454
import kotlinx.coroutines.Dispatchers
5555
import kotlinx.coroutines.Job
5656
import kotlinx.coroutines.cancelAndJoin
57+
import kotlinx.coroutines.job
5758
import kotlinx.coroutines.launch
5859
import org.jetbrains.plugins.gradle.util.GradleUtil
5960

@@ -68,8 +69,9 @@ class MinecraftFacetDetector : ProjectActivity {
6869

6970
override suspend fun execute(project: Project) {
7071
val detectorService = project.service<FacetDetectorScopeProvider>()
71-
detectorService.currentJob?.let { it.cancelAndJoin() }
72+
detectorService.currentJob?.cancelAndJoin()
7273
withBackgroundProgress(project, "Detecting Minecraft Frameworks", cancellable = false) {
74+
detectorService.currentJob = coroutineContext.job
7375
MinecraftModuleRootListener.doCheck(project)
7476
}
7577
}
@@ -88,8 +90,9 @@ class MinecraftFacetDetector : ProjectActivity {
8890
val project = event.source as? Project ?: return
8991
val detectorService = project.service<FacetDetectorScopeProvider>()
9092
detectorService.scope.launch {
91-
detectorService.currentJob?.let { it.cancelAndJoin() }
93+
detectorService.currentJob?.cancelAndJoin()
9294
withBackgroundProgress(project, "Detecting Minecraft Frameworks", cancellable = false) {
95+
detectorService.currentJob = coroutineContext.job
9396
doCheck(project)
9497
}
9598
}

src/main/kotlin/platform/MinecraftProjectViewNodeDecorator.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MinecraftProjectViewNodeDecorator : ProjectViewNodeDecorator {
3939
return
4040
}
4141

42-
if (node !is PsiDirectoryNode) {
42+
if (node !is PsiDirectoryNode || !node.isValid) {
4343
return
4444
}
4545

src/main/resources/META-INF/plugin.xml

-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,6 @@
11211121
<!--endregion-->
11221122
<!--endregion-->
11231123

1124-
<registryKey defaultValue="false" description="Enable the Minecraft Wizard finalizer step." key="mcdev.wizard.finalizer"/>
11251124
<registryKey defaultValue="true" description="Use the new mappings parser." key="mcdev.new.tsrg.parser"/>
11261125
</extensions>
11271126

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
#
2+
# Minecraft Development for IntelliJ
3+
#
4+
# https://mcdev.io/
5+
#
6+
# Copyright (C) 2024 minecraft-dev
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU Lesser General Public License as published
10+
# by the Free Software Foundation, version 3.0 only.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Lesser General Public License
18+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
#
20+
21+
creator.ui.build_system.label.generic=构建系统:
22+
creator.ui.build_system.label.gradle=Gradle
23+
creator.ui.build_system.label.maven=Maven
24+
25+
creator.ui.group.title=构建系统配置
26+
creator.ui.group.group_id=组 ID:
27+
creator.ui.group.artifact_id=工件 ID:
28+
creator.ui.group.version=版本:
29+
30+
creator.ui.platform.type.label=平台类型:
31+
creator.ui.platform.label=平台:
32+
creator.ui.platform.mod.name=Mod
33+
creator.ui.platform.plugin.name=Plugin
34+
35+
creator.ui.license.label=许可证:
36+
creator.ui.main_class.label=主类:
37+
creator.ui.mc_version.label=Minecraft 版本:
38+
creator.ui.mod_name.label=Mod 名称:
39+
creator.ui.plugin_name.label=Plugin 名称:
40+
creator.ui.description.label=简介:
41+
creator.ui.authors.label=作者:
42+
creator.ui.website.label=网站:
43+
creator.ui.repository.label=仓库:
44+
creator.ui.issue_tracker.label=Issue Tracker:
45+
creator.ui.update_url.label=更新 URL:
46+
creator.ui.depend.label=依赖:
47+
creator.ui.soft_depend.label=软依赖:
48+
creator.ui.mixins.label=使用 Mixins:
49+
creator.ui.parchment.label=Parchment:
50+
creator.ui.parchment.include.label=Include:
51+
creator.ui.parchment.include.old_mc.label=更旧的 Minecraft 版本
52+
creator.ui.parchment.include.snapshots.label=快照版本
53+
creator.ui.parchment.no_version.message=没有与您的配置相匹配的 Parchment 版本
54+
55+
creator.ui.outdated.message=Minecraft 项目向导过时了吗? \
56+
<a href="{0}">创建一个 issue</a> 在 MinecraftDev 的 Issue Tracker。
57+
58+
creator.ui.generic_validation_failure.message=无法 {0} {1}
59+
creator.ui.generic_unfinished.message=尚未完成 {0}
60+
61+
creator.ui.create_minecraft_project=创建新的 Minecraft 项目
62+
63+
creator.step.generic.project_created.message=正在创建您的项目
64+
65+
creator.step.gradle.patch_gradle.description=修补 Gradle 文件
66+
creator.step.gradle.import_gradle.description=导入 Gradle 项目
67+
68+
creator.step.wait_for_smart.description=索引中
69+
70+
creator.step.maven.patch_pom.description=修补 pom.xml
71+
creator.step.maven.import_maven.description=导入 Maven 项目
72+
73+
creator.step.reformat.description=重新设置文件格式
74+
75+
creator.validation.group_id_non_example=组 ID 必须从 "org.example "更改为 "org.example"。
76+
creator.validation.semantic_version=版本必须是有效的语义版本
77+
78+
creator.validation.jdk_preferred=Java {0} 推荐用于 {1}
79+
creator.validation.jdk_preferred_default_reason=这些设置
80+
81+
error_reporter.submit.action=向 Minecraft Dev 的 GitHub Issue Tracker报告
82+
error_reporter.submit.failure=预期为 HTTP_CREATED (201),结果为 {0}。
83+
error_reporter.submit.ignored=忽略错误
84+
85+
error_reporter.report.title=错误报告
86+
error_reporter.report.created=成功创建 Issue #{0}。
87+
error_reporter.report.created.action=查看 issue
88+
error_reporter.report.commented=已成功 comment 现有 Issue #{0}。
89+
error_reporter.report.commented.action=查看 comment
90+
91+
error_reporter.report.error=提交 Issue 时出错: {0}.
92+
error_reporter.report.error.action=在 GitHub Issue Tracker 上打开一个 issue
93+
94+
facet.editor.name=Minecraft 模块设置
95+
96+
generate.event_listener.title=生成 Event Listener
97+
generate.event_listener.settings=Event Listener 设置
98+
99+
generate.class.caption=Minecraft 类
100+
generate.class.description=为模组制作者生成类
101+
102+
generate.color.change_action=更改颜色
103+
generate.color.change_error=无法更改 {0} 中的颜色
104+
generate.color.choose_action=选择颜色
105+
106+
insight.event_listener.marker=Event Listener 行标记
107+
insight.event_listener.marker.goto=转到 Event 声明
108+
insight.event_listener.marker.accessible_name=event listener 指示器
109+
insight.event_listener.marker.multiple=多重方法重载
110+
111+
insight.plugin.marker=Minecraft Plugin 行标记
112+
insight.plugin.marker.accessible_name=minecraft {0} entry point 指示器
113+
insight.plugin.marker.accessible_name_mod=mod
114+
insight.plugin.marker.accessible_name_plugin=plugin
115+
insight.plugin.marker.accessible_name_unsure=mod 或 plugin
116+
117+
inspection.is_cancelled.name=无用的 event isCancelled 检查
118+
inspection.is_cancelled.description=报告无用的 event 取消检查
119+
inspection.entry_point.name=Minecraft Entry Point
120+
inspection.entity_data_param.description=当传递给实体数据参数定义的类与包含的实体类不一致时,会发出报告。
121+
inspection.entity_data_param.message=实体类与此实体类不匹配
122+
inspection.entity_data_param.fix=用该实体类替换其他实体类
123+
124+
nbt.compression.gzip=GZipped
125+
nbt.compression.uncompressed=未压缩
126+
nbt.compression.file_type.label=压缩:
127+
nbt.compression.save.button=保存
128+
129+
nbt.file_type.name=NBT
130+
nbt.file_type.description=NBT
131+
132+
nbt.lang.annotate.material=Material
133+
nbt.lang.annotate.type_byte=类型: byte
134+
nbt.lang.annotate.type_short=类型: short
135+
nbt.lang.annotate.type_long=类型: long
136+
nbt.lang.annotate.type_float=类型: float
137+
nbt.lang.annotate.type_double=类型: double
138+
139+
nbt.lang.display_name=NBT 文本
140+
nbt.lang.description=NBT 文本表示法(不要使用这一种)
141+
142+
nbt.lang.highlighting.keyword.display_name=关键词(Keyword)
143+
nbt.lang.highlighting.string.display_name=字符串(String)
144+
nbt.lang.highlighting.unquoted_string.display_name=未引用字符串(Unquoted string)
145+
nbt.lang.highlighting.name.display_name=名称(Name)
146+
nbt.lang.highlighting.unquoted_name.display_name=未引用名称(Unquoted name)
147+
nbt.lang.highlighting.byte.display_name=字节型(Byte)
148+
nbt.lang.highlighting.short.display_name=短整型(Short)
149+
nbt.lang.highlighting.int.display_name=整型(Int)
150+
nbt.lang.highlighting.long.display_name=长整型(Long)
151+
nbt.lang.highlighting.float.display_name=单精度浮点数类型(Float)
152+
nbt.lang.highlighting.double.display_name=双精度浮点数类型(Double)
153+
nbt.lang.highlighting.material.display_name=Material
154+
155+
nbt.lang.style.space_before_colon=冒号前的空格
156+
nbt.lang.style.space_after_colon=冒号后的空格
157+
nbt.lang.style.list_brackets=列表括号
158+
nbt.lang.style.array_parentheses=数组括号
159+
160+
nbt.lang.inlay_hints.one_child=1 child
161+
nbt.lang.inlay_hints.children={0} children
162+
163+
nbt.lang.errors.unknown=未知错误。
164+
nbt.lang.errors.invalid_list=列表只能包含相同类型的元素。
165+
nbt.lang.errors.wrong_tag_id=发现意外标签 ID: {0}.
166+
nbt.lang.errors.invalid_root=NBT 文件中的根标签不是复合(Compound)标签。
167+
nbt.lang.errors.reading=读取文件时出错。
168+
nbt.lang.errors.parse_timeout=超过 NBT 解析超时 - 解析时间: {0},超时: {1}。
169+
170+
nbt.lang.errors.wrapped_error_message=错误的 NBT 文件:\n{0}
171+
172+
nbt.editor.name=NBT 文本
173+
174+
nbt.file.save_notify.success.title=已成功保存 NBT 文件
175+
nbt.file.save_notify.success.content={0} 已成功保存。
176+
177+
nbt.file.save_notify.file_type_error.title=保存 NBT 文件时出错
178+
nbt.file.save_notify.file_type_error.content=文件未被识别为 NBT 文件。这可能是由于文件类型关联错误或文件过大造成的。
179+
180+
nbt.file.save_notify.parse_error.title=保存 NBT 文件时出错
181+
nbt.file.save_notify.parse_error.content=由于文本表示中的错误,{0} 无法保存。
182+
nbt.file.save_notify.parse_exception.title=保存 NBT 文件时出错
183+
nbt.file.save_notify.parse_exception.content=发生意外异常,{0} 无法保存: {1}
184+
185+
intention.error.cannot.create.class.message=无法创建类 ''{0}''\n{1}
186+
intention.error.cannot.create.class.title=创建类失败
187+
188+
minecraft.settings.display_name=Minecraft Development
189+
minecraft.settings.title=Minecraft Development 设置
190+
minecraft.settings.change_update_channel=更改插件更新通道
191+
minecraft.settings.show_project_platform_icons=显示项目平台图标
192+
minecraft.settings.show_event_listener_gutter_icons=显示 event listener 槽图标
193+
minecraft.settings.show_chat_color_gutter_icons=显示聊天颜色槽图标
194+
minecraft.settings.show_chat_color_underlines=显示聊天颜色下划线
195+
minecraft.settings.chat_color_underline_style=聊天颜色下划线样式:
196+
minecraft.settings.mixin=Mixin
197+
minecraft.settings.mixin.shadow_annotation_same_line=@Shadow 注解在同一行

0 commit comments

Comments
 (0)