本文整理汇总了Java中ninja.leaping.configurate.ConfigurationNode.getNode方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationNode.getNode方法的具体用法?Java ConfigurationNode.getNode怎么用?Java ConfigurationNode.getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ninja.leaping.configurate.ConfigurationNode
的用法示例。
在下文中一共展示了ConfigurationNode.getNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PermissionDrop
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public PermissionDrop(ConfigurationNode node) {
super(node);
try {
ConfigurationNode permission_node = node.getNode("PERMISSION");
ConfigurationNode drop1_node = node.getNode("DROP1");
ConfigurationNode drop2_node = node.getNode("DROP2");
if (permission_node.isVirtual()) {
throw new RuntimeException("PERMISSION node does not exist!");
}
if (drop1_node.isVirtual()) {
throw new RuntimeException("DROP1 node does not exist!");
}
if (drop2_node.isVirtual()) {
throw new RuntimeException("DROP2 node does not exist!");
}
permission = permission_node.getString();
drop1 = (Drop) Utils.createSuperObject(drop1_node, SuperObjectType.DROP);
drop2 = (Drop) Utils.createSuperObject(drop2_node, SuperObjectType.DROP);
} catch (Exception e) {
throw new RuntimeException("Exception creating Permission Drop!", e);
}
}
示例2: save
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode keys_node = node.getNode("KEYS");
ConfigurationNode all_keys_needed_node = node.getNode("ALL_KEYS_NEEDED");
keys_node.setValue(keys.stream().
filter(key -> key.getType() != null).
map(FlatSuperObjectPanel::getNode).
collect(Collectors.toList()));
all_keys_needed_node.setValue(all_keys_needed_checkbox.isSelected());
} catch (Exception e) {
throw new RuntimeException("Exception saving Multi Key Configuration Dialog!", e);
}
}
示例3: Case
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public Case(ConfigurationNode node) {
super(node);
try {
ConfigurationNode price_node = node.getNode("PRICE");
if (!price_node.isVirtual()) {
price = Optional.of(new BigDecimal(price_node.getString("0")));
}
} catch (Exception e) {
throw new RuntimeException("Exception creating Case!", e);
}
}
示例4: save
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode change_delay_node = node.getNode("CHANGE_DELAY");
ConfigurationNode ignored_indices_node = node.getNode("IGNORED_INDICES");
change_delay_node.setValue(change_delay_field.hasText() ? change_delay_field.getText() : null);
ignored_indices_node.setValue(ignored_indices_field.hasText() ? Utils.stringToIntList(ignored_indices_field.getText()) : null);
} catch (Exception e) {
throw new RuntimeException("Exception saving Change Mode Configuration Dialog!", e);
}
}
示例5: load
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
try {
ConfigurationNode node = getNode();
ConfigurationNode right_node = node.getNode("RIGHT");
if (!right_node.isVirtual()) {
right_check_box.setSelected(right_node.getBoolean());
}
} catch (Exception e) {
throw new RuntimeException("Exception loading Ordered Change Mode Configuration Dialog!", e);
}
}
示例6: load
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
try {
ConfigurationNode node = getNode();
ConfigurationNode item_node = node.getNode("ITEM");
item_configuration_panel.load(item_node);
} catch (Exception e) {
throw new RuntimeException("Exception loading Item Drop Configuration Dialog!", e);
}
}
示例7: save
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
ConfigurationNode hidden_item_node = node.getNode("HIDDEN_ITEM");
ConfigurationNode increase_hidden_item_quantity_node = node.getNode("INCREASE_HIDDEN_ITEM_QUANTITY");
ConfigurationNode rows_node = node.getNode("ROWS");
ConfigurationNode show_other_drops_node = node.getNode("SHOW_OTHER_DROPS");
ConfigurationNode show_other_drops_delay_node = node.getNode("SHOW_OTHER_DROPS_DELAY");
ConfigurationNode close_delay_node = node.getNode("CLOSE_DELAY");
ConfigurationNode forbid_close_node = node.getNode("FORBID_CLOSE");
ConfigurationNode give_random_on_close_node = node.getNode("GIVE_RANDOM_ON_CLOSE");
ConfigurationNode click_sound_node = node.getNode("CLICK_SOUND");
display_name_node.setValue(display_name_field.hasText() ? display_name_field.getText() : null);
hidden_item_node.setValue(hidden_item_panel.save());
increase_hidden_item_quantity_node.setValue(increase_hidden_item_quantity_check_box.isSelected());
rows_node.setValue(rows_spinner.getValue().toString());
show_other_drops_node.setValue(show_other_drops_check_box.isSelected());
show_other_drops_delay_node.setValue(show_other_drops_delay_field.hasText() ? show_other_drops_delay_field.getText() : null);
close_delay_node.setValue(close_delay_field.hasText() ? close_delay_field.getText() : null);
forbid_close_node.setValue(forbid_close_check_box.isSelected());
give_random_on_close_node.setValue(give_random_on_close_check_box.isSelected());
click_sound_node.setValue(click_sound_combo_box.getSelectedText().equals("NO SOUND") ? null : click_sound_combo_box.getSelectedText());
} catch (Exception e) {
throw new RuntimeException("Exception saving Second Open Manager Configuration Dialog!", e);
}
}
示例8: save
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode display_name_node = node.getNode("DISPLAY_NAME");
ConfigurationNode decorative_items_node = node.getNode("DECORATIVE_ITEMS");
ConfigurationNode scroll_delays_node = node.getNode("SCROLL_DELAYS");
ConfigurationNode clear_decorative_items_node = node.getNode("CLEAR_DECORATIVE_ITEMS");
ConfigurationNode clear_other_drops_node = node.getNode("CLEAR_OTHER_DROPS");
ConfigurationNode close_delay_node = node.getNode("CLOSE_DELAY");
ConfigurationNode forbid_close_node = node.getNode("FORBID_CLOSE");
ConfigurationNode scroll_sound_node = node.getNode("SCROLL_SOUND");
ConfigurationNode win_sound_node = node.getNode("WIN_SOUND");
ConfigurationNode decorative_items_change_mode_node = node.getNode("DECORATIVE_ITEMS_CHANGE_MODE");
display_name_node.setValue(display_name_field.hasText() ? display_name_field.getFocusTraversalKeysEnabled() : null);
scroll_delays_node.setValue(scroll_delays_field.hasText() ? Utils.stringToIntList(scroll_delays_field.getText()) : null);
clear_decorative_items_node.setValue(clear_decorative_items_check_box.isSelected());
clear_other_drops_node.setValue(clear_other_drops_check_box.isSelected());
close_delay_node.setValue(close_delay_field.hasText() ? close_delay_field.getText() : null);
forbid_close_node.setValue(forbid_close_check_box.isSelected());
scroll_sound_node.setValue(scroll_sound_combo_box.getSelectedText().equals("NO SOUND") ? null : scroll_sound_combo_box.getSelectedText());
win_sound_node.setValue(win_sound_combo_box.getSelectedText().equals("NO SOUND") ? null : win_sound_combo_box.getSelectedText());
decorative_items_change_mode_node.setValue(decorative_items_change_mode_panel.getNode());
} catch (Exception e) {
throw new RuntimeException("Exception saving First Open Manager Configuration Dialog!", e);
}
}
示例9: load
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
try {
ConfigurationNode node = getNode();
ConfigurationNode virtual_name_node = node.getNode("VIRTUAL_NAME");
ConfigurationNode delay_node = node.getNode("DELAY");
if (!virtual_name_node.isVirtual()) {
virtual_name_field.setText(virtual_name_node.getString());
}
if (!delay_node.isVirtual()) {
delay_field.setText(String.valueOf(delay_node.getLong()));
}
} catch (Exception e) {
throw new RuntimeException("Exception loading Timed Case Configuration Dialog!", e);
}
}
示例10: 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);
}
}
示例11: load
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
private void load() {
try {
ConfigurationNode node = getNode();
ConfigurationNode child_key_node = node.getNode("CHILD_KEY");
ConfigurationNode amount_node = node.getNode("AMOUNT");
if (!child_key_node.isVirtual()) {
child_key_panel.setNode(child_key_node);
}
if (!amount_node.isVirtual()) {
amount_field.setText(String.valueOf(amount_node.getInt()));
}
} catch (Exception e) {
throw new RuntimeException("Exception loading Multiple Amount Configuration Dialog!", e);
}
}
示例12: save
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override
public void save() {
super.save();
try {
ConfigurationNode node = getNode();
ConfigurationNode entity_uuid_node = node.getNode("ENTITY_UUID");
ConfigurationNode start_preview_on_left_click_node = node.getNode("START_PREVIEW_ON_LEFT_CLICK");
entity_uuid_node.setValue(entity_uuid_field.hasText() ? entity_uuid_field.getText() : null);
start_preview_on_left_click_node.setValue(start_preview_on_left_click_check_box.isSelected() ? true : null);
} catch (Exception e) {
throw new RuntimeException("Exception saving Entity Case Configuration Dialog!", e);
}
}
示例13: 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);
}
}
示例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: CommandsDrop
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public CommandsDrop(ConfigurationNode node) {
super(node);
try {
ConfigurationNode commands_node = node.getNode("COMMANDS");
if (commands_node.isVirtual()) {
throw new RuntimeException("COMMANDS node does not exist!");
}
commands = new ArrayList<Command>();
for (ConfigurationNode command_node : commands_node.getChildrenList()) {
commands.add(Utils.parseCommand(command_node));
}
} catch (Exception e) {
throw new RuntimeException("Exception creating Commands Drop!", e);
}
}