|
11 | 11 | import org.bukkit.plugin.Plugin; |
12 | 12 | import org.bukkit.plugin.java.PluginClassLoader; |
13 | 13 |
|
14 | | -import de.ntcomputer.minecraft.controllablemobs.api.ai.behaviors.AIBehavior; |
15 | 14 | import de.ntcomputer.minecraft.controllablemobs.implementation.CraftControllableMob; |
16 | 15 | import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces; |
17 | 16 |
|
18 | 17 | /** |
19 | 18 | * This is a static class which lets you retrieve instances of {@link ControllableMob}. |
20 | 19 | * |
21 | 20 | * @author Cybran |
22 | | - * @version v4 |
| 21 | + * @version v5 |
23 | 22 | * |
24 | 23 | */ |
25 | 24 | public final class ControllableMobs { |
@@ -141,78 +140,6 @@ public static <E extends LivingEntity> ControllableMob<E> assign(E entity, boole |
141 | 140 | return controllableMob; |
142 | 141 | } |
143 | 142 |
|
144 | | - /** |
145 | | - * Puts the entity under your control and sets its new movement speed, optionally clearing its AI. |
146 | | - * If you decide to clear its AI, the entity will stop moving and attacking and stand still until you order it to execute any actions. |
147 | | - * See {@link ControllableMobAttributes#getMovementSpeedAttribute()} for critical information. |
148 | | - * |
149 | | - * @param entity entity an instance of a subclass of LivingEntity - the entity you want to control. |
150 | | - * @param clearAI a boolean indicating whether default behaviors should be removed (true) or not (false) |
151 | | - * @param newMovementSpeed This float value has to be in a range between 0.01 and 2.0, or it will be ignored. The default value is 0.25 for monsters |
152 | | - * @return the {@link ControllableMob} you can use to control the entity |
153 | | - * @throws InvalidEntityException when the entity is null or can't be controlled |
154 | | - * @throws IllegalStateException when the entity is already being controlled |
155 | | - * |
156 | | - * @deprecated contains parameters that should be set elsewhere. Will be removed in v5 or v6. |
157 | | - */ |
158 | | - @Deprecated |
159 | | - public static <E extends LivingEntity> ControllableMob<E> assign(E entity, boolean clearAI, float newMovementSpeed) throws IllegalStateException, InvalidEntityException { |
160 | | - return assign(entity, clearAI, newMovementSpeed, null); |
161 | | - } |
162 | | - |
163 | | - /** |
164 | | - * Puts the entity under your control, optionally clearing its AI and adding custom AI behaviors. |
165 | | - * If you decide to clear its AI, the entity will stop moving and attacking like it would normally do. |
166 | | - * Instead, it will act corresponding to the new AI behaviors you provide. |
167 | | - * |
168 | | - * @param entity entity an instance of a subclass of LivingEntity - the entity you want to control. |
169 | | - * @param clearAI a boolean indicating whether default behaviors should be removed (true) or not (false) |
170 | | - * @param additionalAIBehaviors an array of new AI behaviors. See {@link ControllableMobAI#addAIBehaviors(AIBehavior[])} |
171 | | - * @return the {@link ControllableMob} you can use to control the entity |
172 | | - * @throws InvalidEntityException when the entity is null or can't be controlled |
173 | | - * @throws IllegalStateException when the entity is already being controlled |
174 | | - * |
175 | | - * @deprecated contains parameters that should be set elsewhere. Will be removed in v5 or v6. |
176 | | - */ |
177 | | - @SuppressWarnings("rawtypes") |
178 | | - @Deprecated |
179 | | - public static <E extends LivingEntity> ControllableMob<E> assign(E entity, boolean clearAI, AIBehavior[] additionalAIBehaviors) throws IllegalStateException, InvalidEntityException { |
180 | | - return assign(entity, clearAI, 0, additionalAIBehaviors); |
181 | | - } |
182 | | - |
183 | | - /** |
184 | | - * Puts the entity under your control and sets its new movement speed, optionally clearing its AI and adding custom AI behaviors. |
185 | | - * If you decide to clear its AI, the entity will stop moving and attacking like it would normally do. |
186 | | - * Instead, it will act corresponding to the new AI behaviors you provide. |
187 | | - * See {@link ControllableMobAttributes#getMovementSpeedAttribute()} for critical information. |
188 | | - * |
189 | | - * @param entity entity an instance of a subclass of LivingEntity - the entity you want to control. |
190 | | - * @param clearAI a boolean indicating whether default behaviors should be removed (true) or not (false) |
191 | | - * @param newMovementSpeed This float value has to be in a range between 0.01 and 2.0, or it will be ignored. The default value is 0.25 for monsters |
192 | | - * @param additionalAIBehaviors an array of new AI behaviors. See {@link ControllableMobAI#addAIBehaviors(AIBehavior[])} |
193 | | - * @return the {@link ControllableMob} you can use to control the entity |
194 | | - * @throws InvalidEntityException when the entity is null or can't be controlled |
195 | | - * @throws IllegalStateException when the entity is already being controlled |
196 | | - * |
197 | | - * @deprecated contains parameters that should be set elsewhere. Will be removed in v5 or v6. |
198 | | - */ |
199 | | - @SuppressWarnings("rawtypes") |
200 | | - @Deprecated |
201 | | - public static <E extends LivingEntity> ControllableMob<E> assign(E entity, boolean clearAI, float newMovementSpeed, AIBehavior[] additionalAIBehaviors) throws IllegalStateException, InvalidEntityException { |
202 | | - if(entity==null) throw new InvalidEntityException("entity must not be null", entity); |
203 | | - EntityLiving notchEntity = ((CraftLivingEntity) entity).getHandle(); |
204 | | - if(!(notchEntity instanceof EntityInsentient)) throw new InvalidEntityException("the entity "+entity.toString()+" can't be controlled",entity); |
205 | | - if(entities.containsKey(entity)) throw new IllegalStateException("entity "+entity.toString()+" is already a controlled entity"); |
206 | | - |
207 | | - ControllableMob<E> controllableMob = new CraftControllableMob<E>(entity, (EntityInsentient) notchEntity); |
208 | | - if(clearAI) controllableMob.getAI().clearAIBehaviors(); |
209 | | - controllableMob.getProperties().setMovementSpeed(newMovementSpeed); |
210 | | - if(additionalAIBehaviors!=null) controllableMob.getAI().addAIBehaviors(additionalAIBehaviors); |
211 | | - |
212 | | - entities.put(entity,controllableMob); |
213 | | - return controllableMob; |
214 | | - } |
215 | | - |
216 | 143 | /** |
217 | 144 | * Releases the entity from control and restores default behaviors. |
218 | 145 | * All actions will be stopped immediately, all custom AI behaviors will be removed and default attributes and behaviors will be restored. Frees memory. |
|
0 commit comments