当前位置: 首页>>代码示例>>Java>>正文


Java Property.wasRead方法代码示例

本文整理汇总了Java中net.minecraftforge.common.config.Property.wasRead方法的典型用法代码示例。如果您正苦于以下问题:Java Property.wasRead方法的具体用法?Java Property.wasRead怎么用?Java Property.wasRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.config.Property的用法示例。


在下文中一共展示了Property.wasRead方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setValue

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public void setValue(Property inFile) {
    Type oldValue = value();
    set = inFile.wasRead();
    if (set) {
        try {
            value = dataFrom(inFile);
        } catch (NullPointerException e) {
            value = value();
        }
    } else {
        value = value();
    }
    if ((oldValue ==null&&value()!=null)) {
        //ConfigManager.logger.info("updating null to "+value().toString());
        update(value());
    } else {
        if (!oldValue.equals(value())) {
            //ConfigManager.logger.info("updating "+this.key+ " to "+value().toString());
            update(value());
        }
    }
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:23,代码来源:Settings.java

示例2: setValue

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public void setValue(Property inFile) {
    Type oldValue = value();
    set = inFile.wasRead();
    if (set) {
        value = dataFrom(inFile);
    } else {
        value = defaultValue;
    }
    if ((oldValue ==null&&value()!=null)) {
        ConfigManager.logger.info("updating null to "+value().toString());
        update(value());
    } else {
        if (!oldValue.equals(value())) {
            ConfigManager.logger.info("updating "+this.key+ " to "+value().toString());
            update(value());
        }
    }
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:Settings.java

示例3: preInit

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    logger = event.getModLog();
    config = new Configuration(event.getSuggestedConfigurationFile());
    Property breakChest = config.get("Balance", "BreakChestOnHarvest", true);
    if (!breakChest.wasRead())
        config.save();
    else
        breakChestOnHarvest = breakChest.getBoolean();

    registerTileEntities();

    NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);

    channel = NetworkRegistry.INSTANCE.newSimpleChannel(CHANNEL);

    int messageNumber = 0;
    channel.registerMessage(UpdatePlayersUsing.Handler.class, UpdatePlayersUsing.class, messageNumber++, Side.CLIENT);
    logger.debug("Final message number: " + messageNumber);

    proxy.preInit();
}
 
开发者ID:gigaherz,项目名称:Enderthing,代码行数:24,代码来源:Enderthing.java

示例4: getAxeLevelMultiplier

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public double getAxeLevelMultiplier(int axeLevel)
{
    if (axeLevelMap.containsKey(axeLevel))
        return axeLevelMap.get(axeLevel);

    double value = 1 + axeLevel;

    if (axeMultipliers != null)
    {
        Property p = axeMultipliers.get("AxeLevel" + axeLevel);
        if (p != null && p.wasRead())
        {
            value = p.getDouble();
        }
    }

    axeLevelMap.put(axeLevel, value);
    return value;
}
 
开发者ID:gigaherz,项目名称:Survivalist,代码行数:20,代码来源:ConfigManager.java

示例5: loadConfig

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
static void loadConfig(File configurationFile)
{
    config = new Configuration(configurationFile);

    Property bl = config.get("items", "blacklist", new String[0]);
    bl.setComment("List of items to disallow from placing in the belt.");

    Property wl = config.get("items", "whitelist", new String[0]);
    wl.setComment("List of items to force-allow placing in the belt. Takes precedence over blacklist.");

    Property showBeltOnPlayersProperty = config.get("display", "showBeltOnPlayers", true);
    showBeltOnPlayersProperty.setComment("If set to FALSE, the belts and tools will NOT draw on players.");

    Property beltItemScaleProperty = config.get("display", "beltItemScale", 0.5);
    beltItemScaleProperty.setComment("Changes the scale of items on the belt.");

    Property releaseToSwapProperty = config.get("input", "releaseToSwap", false);
    releaseToSwapProperty.setComment("If set to TRUE, releasing the menu key (R) will activate the swap. Requires a click otherwise (default).");

    Property clipMouseToCircleProperty = config.get("input", "clipMouseToCircle", false);
    clipMouseToCircleProperty.setComment("If set to TRUE, the radial menu will try to prevent the mouse from leaving the outer circle.");

    Property allowClickOutsideBoundsProperty = config.get("input", "allowClickOutsideBounds", false);
    allowClickOutsideBoundsProperty.setComment("If set to TRUE, the radial menu will allow clicking outside the outer circle to activate the items.");

    display = config.getCategory("display");
    display.setComment("Options for customizing the display of tools on the player");

    input = config.getCategory("input");
    input.setComment("Options for customizing the interaction with the radial menu");

    showBeltOnPlayers = showBeltOnPlayersProperty.getBoolean();
    beltItemScale = (float)beltItemScaleProperty.getDouble();

    releaseToSwap = releaseToSwapProperty.getBoolean();
    clipMouseToCircle = clipMouseToCircleProperty.getBoolean();
    allowClickOutsideBounds = allowClickOutsideBoundsProperty.getBoolean();

    blackListString.addAll(Arrays.asList(bl.getStringList()));
    whiteListString.addAll(Arrays.asList(wl.getStringList()));
    if (!bl.wasRead() ||
            !wl.wasRead() ||
            !releaseToSwapProperty.wasRead() ||
            !showBeltOnPlayersProperty.wasRead() ||
            !beltItemScaleProperty.wasRead() ||
            !clipMouseToCircleProperty.wasRead() ||
            !allowClickOutsideBoundsProperty.wasRead())
    {
        config.save();
    }
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:52,代码来源:Config.java


注:本文中的net.minecraftforge.common.config.Property.wasRead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。