@@ -4,30 +4,30 @@ import { ActionHook, getActionHooks, questHookFilter, ActionPipe, RunnableHooks
4
4
5
5
6
6
/**
7
- * Defines an item-on-item action hook.
7
+ * Defines an item-on-world- item action hook.
8
8
*
9
9
* @author jameskmonger
10
10
*/
11
- export interface ItemOnGroundItemActionHook extends ActionHook < ItemOnGroundItemAction , itemOnGroundItemActionHandler > {
11
+ export interface ItemOnWorldItemActionHook extends ActionHook < ItemOnWorldItemAction , itemOnWorldItemActionHandler > {
12
12
/**
13
13
* The item pairs being used. Both items are optional so that you can specify a single item, a pair of items, or neither.
14
14
*/
15
- items : { item ?: number , groundItem ?: number } [ ] ;
15
+ items : { item ?: number , worldItem ?: number } [ ] ;
16
16
}
17
17
18
18
19
19
/**
20
- * The item-on-ground -item action hook handler function to be called when the hook's conditions are met.
20
+ * The item-on-world -item action hook handler function to be called when the hook's conditions are met.
21
21
*/
22
- export type itemOnGroundItemActionHandler = ( itemOnGroundItemAction : ItemOnGroundItemAction ) => void ;
22
+ export type itemOnWorldItemActionHandler = ( itemOnWorldItemAction : ItemOnWorldItemAction ) => void ;
23
23
24
24
25
25
/**
26
- * Details about an item-on-ground -item action being performed.
26
+ * Details about an item-on-world -item action being performed.
27
27
*
28
28
* @author jameskmonger
29
29
*/
30
- export interface ItemOnGroundItemAction {
30
+ export interface ItemOnWorldItemAction {
31
31
/**
32
32
* The player performing the action.
33
33
*/
@@ -60,34 +60,34 @@ export interface ItemOnGroundItemAction {
60
60
}
61
61
62
62
/**
63
- * The pipe that the game engine hands item-on-ground -item actions off to.
63
+ * The pipe that the game engine hands item-on-world -item actions off to.
64
64
*
65
- * This will call the `item_on_ground_item ` action hooks, if any are registered and match the action being performed.
65
+ * This will call the `item_on_world_item ` action hooks, if any are registered and match the action being performed.
66
66
*
67
- * Both `item` and `groundItem ` are optional, but if they are provided then they must match the items in use.
67
+ * Both `item` and `worldItem ` are optional, but if they are provided then they must match the items in use.
68
68
*
69
69
* @author jameskmonger
70
70
*/
71
- const itemOnGroundItemActionPipe = (
71
+ const itemOnWorldItemActionPipe = (
72
72
player : Player ,
73
73
usedItem : Item , usedWithItem : WorldItem ,
74
74
usedWidgetId : number , usedContainerId : number , usedSlot : number
75
- ) : RunnableHooks < ItemOnGroundItemAction > => {
75
+ ) : RunnableHooks < ItemOnWorldItemAction > => {
76
76
if ( player . busy ) {
77
77
return ;
78
78
}
79
79
80
80
// Find all item on item action plugins that match this action
81
- let matchingHooks = getActionHooks < ItemOnGroundItemActionHook > ( 'item_on_ground_item ' , plugin => {
81
+ let matchingHooks = getActionHooks < ItemOnWorldItemActionHook > ( 'item_on_world_item ' , plugin => {
82
82
if ( questHookFilter ( player , plugin ) ) {
83
83
const used = usedItem . itemId ;
84
84
const usedWith = usedWithItem . itemId ;
85
85
86
- return ( plugin . items . some ( ( { item, groundItem } ) => {
86
+ return ( plugin . items . some ( ( { item, worldItem } ) => {
87
87
const itemMatch = item === undefined || item === used ;
88
- const groundItemMatch = groundItem === undefined || groundItem === usedWith ;
88
+ const worldItemMatch = worldItem === undefined || worldItem === usedWith ;
89
89
90
- return itemMatch && groundItemMatch ;
90
+ return itemMatch && worldItemMatch ;
91
91
} ) ) ;
92
92
}
93
93
@@ -102,7 +102,7 @@ const itemOnGroundItemActionPipe = (
102
102
103
103
if ( matchingHooks . length === 0 ) {
104
104
player . outgoingPackets . chatboxMessage (
105
- `Unhandled item on ground item interaction: ${ usedItem . itemId } on ${ usedWithItem . itemId } ` ) ;
105
+ `Unhandled item on world item interaction: ${ usedItem . itemId } on ${ usedWithItem . itemId } ` ) ;
106
106
return null ;
107
107
}
108
108
@@ -118,6 +118,6 @@ const itemOnGroundItemActionPipe = (
118
118
119
119
120
120
/**
121
- * Item-on-item action pipe definition.
121
+ * Item-on-world- item action pipe definition.
122
122
*/
123
- export default [ 'item_on_ground_item ' , itemOnGroundItemActionPipe ] as ActionPipe ;
123
+ export default [ 'item_on_world_item ' , itemOnWorldItemActionPipe ] as ActionPipe ;
0 commit comments