public static ArenaCommandSign deserialize(Map<String, Object> map) { Location location = SerializerUtil.getLocation((String) map.get("location")); if (location == null) return null; Sign s = SignUtil.getSign(location); if (s == null) return null; ArenaCommandSign acs = SignUtil.getArenaCommandSign(s, s.getLines()); return acs; }
/** * Used by BombPlugin->updateBasesYml() to transfer data from bases.yml to arenas.yml. * * @param arenaName * @return Map of key-value pairs, where the key is an incremental ordinal number starting at 1. * @deprecated Labeled as deprecated to prevent accidental usage. */ @Deprecated public Map<Integer, Location> getOldBases(String arenaName) { // bases.yml // PATH = "{arenaName}.{index}" String path = arenaName; Map<Integer, Location> temp = new HashMap<Integer, Location>(); if (plugin.basesYml.getConfigurationSection(path) != null && plugin.basesYml.getConfigurationSection(path).getKeys(false) != null && plugin.basesYml.getConfigurationSection(path).getKeys(false).size() >= 2) { ConfigurationSection cs = plugin.basesYml.getConfigurationSection(path); for (String key : cs.getKeys(false)) { String sloc = cs.getString(key); Location loc = SerializerUtil.getLocation(sloc); Location base_loc = plugin.getExactLocation(loc); temp.put(Integer.valueOf(key), base_loc); } plugin.debug.log("getBases(String arenaName) size of returning List = " + temp.size()); return temp; } plugin .getLogger() .severe("BombArena:getBases(String ArenaName) has failed to return a List of Locations."); return temp; }
@Override public Map<String, Object> serialize() { HashMap<String, Object> map = new HashMap<String, Object>(); map.put("location", SerializerUtil.getBlockLocString(location)); return map; }