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.
- package/.github/workflows/publish.yml +17 -10
- package/README.md +4 -0
- package/index.js +5 -5
- package/package.json +4 -3
|
@@ -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:
|
|
17
|
-
-
|
|
18
|
-
uses:
|
|
19
|
-
with:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
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 = (
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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[
|
|
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.
|
|
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": "^
|
|
33
|
+
"@types/node": "^18.6.4",
|
|
33
34
|
"prismarine-entity": "file:.",
|
|
34
|
-
"standard": "^
|
|
35
|
+
"standard": "^17.0.0"
|
|
35
36
|
}
|
|
36
37
|
}
|