mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-19 13:02:12 +00:00
#1204: Add Enderman#teleport and Enderman#teleportTowards
This commit is contained in:
parent
5863a2eaef
commit
ae3824f949
1 changed files with 14 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.world.entity.monster.EntityEnderman;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.Material;
|
||||
|
@ -8,6 +9,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
|||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
||||
|
@ -52,4 +54,16 @@ public class CraftEnderman extends CraftMonster implements Enderman {
|
|||
public EntityType getType() {
|
||||
return EntityType.ENDERMAN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean teleport() {
|
||||
return getHandle().teleport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean teleportTowards(Entity entity) {
|
||||
Preconditions.checkArgument(entity != null, "entity cannot be null");
|
||||
|
||||
return getHandle().teleportTowards(((CraftEntity) entity).getHandle());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue