prismarine-entity 2.1.1 → 2.2.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.
@@ -13,13 +13,20 @@ jobs:
13
13
  - name: Set up Node.js
14
14
  uses: actions/setup-node@master
15
15
  with:
16
- node-version: 10.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
16
+ node-version: 14.0.0
17
+ - id: publish
18
+ uses: JS-DevTools/npm-publish@v1
19
+ with:
20
+ token: ${{ secrets.NPM_AUTH_TOKEN }}
21
+ - name: Create Release
22
+ if: steps.publish.outputs.type != 'none'
23
+ id: create_release
24
+ uses: actions/create-release@v1
25
+ env:
26
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
+ with:
28
+ tag_name: ${{ steps.publish.outputs.version }}
29
+ release_name: Release ${{ steps.publish.outputs.version }}
30
+ body: ${{ steps.publish.outputs.version }}
31
+ draft: false
32
+ prerelease: false
package/README.md CHANGED
@@ -128,6 +128,10 @@ returns a `prismarine-item` Item object for the dropped item, if this is a dropp
128
128
 
129
129
  ## History
130
130
 
131
+ ### 2.2.0
132
+
133
+ * mcData to registry refactoring (step towards #2450)
134
+
131
135
  ### 2.1.1
132
136
 
133
137
  * Update mcdata
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  const Vec3 = require('vec3').Vec3
2
2
  const EventEmitter = require('events').EventEmitter
3
3
 
4
- module.exports = (version) => {
5
- const ChatMessage = require('prismarine-chat')(version)
6
- const Item = require('prismarine-item')(version)
7
- const mcData = require('minecraft-data')(version)
4
+ module.exports = (registryOrVersion) => {
5
+ const registry = typeof registryOrVersion === 'string' ? require('prismarine-registry')(registryOrVersion) : registryOrVersion
6
+ const ChatMessage = require('prismarine-chat')(registry)
7
+ const Item = require('prismarine-item')(registry)
8
8
  class Entity extends EventEmitter {
9
9
  constructor (id) {
10
10
  super()
@@ -41,7 +41,7 @@ module.exports = (version) => {
41
41
  if (this.name !== 'item' && this.name !== 'Item' && this.name !== 'item_stack') {
42
42
  return null // not a dropped item
43
43
  }
44
- return Item.fromNotch(this.metadata[mcData.supportFeature('metadataIxOfItem')])
44
+ return Item.fromNotch(this.metadata[registry.supportFeature('metadataIxOfItem')])
45
45
  }
46
46
  }
47
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismarine-entity",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Represent a minecraft entity",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,6 +16,7 @@
16
16
  "minecraft-data": "^3.0.0",
17
17
  "prismarine-chat": "^1.4.1",
18
18
  "prismarine-item": "^1.11.2",
19
+ "prismarine-registry": "^1.4.0",
19
20
  "vec3": "^0.1.4"
20
21
  },
21
22
  "keywords": [
@@ -29,8 +30,8 @@
29
30
  "url": "https://github.com/PrismarineJS/prismarine-entity/issues"
30
31
  },
31
32
  "devDependencies": {
32
- "@types/node": "^17.0.4",
33
+ "@types/node": "^18.6.4",
33
34
  "prismarine-entity": "file:.",
34
- "standard": "^16.0.1"
35
+ "standard": "^17.0.0"
35
36
  }
36
37
  }