Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ExpBottleEvent.java
1 package org.bukkit.event.entity;
2 
5 
6 /**
7  * Called when a ThrownExpBottle hits and releases experience.
8  */
9 public class ExpBottleEvent extends ProjectileHitEvent {
10  private static final HandlerList handlers = new HandlerList();
11  private int exp;
12  private boolean showEffect = true;
13 
14  public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
15  super(bottle);
16  this.exp = exp;
17  }
18 
19  @Override
20  public ThrownExpBottle getEntity() {
21  return (ThrownExpBottle) entity;
22  }
23 
24  /**
25  * This method indicates if the particle effect should be shown.
26  *
27  * @return true if the effect will be shown, false otherwise
28  */
29  public boolean getShowEffect() {
30  return this.showEffect;
31  }
32 
33  /**
34  * This method sets if the particle effect will be shown.
35  * <p>
36  * This does not change the experience created.
37  *
38  * @param showEffect true indicates the effect will be shown, false
39  * indicates no effect will be shown
40  */
41  public void setShowEffect(final boolean showEffect) {
42  this.showEffect = showEffect;
43  }
44 
45  /**
46  * This method retrieves the amount of experience to be created.
47  * <p>
48  * The number indicates a total amount to be divided into orbs.
49  *
50  * @return the total amount of experience to be created
51  */
52  public int getExperience() {
53  return exp;
54  }
55 
56  /**
57  * This method sets the amount of experience to be created.
58  * <p>
59  * The number indicates a total amount to be divided into orbs.
60  *
61  * @param exp the total amount of experience to be created
62  */
63  public void setExperience(final int exp) {
64  this.exp = exp;
65  }
66 
67  @Override
68  public HandlerList getHandlers() {
69  return handlers;
70  }
71 
72  public static HandlerList getHandlerList() {
73  return handlers;
74  }
75 }
void setShowEffect(final boolean showEffect)