13
0
geforkt von Mirrors/Paper

Implement EndGateway#getExitLocation and EndGateway#setExitLocation(Location)

Dieser Commit ist enthalten in:
Matthew 2016-03-16 19:56:48 -04:00 committet von md_5
Ursprung f09f7d8754
Commit a12b1a4770

Datei anzeigen

@ -1,6 +1,8 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.BlockPosition;
import net.minecraft.server.EntityEnderCrystal; import net.minecraft.server.EntityEnderCrystal;
import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EnderCrystal; import org.bukkit.entity.EnderCrystal;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
@ -20,6 +22,23 @@ public class CraftEnderCrystal extends CraftEntity implements EnderCrystal {
getHandle().a(showing); // PAIL: Rename setShowingBottom 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 @Override
public EntityEnderCrystal getHandle() { public EntityEnderCrystal getHandle() {
return (EntityEnderCrystal) entity; return (EntityEnderCrystal) entity;