summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 17:35:52 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 17:35:52 +0000
commit2d1e365c432ac7ab4ce42f35f3edeb9c7f37da4b (patch)
treea7f2f0f894a97f57bea5567d9da6b07e91bb2c96 /src/main/java/org
parentc16210e2e2dd938f8ea8f0c51fe0af93e25ce00f (diff)
downloadbukkit-2d1e365c432ac7ab4ce42f35f3edeb9c7f37da4b.tar
bukkit-2d1e365c432ac7ab4ce42f35f3edeb9c7f37da4b.tar.gz
bukkit-2d1e365c432ac7ab4ce42f35f3edeb9c7f37da4b.tar.lz
bukkit-2d1e365c432ac7ab4ce42f35f3edeb9c7f37da4b.tar.xz
bukkit-2d1e365c432ac7ab4ce42f35f3edeb9c7f37da4b.zip
Added entity.playEffect, thanks to main-- in an (unfortunately old) PR.
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/EntityEffect.java54
-rw-r--r--src/main/java/org/bukkit/entity/Entity.java10
2 files changed, 64 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/EntityEffect.java b/src/main/java/org/bukkit/EntityEffect.java
new file mode 100644
index 00000000..9b2550dd
--- /dev/null
+++ b/src/main/java/org/bukkit/EntityEffect.java
@@ -0,0 +1,54 @@
+package org.bukkit;
+
+/**
+ * A list of all Effects that can happen to entities.
+ */
+public enum EntityEffect {
+
+ /**
+ * When mobs get hurt.
+ */
+ HURT((byte) 2),
+
+ /**
+ * When a mob dies.
+ * <p>
+ * <b>This will cause client-glitches!
+ */
+ DEATH((byte) 3),
+
+ /**
+ * The smoke when taming a wolf fails.
+ * <p>
+ * Without client-mods this will be ignored if the entity is not a wolf.
+ */
+ WOLF_SMOKE((byte) 6),
+
+ /**
+ * The hearts when taming a wolf succeeds.
+ * <p>
+ * Without client-mods this will be ignored if the entity is not a wolf.
+ */
+ WOLF_HEARTS((byte) 7),
+
+ /**
+ * When a wolf shakes (after being wet).
+ * <p>
+ * Without client-mods this will be ignored if the entity is not a wolf.
+ */
+ WOLF_SHAKE((byte) 8);
+
+ private final byte data;
+
+ EntityEffect(byte data)
+ {
+ this.data = data;
+ }
+
+ /**
+ * @return The data-value that is sent to the client to play this effect.
+ */
+ public byte getData() {
+ return data;
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index b47a7ddb..5ecebb46 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -1,6 +1,7 @@
package org.bukkit.entity;
import org.bukkit.Location;
+import org.bukkit.EntityEffect;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.event.entity.EntityDamageEvent;
@@ -216,4 +217,13 @@ public interface Entity {
* @param value Age of entity
*/
public void setTicksLived(int value);
+
+ /**
+ * Performs the specified {@link EntityEffect} for this entity.
+ * <p>
+ * This will be viewable to all players near the entity.
+ *
+ * @param type Effect to play.
+ */
+ public void playEffect(EntityEffect type);
}