本文整理汇总了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());
}
}
}
示例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());
}
}
}
示例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();
}
示例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;
}
示例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();
}
}