本文整理汇总了Java中net.minecraftforge.common.config.ConfigManager.sync方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigManager.sync方法的具体用法?Java ConfigManager.sync怎么用?Java ConfigManager.sync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.ConfigManager
的用法示例。
在下文中一共展示了ConfigManager.sync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
/**
* Inject the new values and save to the config file when the config has been changed from the GUI.
*
* @param event The event
*/
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.getModID().equals(Strings.MODID)) {
// sync GUI to settings..
ConfigManager.sync(Strings.MODID, Config.Type.INSTANCE);
// this also syncs when done
UniversalRemoteConfiguration.validateConfig();
int newCapacity = UniversalRemoteConfiguration.fuel.energy.energyCapacity;
// gotta set it to zero behind the scenes if energy isn't enabled
if (!UniversalRemoteConfiguration.fuel.fuelType.equals(UniversalRemoteConfiguration.FuelType.Energy.toString()))
{
newCapacity = 0;
}
// well crap gotta update the registered item now
ItemRegistry.Items().UniveralRemote.UpdateEnergySettings(
newCapacity,
UniversalRemoteConfiguration.fuel.energy.energyReceiveRate,
0);
}
}
示例2: keyTyped
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@Override
protected void keyTyped (char typedChar, int keyCode) throws IOException {
this.r.textboxKeyTyped(typedChar, keyCode);
this.g.textboxKeyTyped(typedChar, keyCode);
this.b.textboxKeyTyped(typedChar, keyCode);
this.a.textboxKeyTyped(typedChar, keyCode);
try {
int[] colour = { Integer.parseInt(this.r.getText()), Integer.parseInt(this.g.getText()), Integer.parseInt(this.b.getText()) };
MainConfig.client.hud.interfaceColour = colour;
int alpha = Integer.parseInt(this.a.getText());
MainConfig.client.hud.guiAlpha = alpha;
ConfigManager.sync(Reference.MODID, Config.Type.INSTANCE);
} catch (NumberFormatException e) {
}
super.keyTyped(typedChar, keyCode);
}
示例3: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(Names.MOD_ID)) {
ConfigManager.sync(Names.MOD_ID, Config.Type.INSTANCE);
PneumaticCraftRepressurized.logger.info("Configuration has been saved.");
}
}
示例4: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
/**
* Inject the new values and save to the config file when the config has
* been changed from the GUI.
*
* @param event
* The event
*/
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.getModID().equals(HardVox.MODID)) {
if (!validateConfig()) {
event.setResult(Result.DENY);
return;
}
ConfigManager.sync(HardVox.MODID, Config.Type.INSTANCE);
}
}
示例5: onConfigChange
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onConfigChange(ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.getModID().equals(FirstAid.MODID)) {
ConfigManager.sync(FirstAid.MODID, Config.Type.INSTANCE);
event.setResult(Event.Result.ALLOW);
}
}
示例6: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(ModConstants.MODID)) {
ConfigManager.sync(ModConstants.MODID, Config.Type.INSTANCE);
}
}
示例7: configChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void configChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if(event.getModID().equals(Reference.MOD_ID))
{
ConfigManager.sync(Reference.MOD_ID, Config.Type.INSTANCE);
}
}
示例8: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
/**
* Inject the new values and save to the config file when the config has been changed from the GUI.
*
* @param event The event
*/
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.getModID().equals(EssentialFeatures.MODID)) {
ConfigManager.sync(EssentialFeatures.MODID, Config.Type.INSTANCE);
}
}
示例9: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(TorchMasterMod.MODID))
{
ConfigManager.sync(TorchMasterMod.MODID, Config.Type.INSTANCE);
TorchRegistry.getMegaTorchRegistry().setTorchRange(MegaTorchRange);
TorchRegistry.getDreadLampRegistry().setTorchRange(DreadLampRange);
}
}
示例10: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(HardScience.MODID))
{
ConfigManager.sync(HardScience.MODID, Type.INSTANCE);
Configurator.recalcDerived();
}
}
示例11: sync
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
public static void sync() {
ConfigManager.sync(Names.MOD_ID, Config.Type.INSTANCE);
}
示例12: validateConfig
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
public static void validateConfig()
{
// make sure fuel type is valid
boolean isValueFuelType = false;
for (FuelType f: FuelType.values())
{
if (UniversalRemoteConfiguration.fuel.fuelType.equals(f.toString()))
{
isValueFuelType = true;
break;
}
}
if (!isValueFuelType)
{
Util.logger.error("Invalid fuel type of '{}' found in config. Reverting to default value.", UniversalRemoteConfiguration.fuel.fuelType);
// find the default
UniversalRemoteConfiguration.fuel.fuelType = new Fuel().fuelType;
}
// no negative values!
if (UniversalRemoteConfiguration.fuel.energy.energyCapacity < 0)
UniversalRemoteConfiguration.fuel.energy.energyCapacity = 0;
if (UniversalRemoteConfiguration.fuel.energy.energyReceiveRate < 0)
UniversalRemoteConfiguration.fuel.energy.energyReceiveRate = 0;
if (UniversalRemoteConfiguration.fuel.energy.energyCostPerBlock < 0)
UniversalRemoteConfiguration.fuel.energy.energyCostPerBlock = 0;
if (UniversalRemoteConfiguration.fuel.energy.energyCostMax < 0)
UniversalRemoteConfiguration.fuel.energy.energyCostMax = 0;
if (UniversalRemoteConfiguration.fuel.energy.energyCostBindBlock < 0)
UniversalRemoteConfiguration.fuel.energy.energyCostBindBlock = 0;
// better re-sync
ConfigManager.sync(Strings.MODID, Config.Type.INSTANCE);
}
示例13: onConfigChanged
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent event) {
if (event.getModID().equals(Bonfires.modid)) {
ConfigManager.sync(Bonfires.modid, Config.Type.INSTANCE);
}
}
示例14: onGuiClosed
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
@Override
public void onGuiClosed () {
super.onGuiClosed();
ConfigManager.sync(Reference.MODID, Config.Type.INSTANCE);
}
示例15: toggleShowGUI
import net.minecraftforge.common.config.ConfigManager; //导入方法依赖的package包/类
public static void toggleShowGUI () {
client.hud.AlwaysShowGUI += 1;
if (client.hud.AlwaysShowGUI > 2)
client.hud.AlwaysShowGUI = 0;
ConfigManager.sync(Reference.MODID, Config.Type.INSTANCE);
}