prismarine-entity 2.2.0 → 2.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.
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/commands.yml +22 -0
- package/.github/workflows/publish.yml +1 -1
- package/README.md +27 -1
- package/index.d.ts +2 -1
- package/index.js +26 -0
- package/package.json +2 -3
package/.github/workflows/ci.yml
CHANGED
|
@@ -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
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
comment-trigger:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Check out repository
|
|
14
|
+
uses: actions/checkout@v3
|
|
15
|
+
- name: Run command handlers
|
|
16
|
+
uses: PrismarineJS/prismarine-repo-actions@master
|
|
17
|
+
with:
|
|
18
|
+
# NOTE: You must specify a Personal Access Token (PAT) with repo access here. While you can use the default GITHUB_TOKEN, actions taken with it will not trigger other actions, so if you have a CI workflow, commits created by this action will not trigger it.
|
|
19
|
+
token: ${{ secrets.PAT_PASSWORD }}
|
|
20
|
+
# See `Options` section below for more info on these options
|
|
21
|
+
install-command: npm install
|
|
22
|
+
/fixlint.fix-command: npm run fix
|
package/README.md
CHANGED
|
@@ -81,12 +81,24 @@ get from collecting the orb.
|
|
|
81
81
|
|
|
82
82
|
#### entity.equipment[5]
|
|
83
83
|
|
|
84
|
+
Version dependent.
|
|
85
|
+
|
|
86
|
+
1.8 Layout:
|
|
87
|
+
|
|
84
88
|
* `0` - held item
|
|
85
89
|
* `1` - shoes
|
|
86
90
|
* `2` - legging
|
|
87
91
|
* `3` - torso
|
|
88
92
|
* `4` - head
|
|
89
|
-
|
|
93
|
+
|
|
94
|
+
1.9 and later:
|
|
95
|
+
|
|
96
|
+
* `0` - held item
|
|
97
|
+
* `1` - off-hand
|
|
98
|
+
* `2` - shoes
|
|
99
|
+
* `3` - legging
|
|
100
|
+
* `4` - torso
|
|
101
|
+
* `5` - head
|
|
90
102
|
|
|
91
103
|
#### entity.heldItem
|
|
92
104
|
|
|
@@ -114,6 +126,10 @@ The health of the player, default: 20
|
|
|
114
126
|
|
|
115
127
|
The food of the player, default: 20
|
|
116
128
|
|
|
129
|
+
#### entity.elytraFlying
|
|
130
|
+
|
|
131
|
+
Whether or not the entity is elytra flying.
|
|
132
|
+
|
|
117
133
|
#### entity.player
|
|
118
134
|
|
|
119
135
|
The player
|
|
@@ -128,6 +144,16 @@ returns a `prismarine-item` Item object for the dropped item, if this is a dropp
|
|
|
128
144
|
|
|
129
145
|
## History
|
|
130
146
|
|
|
147
|
+
### 2.3.0
|
|
148
|
+
* [Add default elytra flying value (#69)](https://github.com/PrismarineJS/prismarine-entity/commit/f124abd47b42a908a676b91b0fcb55b1fd1a77b9) (thanks @lkwilson)
|
|
149
|
+
* [Fix equipment documentation for other versions (#67)](https://github.com/PrismarineJS/prismarine-entity/commit/b2f756de52fa7ceb2675fe9c2f950fa7398bc425) (thanks @IceTank)
|
|
150
|
+
* [Add command gh workflow allowing to use release command in comments (#66)](https://github.com/PrismarineJS/prismarine-entity/commit/4dffa63e3dd45b8f3a42575a2f6f3c2fa47d1d50) (thanks @rom1504)
|
|
151
|
+
* [Update to node 18.0.0 (#65)](https://github.com/PrismarineJS/prismarine-entity/commit/7fe14b95f82089b27e20f12a14f709bc8bd5c206) (thanks @rom1504)
|
|
152
|
+
* [Bump @types/node from 18.16.13 to 20.2.1 (#64)](https://github.com/PrismarineJS/prismarine-entity/commit/887737f531d89b25e045c4f0db4ec66497eba9f8) (thanks @dependabot[bot])
|
|
153
|
+
* [Add missing type (#55)](https://github.com/PrismarineJS/prismarine-entity/commit/87a94dbaf698497f56968efbb396c3692431ae6f) (thanks @sefirosweb)
|
|
154
|
+
* [deprecate objectType and mobType (#53)](https://github.com/PrismarineJS/prismarine-entity/commit/e3aadc7e51dccc645d81825aa0bd40b3be88cb05) (thanks @Epirito)
|
|
155
|
+
* [Update package.json (#52)](https://github.com/PrismarineJS/prismarine-entity/commit/1156c9b9ae76b3e82ea57348c0f4e0cbdcb6216a) (thanks @Epirito)
|
|
156
|
+
|
|
131
157
|
### 2.2.0
|
|
132
158
|
|
|
133
159
|
* mcData to registry refactoring (step towards #2450)
|
package/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare module 'prismarine-entity' {
|
|
|
41
41
|
health?: number;
|
|
42
42
|
food?: number;
|
|
43
43
|
foodSaturation?: number;
|
|
44
|
+
elytraFlying?: boolean
|
|
44
45
|
player?: object;
|
|
45
46
|
effects: Effect[];
|
|
46
47
|
setEquipment(index: number, item: Item): void;
|
|
@@ -48,5 +49,5 @@ declare module 'prismarine-entity' {
|
|
|
48
49
|
getDroppedItem(): Item | null;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
export type EntityType = 'player' | 'mob' | 'object' | 'global' | 'orb' | 'other';
|
|
52
|
+
export type EntityType = 'player' | 'mob' | 'object' | 'global' | 'orb' | 'projectile'| 'hostile' | 'other';
|
|
52
53
|
}
|
package/index.js
CHANGED
|
@@ -24,6 +24,26 @@ module.exports = (registryOrVersion) => {
|
|
|
24
24
|
this.metadata = []
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
get mobType () {
|
|
28
|
+
printMobTypeWarning()
|
|
29
|
+
return this.displayName
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
set mobType (name) {
|
|
33
|
+
printMobTypeWarning()
|
|
34
|
+
this.displayName = name
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get objectType () {
|
|
38
|
+
printObjectTypeWarning()
|
|
39
|
+
return this.displayName
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set objectType (name) {
|
|
43
|
+
printObjectTypeWarning()
|
|
44
|
+
this.displayName = name
|
|
45
|
+
}
|
|
46
|
+
|
|
27
47
|
setEquipment (index, item) {
|
|
28
48
|
this.equipment[index] = item
|
|
29
49
|
this.heldItem = this.equipment[0]
|
|
@@ -47,3 +67,9 @@ module.exports = (registryOrVersion) => {
|
|
|
47
67
|
|
|
48
68
|
return Entity
|
|
49
69
|
}
|
|
70
|
+
function printMobTypeWarning () {
|
|
71
|
+
console.log('Warning: entity.mobType is deprecated. Use entity.displayName instead')
|
|
72
|
+
}
|
|
73
|
+
function printObjectTypeWarning () {
|
|
74
|
+
console.log('Warning: entity.objectType is deprecated. Use entity.displayName instead')
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prismarine-entity",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Represent a minecraft entity",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"url": "https://github.com/PrismarineJS/prismarine-entity.git"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"minecraft-data": "^3.0.0",
|
|
17
16
|
"prismarine-chat": "^1.4.1",
|
|
18
17
|
"prismarine-item": "^1.11.2",
|
|
19
18
|
"prismarine-registry": "^1.4.0",
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
"url": "https://github.com/PrismarineJS/prismarine-entity/issues"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@types/node": "^
|
|
32
|
+
"@types/node": "^20.2.1",
|
|
34
33
|
"prismarine-entity": "file:.",
|
|
35
34
|
"standard": "^17.0.0"
|
|
36
35
|
}
|