本文整理汇总了Java中net.minecraftforge.fml.client.event.ConfigChangedEvent类的典型用法代码示例。如果您正苦于以下问题:Java ConfigChangedEvent类的具体用法?Java ConfigChangedEvent怎么用?Java ConfigChangedEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigChangedEvent类属于net.minecraftforge.fml.client.event包,在下文中一共展示了ConfigChangedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(VillagerInventoryMod.MODID))
{
if (!event.isWorldRunning() || Minecraft.getMinecraft().isSingleplayer())
{
ModConfiguration.syncConfig(false, true);
if (event.isWorldRunning() && Minecraft.getMinecraft().isSingleplayer())
{
VillagerInventoryMod.NETWORK.sendToServer(new ConfigSyncMessage());
}
}
}
}
示例2: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的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);
}
}
示例3: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(ModUncrafting.MODID))
{
if (!event.isWorldRunning() || Minecraft.getMinecraft().isSingleplayer())
{
syncFromGUI();
if (event.isWorldRunning() && Minecraft.getMinecraft().isSingleplayer())
{
ModUncrafting.NETWORK.sendToServer(new ConfigSyncMessage());
}
}
}
}
示例4: onConfigurationChangedEvent
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.getModID().equalsIgnoreCase(Reference.MOD_ID)) {
if (event.getConfigID().equals(Reference.catOptions)) {
loadConfig();
} else if (event.getConfigID().equals(Reference.catFullMapConfig)) {
Config.fullScreenMap.loadConfig();
} else if (event.getConfigID().equals(Reference.catLargeMapConfig)) {
Config.largeMap.loadConfig();
} else if (event.getConfigID().equals(Reference.catSmallMapConfig)) {
Config.smallMap.loadConfig();
} else {
Logging.logError("Unknown config id: %s", event.getConfigID());
}
if (configuration.hasChanged()) {
configuration.save();
}
}
}
示例5: onConfigurationChangedEvent
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{
try {
if (event.getModID().equalsIgnoreCase(Reference.MOD_ID)) {
load();
if (!_isInitializing) {
FullscreenWindowed.proxy.registerKeyBindings();
}
}
} catch (java.lang.NoSuchMethodError e) {
// In earlier versions of Forge (1.8), event.getModID() does not exist.
// While this means any config change in any 1.8 mod configuration will force a reload of our configuration,
// this is probably better than crashing...
load();
if (!_isInitializing) {
FullscreenWindowed.proxy.registerKeyBindings();
}
}
}
示例6: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的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.");
}
}
示例7: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的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);
}
}
示例8: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs)
{
if (!CreeperHost.MOD_ID.equals(eventArgs.getModID()))
{
return;
}
CreeperHost.instance.saveConfig();
}
示例9: onConfigChange
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigChange(ConfigChangedEvent.OnConfigChangedEvent event)
{
if (ToolBelt.MODID.equals(event.getModID()))
{
if (config.hasChanged())
config.save();
refresh();
}
}
示例10: onConfigChange
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的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);
}
}
示例11: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event)
{
if (event.getModID().equals(ModConstants.MODID)) {
ConfigManager.sync(ModConstants.MODID, Config.Type.INSTANCE);
}
}
示例12: onConfigurationChangedEvent
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{
if(event.getModID().equalsIgnoreCase(TheOink.MODID))
//Resync configs
syncConfiguration();
}
示例13: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
if ("authlibloginhelper".equals(event.getModID()))
{
AuthlibLoginHelperGuiFactory.Config.onConfigApplied();
}
}
示例14: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
// TF2weapons.syncConfig();
if (eventArgs.getModID().equals("rafradek_spin")) {
syncConfig();
}
}
示例15: onConfigChanged
import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
// TF2weapons.syncConfig();
if (eventArgs.getModID().equals("rafradek_tf2_weapons")) {
TF2ConfigVars.createConfig();
if(Minecraft.getMinecraft().player != null)
TF2weapons.network.sendToServer(new TF2Message.InitClientMessage(TF2weapons.conf));
}
}