介绍
中文介绍正在准备中,下面暂时显示原文。
Description
TXCore adds INI configuration support to Minecraft mods (More usage will be added soon).
Usage User
Just put it in your mods folder.
Usage Developer
Repository
repositories {
maven {
url "https://raw.githubusercontent.com/Txuritan/maven-repository/master/"
}
}
Usage
dependencies {
compile 'com.github.txuritan:txcore:<VERSION>'
}
Load Order
@Mod(
dependencies = "required-after:txcore"
)
public class Core {
}
Your Config
package com.github.txuritan.txcore;
import com.github.txuritan.txcore.api.config.Configuration;
import com.github.txuritan.txcore.api.config.IIniConfig;
import com.github.txuritan.txcore.ini4j.Ini;
import org.apache.logging.log4j.Logger;
public class Config implements IIniConfig {
private Configuration configuration;
public Config(Configuration configuration) {
this.configuration = configuration;
}
private String section = "txcore";
private String sectionTest = section + ".test";
public Boolean debug;
public Boolean testBoolean;
public Double testDouble;
public Float testFloat;
public Integer testInteger;
public Long testLong;
public String testString;
@Override
public void config(Ini ini) {
debug = configuration.getSetKeyBoolean(ini, section, "debug", false);
if(debug) {
getLogger().info("Preforming CoreIni Check");
testBoolean = configuration.getSetKeyBoolean(ini, sectionTest, "testBoolean", false);
getLogger().info("Default value: false, gotten: " + configuration.getKeyBoolean(ini, sectionTest, "testBoolean"));
testDouble = configuration.getSetKeyDouble(ini, sectionTest, "testDouble", 1.0);
getLogger().info("Default value: 1.0, gotten: " + configuration.getKeyDouble(ini, sectionTest, "testDouble"));
testFloat = configuration.getSetKeyFloat(ini, sectionTest, "testFloat", 1.0f);
getLogger().info("Default value: 1.0f, gotten: " + configuration.getKeyFloat(ini, sectionTest, "testFloat"));
testInteger = configuration.getSetKeyInteger(ini, sectionTest, "testInteger", 1);
getLogger().info("Default value: 1, gotten: " + configuration.getKeyInteger(ini, sectionTest, "testInteger"));
testLong = configuration.getSetKeyLong(ini, sectionTest, "testLong", 1L);
getLogger().info("Default value: 1L, gotten: " + configuration.getKeyLong(ini, sectionTest, "testLong"));
testString = configuration.getSetKeyString(ini, sectionTest, "testString", "yay it works");
getLogger().info("Default value: \"yay it works\", gotten: " + configuration.getKeyString(ini, sectionTest, "testString"));
}
}
@Override
public Logger getLogger() {
return References.LOGGER;
}
@Override
public String configPath() {
return configuration.getSuggestedConfig();
}
@Override
public String modId() {
return References.MOD_ID;
}
}
Register
package com.github.txuritan.txcore.proxy;
import com.github.txuritan.txcore.Config;
import com.github.txuritan.txcore.api.config.Configuration;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
public class CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
Configuration.INSTANCE.registerConfig(new Config(Configuration.INSTANCE));
}
public void init(FMLInitializationEvent event) {
}
public void postInit(FMLPostInitializationEvent event) {
}
}
Output
[txcore.test]
testBoolean = false
testDouble = 1.0
testFloat = 1.0
testInteger = 1
testLong = 1
testString = yay it works
[txcore]
debug = false
Other
Modpacks
Yes.
Refactoring
Yes.
License
MIT License Copyright (c) 2017 Ian Cronkright Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
常见问题
TXCore 支持哪些 Minecraft 版本?
TXCore 支持 Minecraft Java 版 1.10.2–1.11.2,共 4 个版本,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。
TXCore 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Txuritan 的其他作品
查看全部 →Devotion IRC
by Txuritan
A IRC chat linker with the continuation of EiraIRC.
8,663
6 年前
CurseForge
Unmending
by Txuritan
Unmending is a very simple mod that nerfs Mending without making it useless.
5,026
1 年前
Modrinth
Mental
by Txuritan, _ForgeUser19488467
Tons of ores.Moths too.
1,073
9 年前
CurseForge
评论
登录后评论和评分