本文整理匯總了Java中ninja.leaping.configurate.ConfigurationNode.setValue方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationNode.setValue方法的具體用法?Java ConfigurationNode.setValue怎麽用?Java ConfigurationNode.setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ninja.leaping.configurate.ConfigurationNode
的用法示例。
在下文中一共展示了ConfigurationNode.setValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode floor_block_type_node = node.getNode("FLOOR_BLOCK_TYPE");
ConfigurationNode fence_block_type_node = node.getNode("FENCE_BLOCK_TYPE");
ConfigurationNode crate_block_type_node = node.getNode("CRATE_BLOCK_TYPE");
ConfigurationNode hologram_node = node.getNode("HOLOGRAM");
ConfigurationNode close_delay_node = node.getNode("CLOSE_DELAY");
ConfigurationNode open_manager_node = node.getNode("OPEN_MANAGER");
floor_block_type_node.setValue(floor_block_type_combo_box.getSelectedText());
fence_block_type_node.setValue(fence_block_type_combo_box.getSelectedText());
crate_block_type_node.setValue(crate_block_type_combo_box.getSelectedText());
hologram_node.setValue(hologram_field.hasText() ? hologram_field.getText() : null);
close_delay_node.setValue(close_delay_field.hasText() ? close_delay_field.getText() : null);
open_manager_node.setValue(open_manager_panel.getNode());
} catch (Exception e) {
throw new RuntimeException("Exception saving Animation1 Open Manager Configuration Dialog!", e);
}
}
示例2: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public ConfigurationNode save() {
try {
ConfigurationNode node = SimpleConfigurationNode.root();
ConfigurationNode world_node = node.getNode("WORLD");
ConfigurationNode x_node = node.getNode("X");
ConfigurationNode y_node = node.getNode("Y");
ConfigurationNode z_node = node.getNode("Z");
world_node.setValue(world_field.hasText() ? world_field.getText() : null);
x_node.setValue(x_field.hasText() ? x_field.getText() : null);
y_node.setValue(y_field.hasText() ? y_field.getText() : null);
z_node.setValue(z_field.hasText() ? z_field.getText() : null);
return node;
} catch (Exception e) {
throw new RuntimeException("Exception saving Location Panel!", e);
}
}
示例3: serialize
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void serialize(TypeToken<?> t, Text o, ConfigurationNode value) throws ObjectMappingException
{
if (o != null)
{
value.setValue(TextSerializers.FORMATTING_CODE.serialize(o));
}
}
示例4: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode permission_node = node.getNode("PERMISSION");
ConfigurationNode preview1_node = node.getNode("PREVIEW1");
ConfigurationNode preview2_node = node.getNode("PREVIEW2");
permission_node.setValue(permission_field.hasText() ? permission_field.getText() : null);
preview1_node.setValue(preview1_panel.getNode());
preview2_node.setValue(preview2_panel.getNode());
} catch (Exception e) {
throw new RuntimeException("Exception saving Permission Preview Configuration Dialog!", e);
}
}
示例5: get
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public int get(Player player) {
ConfigurationNode delay_node = GWMCrates.getInstance().getTimedCasesDelaysConfig().
getNode(player.getUniqueId().toString(), virtual_name);
if (delay_node.isVirtual()) {
return Integer.MAX_VALUE;
}
long delay = delay_node.getLong();
if (System.currentTimeMillis() >= delay) {
delay_node.setValue(null);
return Integer.MAX_VALUE;
} else {
return 0;
}
}
示例6: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode child_key_node = node.getNode("CHILD_KEY");
ConfigurationNode amount_node = node.getNode("AMOUNT");
child_key_node.setValue(child_key_panel.getNode());
amount_node.setValue(amount_field.hasText() ? amount_field.getText() : null);
} catch (Exception e) {
throw new RuntimeException("Exception saving Multiple Amount Configuration Dialog!", e);
}
}
示例7: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
public ConfigurationNode save() {
try {
ConfigurationNode node = SimpleConfigurationNode.root();
ConfigurationNode item_type_node = node.getNode("ITEM_TYPE");
ConfigurationNode quantity_node = node.getNode("QUANTITY");
ConfigurationNode sub_id_node = node.getNode("SUB_ID");
ConfigurationNode nbt_node = node.getNode("NBT");
ConfigurationNode durability_node = node.getNode("DURABILITY");
ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
ConfigurationNode lore_node = node.getNode("LORE");
ConfigurationNode enchantments_node = node.getNode("ENCHANTMENTS");
ConfigurationNode hide_enchantments_node = node.getNode("HIDE_ENCHANTMENTS");
String item_type = item_type_combo_box.getSelectedText();
item_type_node.setValue(item_type.equals("NO ITEM") ? null : item_type);
quantity_node.setValue(quantity_field.hasText() ? quantity_field.getText() : null);
sub_id_node.setValue(sub_id_field.hasText() ? sub_id_field.getText() : null);
durability_node.setValue(durability_field.hasText() ? durability_field.getText() : null);
display_name_node.setValue(display_name_field.hasText() ? display_name_field.getText() : null);
lore_node.setValue(lore_text_area.hasText() ? Utils.stringToList(lore_text_area.getText()) : null);
if (!enchantments.isEmpty()) {
List<ConfigurationNode> enchantments_node_list = new ArrayList<ConfigurationNode>();
for (GUIEnchantment enchantment : enchantments) {
ConfigurationNode enchantment_node = SimpleConfigurationNode.root();
enchantment_node.getNode("ENCHANTMENT").setValue(enchantment.getEnchantmentComboBox().getSelectedText());
enchantment_node.getNode("LEVEL").setValue(Integer.valueOf(enchantment.getEnchantmentLevelSpinner().getValue().toString()));
enchantments_node_list.add(enchantment_node);
}
enchantments_node.setValue(enchantments_node_list);
} else {
enchantments_node.setValue(null);
}
hide_enchantments_node.setValue(hide_enchantments_check_box.isSelected() ? true : null);
return node;
} catch (Exception e) {
throw new RuntimeException("Exception saving Item Panel!", e);
}
}
示例8: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
ConfigurationNode delay_node = node.getNode("DELAY");
virtual_name_node.setValue(virtual_name_field.hasText() ? virtual_name_field.getText() : null);
delay_node.setValue(delay_field.hasText() ? delay_field.getText() : null);
} catch (Exception e) {
throw new RuntimeException("Exception saving Timed Key Configuration Dialog!", e);
}
}
示例9: process
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override public void process(ConfigurationNode cn) throws ObjectMappingException {
if (cn.isVirtual()) {
return;
}
cn.setValue(ttListString, cn.getList(ttString).stream().map(x -> x.toLowerCase().replace(" ", "_")).collect(Collectors.toList()));
}
示例10: process
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override public void process(ConfigurationNode cn) throws ObjectMappingException {
if (cn.isVirtual()) {
return;
}
cn.setValue(ttListString,
cn.getList(ttString).stream().map(x -> x.startsWith("/") ? x.substring(1) : x).collect(Collectors.toList()));
}
示例11: add
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void add(Player player, int amount) {
ConfigurationNode delay_node = GWMCrates.getInstance().getTimedKeysDelaysConfig().
getNode(player.getUniqueId().toString(), virtual_name);
if (amount > 0) {
delay_node.setValue(null);
} else if (amount < 0) {
delay_node.setValue(System.currentTimeMillis() + delay);
}
}
示例12: serializeTo
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override public void serializeTo(Object instance, ConfigurationNode node) throws ObjectMappingException {
if (this.set) {
if (this.useIfNullWhenSaving && instance == null) {
node.setValue(this.defaultValue);
} else {
this.fieldData.serializeTo(instance, node);
}
}
}
示例13: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
virtual_name_node.setValue(virtual_name_field.hasText() ? virtual_name_field.getText() : null);
} catch (Exception e) {
throw new RuntimeException("Exception saving Virtual Case Configuration Dialog!", e);
}
}
示例14: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode location_node = node.getNode("LOCATION");
ConfigurationNode hologram_node = node.getNode("HOLOGRAM");
ConfigurationNode start_preview_on_left_click = node.getNode("START_PREVIEW_ON_LEFT_CLICK");
location_node.setValue(location_panel.save());
hologram_node.setValue(hologram_field.hasText() ? hologram_field.getText() : null);
start_preview_on_left_click.setValue(start_preview_on_left_click_check_box.isSelected() ? true : null);
} catch (Exception e) {
throw new RuntimeException("Exception saving Block Case Configuration Dialog!", e);
}
}
示例15: save
import ninja.leaping.configurate.ConfigurationNode; //導入方法依賴的package包/類
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode permission_node = node.getNode("PERMISSION");
ConfigurationNode open_manager1_node = node.getNode("OPEN_MANAGER1");
ConfigurationNode open_manager2_node = node.getNode("OPEN_MANAGER2");
permission_node.setValue(permission_field.hasText() ? permission_field.getText() : null);
open_manager1_node.setValue(open_manager1_panel.getNode());
open_manager2_node.setValue(open_manager2_panel.getNode());
} catch (Exception e) {
throw new RuntimeException("Exception saving Permission Open Manager Configuration Dialog!", e);
}
}