Skip to content

Commit

Permalink
Upgraded database system and bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Oct 13, 2024
1 parent 140e5f8 commit 6e0173e
Show file tree
Hide file tree
Showing 13 changed files with 272 additions and 209 deletions.
6 changes: 3 additions & 3 deletions mc_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"version": [
0,
9,
2
3
],
"min_engine_version": [
1,
21,
30
40
]
},
"bp_modules": [
Expand Down Expand Up @@ -58,7 +58,7 @@
"bp_dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.15.0-beta"
"version": "1.16.0-beta"
},
{
"module_name": "@minecraft/server-ui",
Expand Down
32 changes: 17 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"typescript": "^4.7.4"
},
"dependencies": {
"@minecraft/server": "1.15.0-beta.1.21.30-preview.24",
"@minecraft/server": "1.16.0-beta.1.21.40-preview.25",
"@minecraft/server-admin": "1.0.0-beta.1.19.80-stable",
"@minecraft/server-ui": "1.4.0-beta.1.21.30-preview.24"
"@minecraft/server-ui": "1.4.0-beta.1.21.40-preview.25"
},
"overrides": {
"@minecraft/server-ui": {
"@minecraft/server": "1.15.0-beta.1.21.30-preview.24"
"@minecraft/server": "1.16.0-beta.1.21.40-preview.25"
}
}
}
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ export default {
};

// WorldEdit version (do not change)
export const VERSION = "0.9.2";
export const VERSION = "0.9.3";
66 changes: 10 additions & 56 deletions src/library/@types/classes/databaseBuilder.d.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,20 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface Database<T = { [key: string]: any }> {
/**
* Save a value or update a value in the Database under a key
* @param key The key you want to save the value as
* @param value The value you want to save
* @example Database.set('Test Key', 'Test Value');
*/
set<S extends keyof T>(key: S, value: T[S]): void;
/** Database's data. */
data: T;

/**
* Get the value of the key
* @param key
* @returns value
* @example Database.get('Test Key');
*/
get<S extends keyof T>(key: S): T[S];
/** Returns whether the database is a valid object that can have functions called and data read from. */
isValid(): boolean;

/**
* Check if the key exists in the table
* @param key
* @returns Whether the key exists
* @example Database.has('Test Key');
*/
has(key: keyof T): boolean;
/** Returns whether the database has loaded its data from its provider. */
isLoaded(): boolean;

/**
* Delete the key from the table
* @param key
* @example Database.delete('Test Key');
*/
delete(key: keyof T): void;

/**
* Clear everything in the table
* @example Database.clear()
*/
/** Clears everything in the database. */
clear(): void;

/**
* Save all changes made in the database.
* @example Database.save()
*/
/** Saves all changes made in the database. */
save(): void;

/**
* Get all the keys in the database
* @returns Array of keys
* @example Database.keys();
*/
keys(): (keyof T)[];

/**
* Get all the values in the database
* @returns Array of values
* @example Database.values();
*/
values(): T[keyof T][];

/**
* Get all the keys and values in the database in pairs
* @returns Array of key/value pairs
* @example Database.entries();
*/
entries<S extends keyof T>(): [S, T[S]][];
/** Deletes the database from the provider it was loaded from. */
delete(): void;
}
2 changes: 1 addition & 1 deletion src/library/Minecraft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { Block } from "./classes/blockBuilder.js";
export { CustomArgType, CommandPosition } from "./classes/commandBuilder.js";
export { commandSyntaxError, registerInformation as CommandInfo } from "./@types/classes/CommandBuilder";
export { StructureSaveOptions, StructureLoadOptions } from "./classes/structureBuilder.js";
export { getDatabase, deleteDatabase } from "./classes/databaseBuilder.js";
export { Databases } from "./classes/databaseBuilder.js";
export { configuration } from "./configurations.js";

class ServerBuild extends ServerBuilder {
Expand Down
Loading

0 comments on commit 6e0173e

Please sign in to comment.