@Override // TODO: optimize public boolean canUseCommand(String command) { if (dataholder.canUseCommand(command, getWorld().getName())) return true; if (dataholder.canUseCommand(Config.FULL_ACCESS_STRING, getWorld().getName())) return true; String[] split = command.split("."); if (split.length > 1) { for (int i = 0; i < split.length; i++) { String t = split[0]; for (int x = 1; x <= i; x++) t += "." + split[x]; t += "." + Config.FULL_ACCESS_STRING; if (dataholder.canUseCommand(t, getWorld().getName())) return true; } } return false; }
private void loadBuckItData() { dataholder = server.getDataSourceManager().getUserDataSource().getUserData(getName().toLowerCase()); dataholder.setOnline(true); String format = Config.DEFAULT_USER_FORMAT; if (dataholder.getUsernameformat() != null && !dataholder.getUsernameformat().equals("")) format = dataholder.getUsernameformat(); else if (getAccessLevel().getUsernameformat() != null && !getAccessLevel().getUsernameformat().equals("")) format = getAccessLevel().getUsernameformat(); setDisplayName( format .replace("{$username}", getName()) .replace("{$group}", getAccessLevel().getName()) .replace("^", "\u00A7")); }
@Override public int getPlayerId() { return dataholder.getId(); }
@Override public AccessLevel getAccessLevel() { return dataholder.getAccessLevel(); }
@Override public boolean isAdmin() { return getAccessLevel().isAdmin() || dataholder.isAdmin(); }
@Override public boolean canBuild() { return getAccessLevel().canBuild() || dataholder.canbuild(); }