#1204: Add Enderman#teleport and Enderman#teleportTowards

By: Collin <collinjbarber@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2023-06-14 18:36:22 +10:00
parent 5fe70f50c1
commit b68e6ca9c8

View File

@ -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());
}
}