Skip to content

Commit

Permalink
Fix syntax mistake on Data command
Browse files Browse the repository at this point in the history
  • Loading branch information
MulverineX committed Jan 24, 2023
1 parent 1b4741a commit 0400e08
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sandstone",
"description": "Sandstone, a Typescript library for Minecraft datapacks.",
"version": "0.14.0-alpha.11",
"version": "0.14.0-alpha.12",
"contributors": [
{
"name": "TheMrZZ - Florian ERNST",
Expand Down
20 changes: 10 additions & 10 deletions src/commands/implementations/DataCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ export class DataModifyValues extends Command {
@command(['from', 'storage'])
private fromStorage = (...args: unknown[]) => { }

@command(['from', 'string', 'block'], { parsers: { '0': coordinatesParser } })
private fromStringBlock = (...args: unknown[]) => { }
@command(['string', 'block'], { parsers: { '0': coordinatesParser } })
private stringBlock = (...args: unknown[]) => { }

@command(['from', 'string', 'entity'])
private fromStringEntity = (...args: unknown[]) => { }
@command(['string', 'entity'])
private stringEntity = (...args: unknown[]) => { }

@command(['from', 'string', 'storage'])
private fromStringStorage = (...args: unknown[]) => { }
@command(['string', 'storage'])
private stringStorage = (...args: unknown[]) => { }

from: {
/**
Expand Down Expand Up @@ -123,7 +123,7 @@ export class DataModifyValues extends Command {
storage: this.fromStorage,
}

fromString: {
string: {
/**
* Modify with the NBT String of a block at the given position.
*
Expand Down Expand Up @@ -154,9 +154,9 @@ export class DataModifyValues extends Command {
*/
storage: (source: string, sourcePath: string, start?: number, end?: number) => void
} = {
block: this.fromStringBlock,
entity: this.fromStringEntity,
storage: this.fromStringStorage,
block: this.stringBlock,
entity: this.stringEntity,
storage: this.stringStorage,
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/variables/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ export class DataPointInstance<TYPE extends DATA_TYPES = any, SOURCE extends DAT
// The value is another Data Point
if (value instanceof DataPointInstance) {
if (sliceString) {
data.fromString[value.type as DATA_TYPES](value.currentTarget as any, value.path, ...sliceString)
data.string[value.type as DATA_TYPES](value.currentTarget as any, value.path, ...sliceString)
return
}

data.fromString[value.type as DATA_TYPES](value.currentTarget as any, value.path)
data.string[value.type as DATA_TYPES](value.currentTarget as any, value.path)
return
}

Expand Down

0 comments on commit 0400e08

Please sign in to comment.