summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorWesley Wolfe <weswolf@aol.com>2012-03-20 02:06:59 -0500
committerEvilSeph <evilseph@gmail.com>2012-03-20 03:24:37 -0400
commite4ca064cdc2a3e57ae817fd4d09e118f6464f46f (patch)
treebd6e9689d4a44e43e1f5f6a60060b41e3f942865 /src/main/java/org
parent3a737b3a2789038814d141a0bbfe57eb4cc96da8 (diff)
downloadbukkit-e4ca064cdc2a3e57ae817fd4d09e118f6464f46f.tar
bukkit-e4ca064cdc2a3e57ae817fd4d09e118f6464f46f.tar.gz
bukkit-e4ca064cdc2a3e57ae817fd4d09e118f6464f46f.tar.lz
bukkit-e4ca064cdc2a3e57ae817fd4d09e118f6464f46f.tar.xz
bukkit-e4ca064cdc2a3e57ae817fd4d09e118f6464f46f.zip
[Bleeding] Add ExpBottleEvent; Addresses BUKKIT-888
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/event/entity/ExpBottleEvent.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java b/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java
new file mode 100644
index 00000000..3371e93a
--- /dev/null
+++ b/src/main/java/org/bukkit/event/entity/ExpBottleEvent.java
@@ -0,0 +1,69 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.entity.ThrownExpBottle;
+import org.bukkit.event.HandlerList;
+
+/**
+ * Called when a ThrownExpBottle hits and releases experience.
+ */
+public class ExpBottleEvent extends ProjectileHitEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private int exp;
+ private boolean showEffect = true;
+
+ public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
+ super(bottle);
+ this.exp = exp;
+ }
+
+ @Override
+ public ThrownExpBottle getEntity() {
+ return (ThrownExpBottle) entity;
+ }
+
+ /**
+ * This method indicates if the particle effect should be shown.
+ * @return true if the effect will be shown, false otherwise
+ */
+ public boolean getShowEffect() {
+ return this.showEffect;
+ }
+
+ /**
+ * This method sets if the particle effect will be shown.
+ * This does not change the experience created.
+ * @param showEffect
+ * true indicates the effect will be shown,
+ * false indicates no effect will be shown
+ */
+ public void setShowEffect(final boolean showEffect) {
+ this.showEffect = showEffect;
+ }
+
+ /**
+ * This method retrieves the amount of experience to be created.
+ * The number indicates a total amount to be divided into orbs.
+ * @return the total amount of experience to be created
+ */
+ public int getExperience() {
+ return exp;
+ }
+
+ /**
+ * This method sets the amount of experience to be created.
+ * The number indicates a total amount to be divided into orbs.
+ * @param exp the total amount of experience to be created
+ */
+ public void setExperience(final int exp) {
+ this.exp = exp;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}