summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/inventory/EntityEquipment.java
blob: 9e712359a2ede5e8c05e52e0f8f3be65047225c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
package org.bukkit.inventory;

import org.bukkit.entity.Entity;

/**
 * An interface to a creatures inventory
 */
public interface EntityEquipment {

    /**
     * Gets a copy of the item the entity is currently holding
     *
     * @return the currently held item
     */
    ItemStack getItemInHand();

    /**
     * Sets the item the entity is holding
     *
     * @param stack The item to put into the entities hand
     */
    void setItemInHand(ItemStack stack);

    /**
     * Gets a copy of the helmet currently being worn by the entity
     *
     * @return The helmet being worn
     */
    ItemStack getHelmet();

    /**
     * Sets the helmet worn by the entity
     *
     * @param helmet The helmet to put on the entity
     */
    void setHelmet(ItemStack helmet);

    /**
     * Gets a copy of the chest plate currently being worn by the entity
     *
     * @return The chest plate being worn
     */
    ItemStack getChestplate();

    /**
     * Sets the chest plate worn by the entity
     *
     * @param chestplate The chest plate to put on the entity
     */
    void setChestplate(ItemStack chestplate);

    /**
     * Gets a copy of the leggings currently being worn by the entity
     *
     * @return The leggings being worn
     */
    ItemStack getLeggings();

    /**
     * Sets the leggings worn by the entity
     *
     * @param leggings The leggings to put on the entity
     */
    void setLeggings(ItemStack leggings);

    /**
     * Gets a copy of the boots currently being worn by the entity
     *
     * @return The boots being worn
     */
    ItemStack getBoots();

    /**
     * Sets the boots worn by the entity
     *
     * @param boots The boots to put on the entity
     */
    void setBoots(ItemStack boots);

    /**
     * Gets a copy of all worn armor
     *
     * @return The array of worn armor
     */
    ItemStack[] getArmorContents();

    /**
     * Sets the entities armor to the provided array of ItemStacks
     *
     * @param items The items to set the armor as
     */
    void setArmorContents(ItemStack[] items);

    /**
     * Clears the entity of all armor and held items
     */
    void clear();

    /**
     * Gets the chance of the currently held item being dropped upon this
     * creature's death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @return chance of the currently held item being dropped (1 for players)
     */
    float getItemInHandDropChance();

    /**
     * Sets the chance of the item this creature is currently holding being
     * dropped upon this creature's death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @param chance the chance of the currently held item being dropped
     * @throws UnsupportedOperationException when called on players
     */
    void setItemInHandDropChance(float chance);

    /**
     * Gets the chance of the helmet being dropped upon this creature's death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @return the chance of the helmet being dropped (1 for players)
     */
    float getHelmetDropChance();

    /**
     * Sets the chance of the helmet being dropped upon this creature's death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @param chance of the helmet being dropped
     * @throws UnsupportedOperationException when called on players
     */
    void setHelmetDropChance(float chance);

    /**
     * Gets the chance of the chest plate being dropped upon this creature's
     * death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @return the chance of the chest plate being dropped (1 for players)
     */
    float getChestplateDropChance();

    /**
     * Sets the chance of the chest plate being dropped upon this creature's
     * death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @param chance of the chest plate being dropped
     * @throws UnsupportedOperationException when called on players
     */
    void setChestplateDropChance(float chance);

    /**
     * Gets the chance of the leggings being dropped upon this creature's
     * death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @return the chance of the leggings being dropped (1 for players)
     */
    float getLeggingsDropChance();

    /**
     * Sets the chance of the leggings being dropped upon this creature's
     * death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @param chance chance of the leggings being dropped
     * @throws UnsupportedOperationException when called on players
     */
    void setLeggingsDropChance(float chance);

    /**
     * Gets the chance of the boots being dropped upon this creature's death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @return the chance of the boots being dropped (1 for players)
     */
    float getBootsDropChance();

    /**
     * Sets the chance of the boots being dropped upon this creature's death
     * <p>
     * <ul>
     * <li>A drop chance of 0F will never drop
     * <li>A drop chance of 1F will always drop
     * </ul>
     *
     * @param chance of the boots being dropped
     * @throws UnsupportedOperationException when called on players
     */
    void setBootsDropChance(float chance);

    /**
     * Get the entity this EntityEquipment belongs to
     *
     * @return the entity this EntityEquipment belongs to
     */
    Entity getHolder();
}