summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index 3974778d..99425767 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import net.minecraft.server.EntityArrow;
import org.apache.commons.lang.Validate;
+import org.bukkit.block.Block;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.EntityType;
@@ -47,6 +48,21 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
}
@Override
+ public boolean isInBlock() {
+ return getHandle().inGround;
+ }
+
+ @Override
+ public Block getAttachedBlock() {
+ if (!isInBlock()) {
+ return null;
+ }
+
+ EntityArrow handle = getHandle();
+ return getWorld().getBlockAt(handle.h, handle.at, handle.au); // PAIL: rename tileX, tileY, tileZ
+ }
+
+ @Override
public PickupStatus getPickupStatus() {
return PickupStatus.values()[getHandle().fromPlayer.ordinal()];
}