Commits

DerFrZocker authored and md_5 committed e979ee95224
#935: Change Consumer and Predicates to super
No tags

src/main/java/org/bukkit/scheduler/BukkitScheduler.java

Modified
220 220 public BukkitTask runTask(@NotNull Plugin plugin, @NotNull Runnable task) throws IllegalArgumentException;
221 221
222 222 /**
223 223 * Returns a task that will run on the next server tick.
224 224 *
225 225 * @param plugin the reference to the plugin scheduling task
226 226 * @param task the task to be run
227 227 * @throws IllegalArgumentException if plugin is null
228 228 * @throws IllegalArgumentException if task is null
229 229 */
230 - public void runTask(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task) throws IllegalArgumentException;
230 + public void runTask(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task) throws IllegalArgumentException;
231 231
232 232 /**
233 233 * @param plugin the reference to the plugin scheduling task
234 234 * @param task the task to be run
235 235 * @return a BukkitTask that contains the id number
236 236 * @throws IllegalArgumentException if plugin is null
237 237 * @throws IllegalArgumentException if task is null
238 238 * @deprecated Use {@link BukkitRunnable#runTask(Plugin)}
239 239 */
240 240 @Deprecated
260 260 * <b>Asynchronous tasks should never access any API in Bukkit.</b> <b>Great care
261 261 * should be taken to assure the thread-safety of asynchronous tasks.</b>
262 262 * <p>
263 263 * Returns a task that will run asynchronously.
264 264 *
265 265 * @param plugin the reference to the plugin scheduling task
266 266 * @param task the task to be run
267 267 * @throws IllegalArgumentException if plugin is null
268 268 * @throws IllegalArgumentException if task is null
269 269 */
270 - public void runTaskAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task) throws IllegalArgumentException;
270 + public void runTaskAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task) throws IllegalArgumentException;
271 271
272 272 /**
273 273 * @param plugin the reference to the plugin scheduling task
274 274 * @param task the task to be run
275 275 * @return a BukkitTask that contains the id number
276 276 * @throws IllegalArgumentException if plugin is null
277 277 * @throws IllegalArgumentException if task is null
278 278 * @deprecated Use {@link BukkitRunnable#runTaskAsynchronously(Plugin)}
279 279 */
280 280 @Deprecated
298 298 /**
299 299 * Returns a task that will run after the specified number of server
300 300 * ticks.
301 301 *
302 302 * @param plugin the reference to the plugin scheduling task
303 303 * @param task the task to be run
304 304 * @param delay the ticks to wait before running the task
305 305 * @throws IllegalArgumentException if plugin is null
306 306 * @throws IllegalArgumentException if task is null
307 307 */
308 - public void runTaskLater(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay) throws IllegalArgumentException;
308 + public void runTaskLater(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay) throws IllegalArgumentException;
309 309
310 310 /**
311 311 * @param plugin the reference to the plugin scheduling task
312 312 * @param task the task to be run
313 313 * @param delay the ticks to wait before running the task
314 314 * @return a BukkitTask that contains the id number
315 315 * @throws IllegalArgumentException if plugin is null
316 316 * @throws IllegalArgumentException if task is null
317 317 * @deprecated Use {@link BukkitRunnable#runTaskLater(Plugin, long)}
318 318 */
343 343 * <p>
344 344 * Returns a task that will run asynchronously after the specified number
345 345 * of server ticks.
346 346 *
347 347 * @param plugin the reference to the plugin scheduling task
348 348 * @param task the task to be run
349 349 * @param delay the ticks to wait before running the task
350 350 * @throws IllegalArgumentException if plugin is null
351 351 * @throws IllegalArgumentException if task is null
352 352 */
353 - public void runTaskLaterAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay) throws IllegalArgumentException;
353 + public void runTaskLaterAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay) throws IllegalArgumentException;
354 354
355 355 /**
356 356 * @param plugin the reference to the plugin scheduling task
357 357 * @param task the task to be run
358 358 * @param delay the ticks to wait before running the task
359 359 * @return a BukkitTask that contains the id number
360 360 * @throws IllegalArgumentException if plugin is null
361 361 * @throws IllegalArgumentException if task is null
362 362 * @deprecated Use {@link BukkitRunnable#runTaskLaterAsynchronously(Plugin, long)}
363 363 */
384 384 * Returns a task that will repeatedly run until cancelled, starting after
385 385 * the specified number of server ticks.
386 386 *
387 387 * @param plugin the reference to the plugin scheduling task
388 388 * @param task the task to be run
389 389 * @param delay the ticks to wait before running the task
390 390 * @param period the ticks to wait between runs
391 391 * @throws IllegalArgumentException if plugin is null
392 392 * @throws IllegalArgumentException if task is null
393 393 */
394 - public void runTaskTimer(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay, long period) throws IllegalArgumentException;
394 + public void runTaskTimer(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay, long period) throws IllegalArgumentException;
395 395
396 396 /**
397 397 * @param plugin the reference to the plugin scheduling task
398 398 * @param task the task to be run
399 399 * @param delay the ticks to wait before running the task
400 400 * @param period the ticks to wait between runs
401 401 * @return a BukkitTask that contains the id number
402 402 * @throws IllegalArgumentException if plugin is null
403 403 * @throws IllegalArgumentException if task is null
404 404 * @deprecated Use {@link BukkitRunnable#runTaskTimer(Plugin, long, long)}
434 434 * starting after the specified number of server ticks.
435 435 *
436 436 * @param plugin the reference to the plugin scheduling task
437 437 * @param task the task to be run
438 438 * @param delay the ticks to wait before running the task for the first
439 439 * time
440 440 * @param period the ticks to wait between runs
441 441 * @throws IllegalArgumentException if plugin is null
442 442 * @throws IllegalArgumentException if task is null
443 443 */
444 - public void runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay, long period) throws IllegalArgumentException;
444 + public void runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay, long period) throws IllegalArgumentException;
445 445
446 446 /**
447 447 * @param plugin the reference to the plugin scheduling task
448 448 * @param task the task to be run
449 449 * @param delay the ticks to wait before running the task for the first
450 450 * time
451 451 * @param period the ticks to wait between runs
452 452 * @return a BukkitTask that contains the id number
453 453 * @throws IllegalArgumentException if plugin is null
454 454 * @throws IllegalArgumentException if task is null

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut