Skip to content

Commit

Permalink
remove database usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Dec 29, 2024
1 parent 11680e2 commit 1a41607
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 105 deletions.
85 changes: 0 additions & 85 deletions src/main/java/minevalley/core/api/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,91 +314,6 @@ public static void sendDebug(@Nonnull DebugType type, @Nonnull String message) {
server.sendDebug(type, removeColorCodes(message));
}

/**
* Gets the specific database-entry from the specified table with the specified value in the column.
* If there are more than one entry, that math the given description, this gets the first one.
* If you want to get multiple entries, use database-collection, or database-table!
*
* @param tableName name of the table as string
* @param searchValue value according to which the entries are filtered in a specific column
* @return the first database-entry that matches the given description
*/
public static DatabaseEntry getDatabaseEntry(String tableName, Value searchValue) {
return server.getDatabaseEntry(tableName, searchValue);
}

/**
* Gets the specific database-entry from the specified table with the specified value in the column.
* If there are more than one entry, that math the given description, this gets the first one.
* If you want to get multiple entries, use database-collection, or database-table!
*
* @param tableName name of the table as string
* @param searchValues value according to which the entries are filtered in a specific column
* @return the first database-entry that matches the given description
*/
public static DatabaseEntry getDatabaseEntryAnd(String tableName, Value... searchValues) {
return server.getDatabaseEntryAnd(tableName, searchValues);
}

/**
* Gets the specific database-entry from the specified table with the specified value in the column.
* If there are more than one entry, that math the given description, this gets the first one.
* If you want to get multiple entries, use database-collection, or database-table!
*
* @param tableName name of the table as string
* @param searchValues value according to which the entries are filtered in a specific column
* @return the first database-entry that matches the given description
*/
public static DatabaseEntry getDatabaseEntryOr(String tableName, Value... searchValues) {
return server.getDatabaseEntryOr(tableName, searchValues);
}

/**
* Gets a database-collection from the specified table with the specified value in the column.
* This gets all the entries that match the description. If you're searching for one single entry, use database-entry!
*
* @param tableName name of the table as string
* @param searchValue value according to which the entries are filtered in a specific column
* @return a collection of all database-entries in this table, that matches the given description
*/
public static DatabaseEntryCollection getDatabaseEntryCollection(String tableName, Value searchValue) {
return server.getDatabaseEntryCollection(tableName, searchValue);
}

/**
* Gets a database-collection from the specified table with the specified value in the column.
* This gets all the entries that match the description. If you're searching for one single entry, use database-entry!
*
* @param tableName name of the table as string
* @param searchValues value according to which the entries are filtered in a specific column
* @return a collection of all database-entries in this table, that matches the given description
*/
public static DatabaseEntryCollection getDatabaseEntryCollectionAnd(String tableName, Value... searchValues) {
return server.getDatabaseEntryCollectionAnd(tableName, searchValues);
}

/**
* Gets a database-collection from the specified table with the specified value in the column.
* This gets all the entries that match the description. If you're searching for one single entry, use database-entry!
*
* @param tableName name of the table as string
* @param searchValues value according to which the entries are filtered in a specific column
* @return a collection of all database-entries in this table, that matches the given description
*/
public static DatabaseEntryCollection getDatabaseEntryCollectionOr(String tableName, Value... searchValues) {
return server.getDatabaseEntryCollectionOr(tableName, searchValues);
}

/**
* Gets the database-table with the specific name.
*
* @param tableName name of the database-table
* @return database-table with specific name
*/
public static DatabaseTable getDatabaseTable(String tableName) {
return server.getDatabaseTable(tableName);
}

/**
* Sets the setting with the given key.
* <p>
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/minevalley/core/api/CoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,6 @@ public interface CoreServer {

void sendDebug(@Nonnull DebugType type, @Nonnull String message);

DatabaseEntry getDatabaseEntry(String tableName, Value searchValue);

DatabaseEntry getDatabaseEntryAnd(String tableName, Value... searchValues);

DatabaseEntry getDatabaseEntryOr(String tableName, Value... searchValues);

DatabaseEntryCollection getDatabaseEntryCollection(String tableName, Value searchValue);

DatabaseEntryCollection getDatabaseEntryCollectionAnd(String tableName, Value... searchValues);

DatabaseEntryCollection getDatabaseEntryCollectionOr(String tableName, Value... searchValues);

DatabaseTable getDatabaseTable(String tableName);

void setSetting(@Nonnull String key, @Nonnull String value) throws IllegalArgumentException;

String getSetting(String key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@
@RequiredArgsConstructor
public class StatisticCreateEvent extends Event {

public static final HandlerList HANDLER_LIST = new HandlerList();
// TODO 29.12.2024: recently removed DatabaseEntry object due to rework of database util might not work anymore (StatisticCreateEvent)

private final DatabaseEntry entry;
public static final HandlerList HANDLER_LIST = new HandlerList();

public static HandlerList getHandlerList() {
return HANDLER_LIST;
}

public void setStatistic(String key, double value) {
entry.changeValue(new Value(key, value));
}

@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
Expand Down

0 comments on commit 1a41607

Please sign in to comment.