mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
#1204: Add Enderman#teleport and Enderman#teleportTowards
By: Collin <collinjbarber@gmail.com>
This commit is contained in:
parent
5fe70f50c1
commit
b68e6ca9c8
@ -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…
Reference in New Issue
Block a user