File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
AdvancedCore/src/com/bencodez/advancedcore/api/user Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,22 @@ public HashMap<UUID, ArrayList<Column>> getAllKeys() {
294294 return getAllKeys (plugin .getStorageType ());
295295 }
296296
297+ @ SuppressWarnings ("deprecation" )
298+ public List <String > getAllColumns () {
299+ UserStorage storage = plugin .getStorageType ();
300+ if (storage .equals (UserStorage .SQLITE )) {
301+ return plugin .getSQLiteUserTable ().getColumnsString ();
302+ } else if (storage .equals (UserStorage .MYSQL )) {
303+ return plugin .getMysql ().getColumns ();
304+ } else {
305+ AdvancedCoreUser user = getRandomUser ();
306+ user .dontCache ();
307+ return new ArrayList <String >(
308+ user .getData ().getData (user .getUUID ()).getConfigurationSection ("" ).getKeys (false ));
309+
310+ }
311+ }
312+
297313 public HashMap <UUID , ArrayList <Column >> getAllKeys (UserStorage storage ) {
298314 if (storage .equals (UserStorage .SQLITE )) {
299315 return plugin .getSQLiteUserTable ().getAllQuery ();
Original file line number Diff line number Diff line change @@ -209,6 +209,15 @@ public List<Column> getColumns() {
209209 return columns ;
210210 }
211211
212+ public List <String > getColumnsString () {
213+ List <Column > column = getColumns ();
214+ ArrayList <String > list = new ArrayList <String >();
215+ for (Column col : column ) {
216+ list .add (col .getName ());
217+ }
218+ return list ;
219+ }
220+
212221 public ArrayList <Column > getExact (Column column ) {
213222 ArrayList <Column > result = new ArrayList <>();
214223
You can’t perform that action at this time.
0 commit comments