本文整理汇总了Java中net.minecraftforge.cauldron.TileEntityCache类的典型用法代码示例。如果您正苦于以下问题:Java TileEntityCache类的具体用法?Java TileEntityCache怎么用?Java TileEntityCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileEntityCache类属于net.minecraftforge.cauldron包,在下文中一共展示了TileEntityCache类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: load
import net.minecraftforge.cauldron.TileEntityCache; //导入依赖的package包/类
public void load()
{
try
{
config = YamlConfiguration.loadConfiguration(configFile);
String header = HEADER + "\n";
for (Setting toggle : settings.values())
{
if (!toggle.description.equals(""))
header += "Setting: " + toggle.path + " Default: " + toggle.def + " # " + toggle.description + "\n";
config.addDefault(toggle.path, toggle.def);
settings.get(toggle.path).setValue(config.getString(toggle.path));
}
config.options().header(header);
config.options().copyDefaults(true);
version = getInt("config-version", 1);
set("config-version", 1);
for (TileEntityCache teCache : CauldronHooks.tileEntityCache.values())
{
teCache.tickNoPlayers = config.getBoolean( "world-settings." + teCache.worldName + "." + teCache.configPath + ".tick-no-players", config.getBoolean( "world-settings.default." + teCache.configPath + ".tick-no-players") );
teCache.tickInterval = config.getInt( "world-settings." + teCache.worldName + "." + teCache.configPath + ".tick-interval", config.getInt( "world-settings.default." + teCache.configPath + ".tick-interval") );
}
this.saveWorldConfigs();
this.save();
}
catch (Exception ex)
{
MinecraftServer.getServer().logSevere("Could not load " + this.configFile);
ex.printStackTrace();
}
}
开发者ID:UraniumMC,项目名称:Uranium,代码行数:35,代码来源:TileEntityConfig.java
示例2: load
import net.minecraftforge.cauldron.TileEntityCache; //导入依赖的package包/类
public void load()
{
try
{
config = YamlConfiguration.loadConfiguration(configFile);
String header = HEADER + "\n";
StringBuilder headerSB = new StringBuilder(header);
for (Setting toggle : settings.values())
{
if (!toggle.description.equals(""))
headerSB.append("Setting: ").append(toggle.path).append(" Default: ").append(toggle.def).append(" # ").append(toggle.description).append("\n");
config.addDefault(toggle.path, toggle.def);
settings.get(toggle.path).setValue(config.getString(toggle.path));
}
header = String.valueOf(headerSB);
config.options().header(header);
config.options().copyDefaults(true);
version = getInt("config-version", 1);
set("config-version", 1);
for (TileEntityCache teCache : CauldronHooks.tileEntityCache.values())
{
teCache.tickNoPlayers = config.getBoolean( "world-settings." + teCache.worldName + "." + teCache.configPath + ".tick-no-players", config.getBoolean( "world-settings.default." + teCache.configPath + ".tick-no-players") );
teCache.tickInterval = config.getInt( "world-settings." + teCache.worldName + "." + teCache.configPath + ".tick-interval", config.getInt( "world-settings.default." + teCache.configPath + ".tick-interval") );
}
this.saveWorldConfigs();
this.save();
}
catch (Exception ex)
{
MinecraftServer.getServer().logSevere("Could not load " + this.configFile);
ex.printStackTrace();
}
}
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:37,代码来源:TileEntityConfig.java
注:本文中的net.minecraftforge.cauldron.TileEntityCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论