public void setConfigProperty(String node, Object object) { final String prefix = "info."; node = prefix + node; if (object instanceof Map) { config.setProperty(node, (Map)object); } else if (object instanceof List) { config.setProperty(node, (List<String>)object); } else if (object instanceof Location) { config.setProperty(node, (Location)object); } else if (object instanceof ItemStack) { config.setProperty(node, (ItemStack)object); } else { config.setProperty(node, object); } config.save(); }
public void setHome(String name, Location loc) { //Invalid names will corrupt the yaml name = StringUtil.safeString(name); homes.put(name, loc); config.setProperty("homes." + name, loc); config.save(); }
private void setUser(final String username, final String address, final boolean spy) { final Map<String, Object> userdata = new HashMap<String, Object>(); userdata.put(ADDRESS, address); userdata.put(SPY, spy); users.setProperty(username, userdata); users.save(); reloadConfig(); }
public void setLogoutLocation(Location loc) { if (loc == null || loc.getWorld() == null) { return; } logoutLocation = loc; config.setProperty("logoutlocation", loc); config.save(); }
public void setPowertool(ItemStack stack, List<String> commandList) { if (commandList == null || commandList.isEmpty()) { powertools.remove("" + stack.getTypeId()); } else { powertools.put("" + stack.getTypeId(), commandList); } config.setProperty("powertools", powertools); config.save(); }
public void setUnlimited(ItemStack stack, boolean state) { if (unlimited.contains(stack.getTypeId())) { unlimited.remove(Integer.valueOf(stack.getTypeId())); } if (state) { unlimited.add(stack.getTypeId()); } config.setProperty("unlimited", unlimited); config.save(); }
public void setMails(List<String> mails) { if (mails == null) { config.removeProperty("mail"); mails = _getMails(); } else { config.setProperty("mail", mails); } this.mails = mails; config.save(); }
public void setJail(String jail) { if (jail == null || jail.isEmpty()) { this.jail = null; config.removeProperty("jail"); } else { this.jail = jail; config.setProperty("jail", jail); } config.save(); }
public void setGeoLocation(String geolocation) { if (geolocation == null || geolocation.isEmpty()) { this.geolocation = null; config.removeProperty("geolocation"); } else { this.geolocation = geolocation; config.setProperty("geolocation", geolocation); } config.save(); }
public void setIgnoredPlayers(List<String> players) { if (players == null || players.isEmpty()) { ignoredPlayers = Collections.synchronizedList(new ArrayList<String>()); config.removeProperty("ignore"); } else { ignoredPlayers = players; config.setProperty("ignore", players); } config.save(); }
public void setMoney(BigDecimal value) { money = value; BigDecimal maxMoney = ess.getSettings().getMaxMoney(); BigDecimal minMoney = ess.getSettings().getMinMoney(); if (money.compareTo(maxMoney) > 0) { money = maxMoney; } if (money.compareTo(minMoney) < 0) { money = minMoney; } config.setProperty("money", money); config.save(); }
public void setSocialSpyEnabled(boolean status) { isSocialSpyEnabled = status; config.setProperty("socialspy", status); config.save(); }
public void setNPC(boolean set) { isNPC = set; config.setProperty("npc", set); config.save(); }
public void setAfk(boolean set) { afk = set; config.setProperty("afk", set); config.save(); }
public void setLastTeleportTimestamp(long time) { lastTeleportTimestamp = time; config.setProperty("timestamps.lastteleport", time); config.save(); }
public void setGodModeEnabled(boolean set) { godmode = set; config.setProperty("godmode", set); config.save(); }
private void _setLastLoginAddress(String address) { lastLoginAddress = address; config.setProperty("ipAddress", address); }
public void setBanTimeout(long time) { config.setProperty("ban.timeout", time); config.save(); }
public void clearAllPowertools() { powertools.clear(); config.setProperty("powertools", powertools); config.save(); }
public void setJailTimeout(long time) { jailTimeout = time; config.setProperty("timestamps.jail", time); config.save(); }
public void setBanReason(String reason) { config.setProperty("ban.reason", StringUtil.sanitizeString(reason)); config.save(); }
public void setLastHealTimestamp(long time) { lastHealTimestamp = time; config.setProperty("timestamps.lastheal", time); config.save(); }
public void setMuteTimeout(long time) { muteTimeout = time; config.setProperty("timestamps.mute", time); config.save(); }
public void setMuted(boolean set) { muted = set; config.setProperty("muted", set); config.save(); }
public void setPowerToolsEnabled(boolean set) { arePowerToolsEnabled = set; config.setProperty("powertoolsenabled", set); config.save(); }
private void _setLastLogin(long time) { lastLogin = time; config.setProperty("timestamps.login", time); }
public void setKitTimestamp(final String name, final long time) { kitTimestamps.put(name.toLowerCase(Locale.ENGLISH), time); config.setProperty("timestamps.kits", kitTimestamps); config.save(); }
public void setLastLogout(long time) { lastLogout = time; config.setProperty("timestamps.logout", time); config.save(); }
public void setJailed(boolean set) { jailed = set; config.setProperty("jailed", set); config.save(); }
public void setTeleportEnabled(boolean set) { teleportEnabled = set; config.setProperty("teleportenabled", set); config.save(); }