當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。