prismarine-schematic 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ assignees: ''
14
14
 
15
15
  ## Versions
16
16
  - node: #.#.#
17
- - prismarine-template: #.#.#
17
+ - prismarine-schematic: #.#.#
18
18
 
19
19
  ## Detailed description of a problem
20
20
  A clear and concise description of what the problem is.
@@ -13,7 +13,7 @@ jobs:
13
13
 
14
14
  strategy:
15
15
  matrix:
16
- node-version: [14.x]
16
+ node-version: [24.x]
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v2
@@ -0,0 +1,22 @@
1
+ name: Repo Commands
2
+
3
+ on:
4
+ issue_comment: # Handle comment commands
5
+ types: [created]
6
+ pull_request: # Handle renamed PRs
7
+ types: [edited]
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ comment-trigger:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Check out repository
16
+ uses: actions/checkout@v3
17
+ - name: Run command handlers
18
+ uses: PrismarineJS/prismarine-repo-actions@master
19
+ with:
20
+ token: ${{ secrets.PAT_PASSWORD }}
21
+ install-command: npm install
22
+ /fixlint.fix-command: npm run fix
@@ -3,6 +3,9 @@ on:
3
3
  push:
4
4
  branches:
5
5
  - master # Change this to your default branch
6
+ permissions:
7
+ id-token: write
8
+ contents: write
6
9
  jobs:
7
10
  npm-publish:
8
11
  name: npm-publish
@@ -13,13 +16,19 @@ jobs:
13
16
  - name: Set up Node.js
14
17
  uses: actions/setup-node@master
15
18
  with:
16
- node-version: 14.0.0
17
- - name: Publish if version has been updated
18
- uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
19
- with: # All of theses inputs are optional
20
- tag_name: "%s"
21
- tag_message: "%s"
22
- commit_pattern: "^Release (\\S+)"
23
- env: # More info about the environment variables in the README
24
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
25
- NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings
19
+ node-version: 24
20
+ registry-url: 'https://registry.npmjs.org'
21
+ - id: publish
22
+ uses: JS-DevTools/npm-publish@v4
23
+ - name: Create Release
24
+ if: ${{ steps.publish.outputs.type }}
25
+ id: create_release
26
+ uses: actions/create-release@v1
27
+ env:
28
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
+ with:
30
+ tag_name: ${{ steps.publish.outputs.version }}
31
+ release_name: Release ${{ steps.publish.outputs.version }}
32
+ body: ${{ steps.publish.outputs.version }}
33
+ draft: false
34
+ prerelease: false
package/HISTORY.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## History
2
2
 
3
+ ### 1.3.0
4
+ * [Add repo commands workflow (#79)](https://github.com/PrismarineJS/prismarine-schematic/commit/52daaa652d2847e1d594847321038f4db286560b) (thanks @rom1504)
5
+ * [Update CI to Node 24 (#78)](https://github.com/PrismarineJS/prismarine-schematic/commit/ac22acbb0df7d7569126818014ae08daec8b72de) (thanks @rom1504)
6
+ * [Fix publish workflow for trusted publishing (#76)](https://github.com/PrismarineJS/prismarine-schematic/commit/9e76020a4447e2a6679a8ea4d28618a520cc51ae) (thanks @rom1504)
7
+ * [Switch to trusted publishing via OIDC (#75)](https://github.com/PrismarineJS/prismarine-schematic/commit/ad846374ffdbaa03f655c6646cafea971d8ef4d5) (thanks @rom1504)
8
+ * [Update bug_report.md (#59)](https://github.com/PrismarineJS/prismarine-schematic/commit/dda10052ee063c048e64e1ee460109a4554ed324) (thanks @IceTank)
9
+ * [Bump jest from 28.1.3 to 29.1.1 (#57)](https://github.com/PrismarineJS/prismarine-schematic/commit/5dd8a672762d2ff7f44c3514026947f23622e38d) (thanks @dependabot[bot])
10
+ * [added types for typescript (#51)](https://github.com/PrismarineJS/prismarine-schematic/commit/3833d9fa317fa4f61947360d30f414f1663b5de2) (thanks @sertonix)
11
+ * [Bump standard from 16.0.4 to 17.0.0 (#44)](https://github.com/PrismarineJS/prismarine-schematic/commit/1aa3f506694171dee70bd7a188380089486a1666) (thanks @dependabot[bot])
12
+ * [Bump jest from 27.5.1 to 28.1.0 (#49)](https://github.com/PrismarineJS/prismarine-schematic/commit/3803445d202543b3edfc8ae03bddacade4e0db77) (thanks @dependabot[bot])
13
+
3
14
  ## 1.2.3
4
15
  * Update mcdata
5
16
 
package/index.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import type { Vec3 } from "vec3";
2
+ import type { Block } from "prismarine-block";
3
+
4
+ export class Schematic {
5
+ public readonly version: string;
6
+ public readonly size: Vec3;
7
+ public readonly offset: Vec3;
8
+ public palette: number[];
9
+ public blocks: number[];
10
+ public readonly Block: typeof Block;
11
+
12
+ constructor ( version: string, size: Vec3, offset: Vec3, palette: number[], blocks: number[] );
13
+
14
+ start(): Vec3;
15
+ end(): Vec3;
16
+
17
+ getBlockStateId( pos: Vec3 ): number;
18
+
19
+ getBlock( pos: Vec3 ): Block;
20
+ setBlock( pos: Vec3, block?: Block ): void;
21
+
22
+ paste( world: any, at: Vec3 ): Promise<void>;
23
+ write(): Promise<Buffer>;
24
+ forEach( cb: ( block: number, pos: Vec3 ) => PromiseLike<void> | void ): Promise<void>;
25
+ map<Ret>( cb: ( block: number, pos: Vec3 ) => PromiseLike<Ret> | Ret ): Promise<Ret[]>;
26
+ makeWithCommands( offset: Vec3, platform?: "pc" | "pe" ): Promise<string[]>;
27
+
28
+ toJSON( space?: string ): string;
29
+
30
+ static copy( world: any, start: Vec3, end: Vec3, offset: Vec3, version: string ): Promise<Schematic>;
31
+ static read( buffer: Buffer, version?: string ): Promise<Schematic>;
32
+ static fromJSON( string: string ): Schematic;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismarine-schematic",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "Read, write and manipulate minecraft schematics",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,10 +24,10 @@
24
24
  },
25
25
  "homepage": "https://github.com/PrismarineJS/prismarine-schematic#readme",
26
26
  "devDependencies": {
27
- "jest": "^27.0.4",
27
+ "jest": "^29.1.1",
28
28
  "prismarine-schematic": "file:.",
29
29
  "prismarine-chunk": "^1.22.0",
30
- "standard": "^16.0.1",
30
+ "standard": "^17.0.0",
31
31
  "process": "^0.11.10"
32
32
  },
33
33
  "standard": {