本文整理汇总了Java中ninja.leaping.configurate.ConfigurationNode.getList方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationNode.getList方法的具体用法?Java ConfigurationNode.getList怎么用?Java ConfigurationNode.getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ninja.leaping.configurate.ConfigurationNode
的用法示例。
在下文中一共展示了ConfigurationNode.getList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequiredItemsToCreate
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static HashMap<String, Integer> getRequiredItemsToCreate()
{
ConfigurationNode itemsNode = ConfigAccess.getConfig(mainConfig).getNode("eaglefactions", "gameplay", "factioncreation", "items");
List<String> itemsList = itemsNode.getList(objectToStringTransformer);
HashMap<String, Integer> items = new HashMap<>();
for (String itemWithAmount : itemsList)
{
String strings[] = itemWithAmount.split("\\|");
String item = strings[0];
int amount = Integer.valueOf(strings[1]);
items.put(item, amount);
}
return items;
}
示例2: DecorativeItemsChangeMode
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public DecorativeItemsChangeMode(ConfigurationNode node) {
super(node);
try {
ConfigurationNode change_delay_node = node.getNode("CHANGE_DELAY");
ConfigurationNode ignored_indices_node = node.getNode("IGNORED_INDICES");
change_delay = change_delay_node.getInt(10);
ignored_indices = ignored_indices_node.getList(TypeToken.of(Integer.class), new ArrayList<Integer>());
} catch (Exception e) {
throw new RuntimeException("Exception creating First Gui Decorative Items Change Mode!", e);
}
}
示例3: getOfficers
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static List<String> getOfficers(String factionName)
{
ConfigurationNode officersNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName,"officers");
if (officersNode.getValue() != null)
{
List<String> officersList = officersNode.getList(objectToStringTransformer);
List<String> helpList = new ArrayList<>(officersList);
return helpList;
}
else return new ArrayList<String>();
}
示例4: getMembers
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static List<String> getMembers(String factionName)
{
ConfigurationNode membersNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName,"members");
if (membersNode.getValue() != null)
{
List<String> membersList = membersNode.getList(objectToStringTransformer);
List<String> helpList = new ArrayList<>(membersList);
return helpList;
}
else return new ArrayList<String>();
}
示例5: getAlliances
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static List<String> getAlliances(String factionName)
{
ConfigurationNode allianceNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName, "alliances");
if (allianceNode.getValue() != null)
{
List<String> alliancesList = allianceNode.getList(objectToStringTransformer);
List<String> helpList = new ArrayList<>(alliancesList);
return helpList;
}
else return new ArrayList<String>();
}
示例6: getEnemies
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static List<String> getEnemies(String factionName)
{
ConfigurationNode enemiesNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName, "enemies");
if (enemiesNode.getValue() != null)
{
List<String> enemiesList = enemiesNode.getList(objectToStringTransformer);
List<String> helpList = new ArrayList<>(enemiesList);
return helpList;
}
else return new ArrayList<String>();
}
示例7: getClaims
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public static List<String> getClaims(String factionName)
{
ConfigurationNode claimsNode = ConfigAccess.getConfig(factionsConfig).getNode("factions", factionName, "claims");
List<String> calimsList = claimsNode.getList(objectToStringTransformer);
return calimsList;
}
示例8: testThatByteArraysCanBeSerialised
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Test
public void testThatByteArraysCanBeSerialised() throws ObjectMappingException {
byte[] array = { 4, -2 };
TestConfigurationLoader tcl = getArrayTestLoader();
ConfigurationNode cn = tcl.createEmptyNode().setValue(new TypeToken<byte[]>() {}, array);
List<Byte> ls = cn.getList(TypeToken.of(Byte.class));
Assert.assertTrue(ls.contains((byte)4));
Assert.assertTrue(ls.contains((byte)-2));
}
示例9: testThatShortArraysCanBeSerialised
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Test
public void testThatShortArraysCanBeSerialised() throws ObjectMappingException {
short[] array = { 4, -2 };
TestConfigurationLoader tcl = getArrayTestLoader();
ConfigurationNode cn = tcl.createEmptyNode().setValue(new TypeToken<short[]>() {}, array);
List<Short> ls = cn.getList(TypeToken.of(Short.class));
Assert.assertTrue(ls.contains((short)4));
Assert.assertTrue(ls.contains((short)-2));
}
示例10: testThatIntArraysCanBeSerialised
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Test
public void testThatIntArraysCanBeSerialised() throws ObjectMappingException {
int[] array = { 4, -2 };
TestConfigurationLoader tcl = getArrayTestLoader();
ConfigurationNode cn = tcl.createEmptyNode().setValue(new TypeToken<int[]>() {}, array);
List<Integer> ls = cn.getList(TypeToken.of(Integer.class));
Assert.assertTrue(ls.contains(4));
Assert.assertTrue(ls.contains(-2));
}
示例11: testThatSetsCanBeSerialised
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Test
public void testThatSetsCanBeSerialised() throws ObjectMappingException {
TestConfigurationLoader tcl = getSetTestLoader();
ConfigurationNode cn = tcl.createEmptyNode().setValue(new TypeToken<Set<String>>() {}, Sets.newHashSet("test", "test2"));
List<String> ls = cn.getList(TypeToken.of(String.class));
Assert.assertTrue(ls.contains("test"));
Assert.assertTrue(ls.contains("test2"));
}
示例12: FirstOpenManager
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
public FirstOpenManager(ConfigurationNode node) {
super(node);
try {
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");
if (!display_name_node.isVirtual()) {
display_name = Optional.of(TextSerializers.FORMATTING_CODE.deserialize(display_name_node.getString()));
}
if (decorative_items_node.isVirtual()) {
throw new RuntimeException("DECORATIVE_ITEMS node does not exist!");
}
decorative_items = new ArrayList<ItemStack>();
for (ConfigurationNode decorative_item_node : decorative_items_node.getChildrenList()) {
decorative_items.add(Utils.parseItem(decorative_item_node));
}
if (decorative_items.size() != 20) {
throw new RuntimeException("DECORATIVE_ITEMS size must be 20 instead of " + decorative_items.size() + "!");
}
if (scroll_delays_node.isVirtual()) {
throw new RuntimeException("SCROLL_DELAYS node does not exist!");
}
scroll_delays = scroll_delays_node.getList(TypeToken.of(Integer.class));
clear_decorative_items = clear_decorative_items_node.getBoolean(false);
clear_other_drops = clear_other_drops_node.getBoolean(true);
if (close_delay_node.isVirtual()) {
throw new RuntimeException("CLOSE_DELAY node does not exist!");
}
close_delay = close_delay_node.getInt();
forbid_close = forbid_close_node.getBoolean(true);
if (!scroll_sound_node.isVirtual()) {
scroll_sound = Optional.of(scroll_sound_node.getValue(TypeToken.of(SoundType.class)));
}
if (!win_sound_node.isVirtual()) {
win_sound = Optional.of(win_sound_node.getValue(TypeToken.of(SoundType.class)));
}
if (!decorative_items_change_mode_node.isVirtual()) {
decorative_items_change_mode = Optional.of((DecorativeItemsChangeMode) Utils.createSuperObject(decorative_items_change_mode_node, SuperObjectType.DECORATIVE_ITEMS_CHANGE_MODE));
}
} catch (Exception e) {
throw new RuntimeException("Exception creating First Gui Open Manager!", e);
}
}
示例13: deserialize
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override public short[] deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException {
List<Short> list = value.getList(ttb);
return Shorts.toArray(list);
}
示例14: deserialize
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override public byte[] deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException {
List<Byte> list = value.getList(ttb);
return Bytes.toArray(list);
}
示例15: deserialize
import ninja.leaping.configurate.ConfigurationNode; //导入方法依赖的package包/类
@Override
public Set<?> deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException {
return new HashSet<>(value.getList(getInnerToken(type)));
}