001    package org.bukkit.inventory;
002    
003    import org.bukkit.entity.Entity;
004    
005    /**
006     * An interface to a creatures inventory
007     */
008    public interface EntityEquipment {
009    
010        /**
011         * Gets a copy of the item the entity is currently holding
012         *
013         * @return the currently held item
014         */
015        ItemStack getItemInHand();
016    
017        /**
018         * Sets the item the entity is holding
019         *
020         * @param stack The item to put into the entities hand
021         */
022        void setItemInHand(ItemStack stack);
023    
024        /**
025         * Gets a copy of the helmet currently being worn by the entity
026         *
027         * @return The helmet being worn
028         */
029        ItemStack getHelmet();
030    
031        /**
032         * Sets the helmet worn by the entity
033         *
034         * @param helmet The helmet to put on the entity
035         */
036        void setHelmet(ItemStack helmet);
037    
038        /**
039         * Gets a copy of the chest plate currently being worn by the entity
040         *
041         * @return The chest plate being worn
042         */
043        ItemStack getChestplate();
044    
045        /**
046         * Sets the chest plate worn by the entity
047         *
048         * @param chestplate The chest plate to put on the entity
049         */
050        void setChestplate(ItemStack chestplate);
051    
052        /**
053         * Gets a copy of the leggings currently being worn by the entity
054         *
055         * @return The leggings being worn
056         */
057        ItemStack getLeggings();
058    
059        /**
060         * Sets the leggings worn by the entity
061         *
062         * @param leggings The leggings to put on the entity
063         */
064        void setLeggings(ItemStack leggings);
065    
066        /**
067         * Gets a copy of the boots currently being worn by the entity
068         *
069         * @return The boots being worn
070         */
071        ItemStack getBoots();
072    
073        /**
074         * Sets the boots worn by the entity
075         *
076         * @param boots The boots to put on the entity
077         */
078        void setBoots(ItemStack boots);
079    
080        /**
081         * Gets a copy of all worn armor
082         *
083         * @return The array of worn armor
084         */
085        ItemStack[] getArmorContents();
086    
087        /**
088         * Sets the entities armor to the provided array of ItemStacks
089         *
090         * @param items The items to set the armor as
091         */
092        void setArmorContents(ItemStack[] items);
093    
094        /**
095         * Clears the entity of all armor and held items
096         */
097        void clear();
098    
099        /**
100         * Gets the chance of the currently held item being dropped upon this
101         * creature's death
102         * <p>
103         * <ul>
104         * <li>A drop chance of 0F will never drop
105         * <li>A drop chance of 1F will always drop
106         * </ul>
107         *
108         * @return chance of the currently held item being dropped (1 for players)
109         */
110        float getItemInHandDropChance();
111    
112        /**
113         * Sets the chance of the item this creature is currently holding being
114         * dropped upon this creature's death
115         * <p>
116         * <ul>
117         * <li>A drop chance of 0F will never drop
118         * <li>A drop chance of 1F will always drop
119         * </ul>
120         *
121         * @param chance the chance of the currently held item being dropped
122         * @throws UnsupportedOperationException when called on players
123         */
124        void setItemInHandDropChance(float chance);
125    
126        /**
127         * Gets the chance of the helmet being dropped upon this creature's death
128         * <p>
129         * <ul>
130         * <li>A drop chance of 0F will never drop
131         * <li>A drop chance of 1F will always drop
132         * </ul>
133         *
134         * @return the chance of the helmet being dropped (1 for players)
135         */
136        float getHelmetDropChance();
137    
138        /**
139         * Sets the chance of the helmet being dropped upon this creature's death
140         * <p>
141         * <ul>
142         * <li>A drop chance of 0F will never drop
143         * <li>A drop chance of 1F will always drop
144         * </ul>
145         *
146         * @param chance of the helmet being dropped
147         * @throws UnsupportedOperationException when called on players
148         */
149        void setHelmetDropChance(float chance);
150    
151        /**
152         * Gets the chance of the chest plate being dropped upon this creature's
153         * death
154         * <p>
155         * <ul>
156         * <li>A drop chance of 0F will never drop
157         * <li>A drop chance of 1F will always drop
158         * </ul>
159         *
160         * @return the chance of the chest plate being dropped (1 for players)
161         */
162        float getChestplateDropChance();
163    
164        /**
165         * Sets the chance of the chest plate being dropped upon this creature's
166         * death
167         * <p>
168         * <ul>
169         * <li>A drop chance of 0F will never drop
170         * <li>A drop chance of 1F will always drop
171         * </ul>
172         *
173         * @param chance of the chest plate being dropped
174         * @throws UnsupportedOperationException when called on players
175         */
176        void setChestplateDropChance(float chance);
177    
178        /**
179         * Gets the chance of the leggings being dropped upon this creature's
180         * death
181         * <p>
182         * <ul>
183         * <li>A drop chance of 0F will never drop
184         * <li>A drop chance of 1F will always drop
185         * </ul>
186         *
187         * @return the chance of the leggings being dropped (1 for players)
188         */
189        float getLeggingsDropChance();
190    
191        /**
192         * Sets the chance of the leggings being dropped upon this creature's
193         * death
194         * <p>
195         * <ul>
196         * <li>A drop chance of 0F will never drop
197         * <li>A drop chance of 1F will always drop
198         * </ul>
199         *
200         * @param chance chance of the leggings being dropped
201         * @throws UnsupportedOperationException when called on players
202         */
203        void setLeggingsDropChance(float chance);
204    
205        /**
206         * Gets the chance of the boots being dropped upon this creature's death
207         * <p>
208         * <ul>
209         * <li>A drop chance of 0F will never drop
210         * <li>A drop chance of 1F will always drop
211         * </ul>
212         *
213         * @return the chance of the boots being dropped (1 for players)
214         */
215        float getBootsDropChance();
216    
217        /**
218         * Sets the chance of the boots being dropped upon this creature's death
219         * <p>
220         * <ul>
221         * <li>A drop chance of 0F will never drop
222         * <li>A drop chance of 1F will always drop
223         * </ul>
224         *
225         * @param chance of the boots being dropped
226         * @throws UnsupportedOperationException when called on players
227         */
228        void setBootsDropChance(float chance);
229    
230        /**
231         * Get the entity this EntityEquipment belongs to
232         *
233         * @return the entity this EntityEquipment belongs to
234         */
235        Entity getHolder();
236    }