diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java index 58b9cb8597..9d9b5d4a32 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderCrystal.java @@ -1,6 +1,8 @@ package org.bukkit.craftbukkit.entity; +import net.minecraft.server.BlockPosition; import net.minecraft.server.EntityEnderCrystal; +import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EnderCrystal; import org.bukkit.entity.EntityType; @@ -20,6 +22,23 @@ public class CraftEnderCrystal extends CraftEntity implements EnderCrystal { getHandle().a(showing); // PAIL: Rename setShowingBottom } + @Override + public Location getBeamTarget() { + BlockPosition pos = getHandle().j(); // PAIL: Rename getBeamTarget + return pos == null ? null : new Location(getWorld(), pos.getX(), pos.getY(), pos.getZ()); + } + + @Override + public void setBeamTarget(Location location) { + if (location == null) { + getHandle().a((BlockPosition) null); // PAIL: Rename setBeamTarget + } else if (location.getWorld() != getWorld()) { + throw new IllegalArgumentException("Cannot set beam target location to different world"); + } else { + getHandle().a(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ())); + } + } + @Override public EntityEnderCrystal getHandle() { return (EntityEnderCrystal) entity;