diff --git a/build.gradle.kts b/build.gradle.kts index 7eedce8f7..c62a3e963 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ plugins { mcdev groovy idea - id("org.jetbrains.intellij") version "1.16.0" + id("org.jetbrains.intellij") version "1.17.0" id("org.cadixdev.licenser") id("org.jlleitschuh.gradle.ktlint") version "10.3.0" } diff --git a/gradle.properties b/gradle.properties index 87ca45d6c..6fb055e01 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,7 @@ kotlin.code.style=official ideaVersion = 2023.3 ideaVersionName = 2023.3 -coreVersion = 1.7.0 +coreVersion = 1.7.1 downloadIdeaSources = true pluginTomlVersion = 233.11799.172 diff --git a/src/main/kotlin/facet/MinecraftFacet.kt b/src/main/kotlin/facet/MinecraftFacet.kt index b135918b8..4bba04866 100644 --- a/src/main/kotlin/facet/MinecraftFacet.kt +++ b/src/main/kotlin/facet/MinecraftFacet.kt @@ -27,6 +27,7 @@ import com.demonwav.mcdev.platform.AbstractModuleType import com.demonwav.mcdev.platform.PlatformType import com.demonwav.mcdev.util.SourceType import com.demonwav.mcdev.util.filterNotNull +import com.demonwav.mcdev.util.invokeAndWait import com.demonwav.mcdev.util.mapFirstNotNull import com.google.common.collect.HashMultimap import com.intellij.facet.Facet @@ -121,7 +122,11 @@ class MinecraftFacet( ProjectView.getInstance(module.project).refresh() } - private fun updateRoots() { + private fun updateRoots() = invokeAndWait { + if (module.isDisposed) { + return@invokeAndWait + } + roots.clear() val rootManager = ModuleRootManager.getInstance(module) diff --git a/src/main/kotlin/platform/MinecraftProjectViewNodeDecorator.kt b/src/main/kotlin/platform/MinecraftProjectViewNodeDecorator.kt index 0e337ca59..568303bf6 100644 --- a/src/main/kotlin/platform/MinecraftProjectViewNodeDecorator.kt +++ b/src/main/kotlin/platform/MinecraftProjectViewNodeDecorator.kt @@ -39,7 +39,7 @@ class MinecraftProjectViewNodeDecorator : ProjectViewNodeDecorator { return } - if (node !is PsiDirectoryNode) { + if (node !is PsiDirectoryNode || !node.isValid) { return } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 40f8f494f..5060a22f9 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1121,7 +1121,6 @@ - diff --git a/src/main/resources/messages/MinecraftDevelopment_zh.properties b/src/main/resources/messages/MinecraftDevelopment_zh.properties new file mode 100644 index 000000000..5cac19f5d --- /dev/null +++ b/src/main/resources/messages/MinecraftDevelopment_zh.properties @@ -0,0 +1,197 @@ +# +# Minecraft Development for IntelliJ +# +# https://mcdev.io/ +# +# Copyright (C) 2024 minecraft-dev +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, version 3.0 only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . +# + +creator.ui.build_system.label.generic=构建系统: +creator.ui.build_system.label.gradle=Gradle +creator.ui.build_system.label.maven=Maven + +creator.ui.group.title=构建系统配置 +creator.ui.group.group_id=组 ID: +creator.ui.group.artifact_id=工件 ID: +creator.ui.group.version=版本: + +creator.ui.platform.type.label=平台类型: +creator.ui.platform.label=平台: +creator.ui.platform.mod.name=Mod +creator.ui.platform.plugin.name=Plugin + +creator.ui.license.label=许可证: +creator.ui.main_class.label=主类: +creator.ui.mc_version.label=Minecraft 版本: +creator.ui.mod_name.label=Mod 名称: +creator.ui.plugin_name.label=Plugin 名称: +creator.ui.description.label=简介: +creator.ui.authors.label=作者: +creator.ui.website.label=网站: +creator.ui.repository.label=仓库: +creator.ui.issue_tracker.label=Issue Tracker: +creator.ui.update_url.label=更新 URL: +creator.ui.depend.label=依赖: +creator.ui.soft_depend.label=软依赖: +creator.ui.mixins.label=使用 Mixins: +creator.ui.parchment.label=Parchment: +creator.ui.parchment.include.label=Include: +creator.ui.parchment.include.old_mc.label=更旧的 Minecraft 版本 +creator.ui.parchment.include.snapshots.label=快照版本 +creator.ui.parchment.no_version.message=没有与您的配置相匹配的 Parchment 版本 + +creator.ui.outdated.message=Minecraft 项目向导过时了吗? \ + 创建一个 issue 在 MinecraftDev 的 Issue Tracker。 + +creator.ui.generic_validation_failure.message=无法 {0} {1} +creator.ui.generic_unfinished.message=尚未完成 {0} + +creator.ui.create_minecraft_project=创建新的 Minecraft 项目 + +creator.step.generic.project_created.message=正在创建您的项目 + +creator.step.gradle.patch_gradle.description=修补 Gradle 文件 +creator.step.gradle.import_gradle.description=导入 Gradle 项目 + +creator.step.wait_for_smart.description=索引中 + +creator.step.maven.patch_pom.description=修补 pom.xml +creator.step.maven.import_maven.description=导入 Maven 项目 + +creator.step.reformat.description=重新设置文件格式 + +creator.validation.group_id_non_example=组 ID 必须从 "org.example "更改为 "org.example"。 +creator.validation.semantic_version=版本必须是有效的语义版本 + +creator.validation.jdk_preferred=Java {0} 推荐用于 {1} +creator.validation.jdk_preferred_default_reason=这些设置 + +error_reporter.submit.action=向 Minecraft Dev 的 GitHub Issue Tracker报告 +error_reporter.submit.failure=预期为 HTTP_CREATED (201),结果为 {0}。 +error_reporter.submit.ignored=忽略错误 + +error_reporter.report.title=错误报告 +error_reporter.report.created=成功创建 Issue #{0}。 +error_reporter.report.created.action=查看 issue +error_reporter.report.commented=已成功 comment 现有 Issue #{0}。 +error_reporter.report.commented.action=查看 comment + +error_reporter.report.error=提交 Issue 时出错: {0}. +error_reporter.report.error.action=在 GitHub Issue Tracker 上打开一个 issue + +facet.editor.name=Minecraft 模块设置 + +generate.event_listener.title=生成 Event Listener +generate.event_listener.settings=Event Listener 设置 + +generate.class.caption=Minecraft 类 +generate.class.description=为模组制作者生成类 + +generate.color.change_action=更改颜色 +generate.color.change_error=无法更改 {0} 中的颜色 +generate.color.choose_action=选择颜色 + +insight.event_listener.marker=Event Listener 行标记 +insight.event_listener.marker.goto=转到 Event 声明 +insight.event_listener.marker.accessible_name=event listener 指示器 +insight.event_listener.marker.multiple=多重方法重载 + +insight.plugin.marker=Minecraft Plugin 行标记 +insight.plugin.marker.accessible_name=minecraft {0} entry point 指示器 +insight.plugin.marker.accessible_name_mod=mod +insight.plugin.marker.accessible_name_plugin=plugin +insight.plugin.marker.accessible_name_unsure=mod 或 plugin + +inspection.is_cancelled.name=无用的 event isCancelled 检查 +inspection.is_cancelled.description=报告无用的 event 取消检查 +inspection.entry_point.name=Minecraft Entry Point +inspection.entity_data_param.description=当传递给实体数据参数定义的类与包含的实体类不一致时,会发出报告。 +inspection.entity_data_param.message=实体类与此实体类不匹配 +inspection.entity_data_param.fix=用该实体类替换其他实体类 + +nbt.compression.gzip=GZipped +nbt.compression.uncompressed=未压缩 +nbt.compression.file_type.label=压缩: +nbt.compression.save.button=保存 + +nbt.file_type.name=NBT +nbt.file_type.description=NBT + +nbt.lang.annotate.material=Material +nbt.lang.annotate.type_byte=类型: byte +nbt.lang.annotate.type_short=类型: short +nbt.lang.annotate.type_long=类型: long +nbt.lang.annotate.type_float=类型: float +nbt.lang.annotate.type_double=类型: double + +nbt.lang.display_name=NBT 文本 +nbt.lang.description=NBT 文本表示法(不要使用这一种) + +nbt.lang.highlighting.keyword.display_name=关键词(Keyword) +nbt.lang.highlighting.string.display_name=字符串(String) +nbt.lang.highlighting.unquoted_string.display_name=未引用字符串(Unquoted string) +nbt.lang.highlighting.name.display_name=名称(Name) +nbt.lang.highlighting.unquoted_name.display_name=未引用名称(Unquoted name) +nbt.lang.highlighting.byte.display_name=字节型(Byte) +nbt.lang.highlighting.short.display_name=短整型(Short) +nbt.lang.highlighting.int.display_name=整型(Int) +nbt.lang.highlighting.long.display_name=长整型(Long) +nbt.lang.highlighting.float.display_name=单精度浮点数类型(Float) +nbt.lang.highlighting.double.display_name=双精度浮点数类型(Double) +nbt.lang.highlighting.material.display_name=Material + +nbt.lang.style.space_before_colon=冒号前的空格 +nbt.lang.style.space_after_colon=冒号后的空格 +nbt.lang.style.list_brackets=列表括号 +nbt.lang.style.array_parentheses=数组括号 + +nbt.lang.inlay_hints.one_child=1 child +nbt.lang.inlay_hints.children={0} children + +nbt.lang.errors.unknown=未知错误。 +nbt.lang.errors.invalid_list=列表只能包含相同类型的元素。 +nbt.lang.errors.wrong_tag_id=发现意外标签 ID: {0}. +nbt.lang.errors.invalid_root=NBT 文件中的根标签不是复合(Compound)标签。 +nbt.lang.errors.reading=读取文件时出错。 +nbt.lang.errors.parse_timeout=超过 NBT 解析超时 - 解析时间: {0},超时: {1}。 + +nbt.lang.errors.wrapped_error_message=错误的 NBT 文件:\n{0} + +nbt.editor.name=NBT 文本 + +nbt.file.save_notify.success.title=已成功保存 NBT 文件 +nbt.file.save_notify.success.content={0} 已成功保存。 + +nbt.file.save_notify.file_type_error.title=保存 NBT 文件时出错 +nbt.file.save_notify.file_type_error.content=文件未被识别为 NBT 文件。这可能是由于文件类型关联错误或文件过大造成的。 + +nbt.file.save_notify.parse_error.title=保存 NBT 文件时出错 +nbt.file.save_notify.parse_error.content=由于文本表示中的错误,{0} 无法保存。 +nbt.file.save_notify.parse_exception.title=保存 NBT 文件时出错 +nbt.file.save_notify.parse_exception.content=发生意外异常,{0} 无法保存: {1} + +intention.error.cannot.create.class.message=无法创建类 ''{0}''\n{1} +intention.error.cannot.create.class.title=创建类失败 + +minecraft.settings.display_name=Minecraft Development +minecraft.settings.title=Minecraft Development 设置 +minecraft.settings.change_update_channel=更改插件更新通道 +minecraft.settings.show_project_platform_icons=显示项目平台图标 +minecraft.settings.show_event_listener_gutter_icons=显示 event listener 槽图标 +minecraft.settings.show_chat_color_gutter_icons=显示聊天颜色槽图标 +minecraft.settings.show_chat_color_underlines=显示聊天颜色下划线 +minecraft.settings.chat_color_underline_style=聊天颜色下划线样式: +minecraft.settings.mixin=Mixin +minecraft.settings.mixin.shadow_annotation_same_line=@Shadow 注解在同一行