public class Teleporter extends java.lang.Object implements ITeleporter
Modifier and Type | Class and Description |
---|---|
class |
Teleporter.PortalPosition |
Modifier and Type | Field and Description |
---|---|
protected it.unimi.dsi.fastutil.longs.Long2ObjectMap<Teleporter.PortalPosition> |
destinationCoordinateCache |
protected java.util.Random |
random |
protected WorldServer |
world |
Constructor and Description |
---|
Teleporter(WorldServer worldIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
makePortal(Entity entityIn) |
void |
placeEntity(World world,
Entity entity,
float yaw)
Called to handle placing the entity in the new world.
|
boolean |
placeInExistingPortal(Entity entityIn,
float rotationYaw) |
void |
placeInPortal(Entity entityIn,
float rotationYaw) |
void |
removeStalePortalLocations(long worldTime) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isVanilla
protected final WorldServer world
protected final java.util.Random random
protected final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Teleporter.PortalPosition> destinationCoordinateCache
public Teleporter(WorldServer worldIn)
public void placeInPortal(Entity entityIn, float rotationYaw)
public boolean placeInExistingPortal(Entity entityIn, float rotationYaw)
public boolean makePortal(Entity entityIn)
public void removeStalePortalLocations(long worldTime)
public void placeEntity(World world, Entity entity, float yaw)
ITeleporter
WorldProvider.getMovementFactor()
).
Note that the supplied entity has not yet been spawned
in the destination world at the time.placeEntity
in interface ITeleporter
world
- the entity's destinationentity
- the entity to be placedyaw
- the suggested yaw value to apply