public interface ITeleporter
Teleporter
class, which has
been patched to implement this interface, for a vanilla example.Modifier and Type | Method and Description |
---|---|
default Entity |
placeEntity(Entity entity,
ServerWorld currentWorld,
ServerWorld destWorld,
float yaw,
java.util.function.Function<java.lang.Boolean,Entity> repositionEntity)
Called to handle placing the entity in the new world.
|
default Entity placeEntity(Entity entity, ServerWorld currentWorld, ServerWorld destWorld, float yaw, java.util.function.Function<java.lang.Boolean,Entity> repositionEntity)
IForgeDimension.getMovementFactor()
).
Note that the supplied entity has not yet been spawned
in the destination world at the time.entity
- the entity to be placedcurrentWorld
- the entity's origindestWorld
- the entity's destinationyaw
- the suggested yaw value to applyrepositionEntity
- a function to reposition the entity, which returns the new entity in the new dimension. This is the vanilla implementation of the dimension travel logic. If the supplied boolean is true, it is attempted to spawn a new portal.Entity
s a new instance and copy the data. But you are not allowed to create a new instance for PlayerEntity
s! Move the player and update its state, see ServerPlayerEntity.changeDimension(net.minecraft.world.dimension.DimensionType, ITeleporter)