我已经为我的mod提供了mcmod.info,但是在IntelliJ中运行Minecraft Client之后,该mod确实已加载,但是无法正确加载mcmod.info。在Minecraft Client的启动过程中,出现了一条警告:
[客户端线程/ WARN] [FML]:Mod testforge缺少必需的元素“版本”,并且找不到后备。替换为“ 1.0”。
当我进入mod按钮并查看mod信息后,我的mod出现在mod列表中,但它显示如下:
testforge
版本:1.0
Mod状态:可用
未找到国防部信息
请您的国防部作者提供一个国防部mcmod.info文件
我已经尝试了很多事情来调试它,但是都失败了。
build.gradle
buildscript {
repositories {
jcenter()
maven { url = "https://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
version = "1.0.0"
group = "com.galaxy.forge"
archivesBaseName = "Test Forge"
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "1.12.2-14.23.5.2838"
runDir = "run"
mappings = "snapshot_20171003"
}
dependencies {
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
src / main / resources / mcmod.info
[{
"modid": "testforge",
"name": "TestForge",
"description": "Test description",
"version": "1.0.0",
"mcversion": "1.12.2",
"url": "minecraftforge.net/",
"authorList": ["GalaxyIT"],
"credits": "I'd like to thank anyone who can help me >.<"
}]
src / main / java / com / galaxy / forge / testforge / TestForge.java
package com.galaxy.forge.testforge;
import net.minecraftforge.fml.common.Mod;
@Mod(modid = "testforge", useMetadata = true)
public class TestForge {
}
答案 0 :(得分:1)
您必须修改TestForge.java中的Pmax = np.array([40, 170, 520, 200, 100])
批注。您错过了 mod版本,但是FML从@Mod
获取并使用了它。
因此,仅引发警告。
要对其进行修复,必须将参数添加到mcmod.info
@Mod(modid="testforge",useMetadata=true)
得到的version="1.0.0"