本文整理汇总了Java中net.minecraftforge.common.config.Property.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java Property.setValue方法的具体用法?Java Property.setValue怎么用?Java Property.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Property
的用法示例。
在下文中一共展示了Property.setValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfigProperties
import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
@Override
public ConfigProperties getConfigProperties() {
Property property = Mobycraft.config.get("files", "docker-host", "Docker host IP",
"The IP of your Docker host (set using /docker host <host>); only used if DOCKER_HOST environment variable is not set");
if (property.isDefault()) {
property.setValue(getDefaultHost());
}
configProperties.setDockerHostProperty(property);
property = Mobycraft.config.get("files", "docker-cert-path", "File path",
"The directory path of your Docker certificate (set using /docker path <path>); only used if DOCKER_CERT_PATH environment variable is not set");
if (property.isDefault()) {
property.setValue(getDefaultPath());
}
configProperties.setCertPathProperty(property);
configProperties.setStartPosProperty(Mobycraft.config.get("container-building", "start-pos", "0, 0, 0",
"The position - x, y, z - to start building containers at (set using /docker start_pos"));
configProperties.setPollRateProperty(Mobycraft.config.get("container-building", "poll-rate", "2",
"The rate in seconds at which the containers will update (set using /docker poll_rate <rate in seconds>)"));
MainCommand.maxCount = (int) Math.floor((Float.parseFloat(configProperties.getPollRateProperty().getString()) * 50));
return configProperties;
}
示例2: generateSoundList
import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
protected void generateSoundList(final ConfigCategory cat) {
cat.setRequiresMcRestart(false);
cat.setRequiresWorldRestart(false);
final SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
final List<String> sounds = new ArrayList<String>();
for (final Object resource : handler.soundRegistry.getKeys())
sounds.add(resource.toString());
Collections.sort(sounds);
final SoundRegistry registry = RegistryManager.get(RegistryType.SOUND);
for (final String sound : sounds) {
final Property prop = new Property(sound, "", Property.Type.STRING);
prop.setDefaultValue("");
prop.setRequiresMcRestart(false);
prop.setRequiresWorldRestart(false);
prop.setConfigEntryClass(SoundConfigEntry.class);
final StringBuilder builder = new StringBuilder();
if (registry.isSoundBlocked(sound))
builder.append(GuiConstants.TOKEN_BLOCK).append(' ');
if (registry.isSoundCulled(sound))
builder.append(GuiConstants.TOKEN_CULL).append(' ');
final float v = registry.getVolumeScale(sound);
if (v != 1.0F)
builder.append((int) (v * 100F));
prop.setValue(builder.toString());
cat.put(sound, prop);
}
}