(Entity entity, ServerLevel currentWorld, ServerLevel destWorld, float yaw, Function<Boolean, Entity> repositionEntity)
| 26 | public static void teleport(ServerPlayer entity, ServerLevel destination, BlockPos pos, boolean findTop) { |
| 27 | entity.changeDimension(destination, new ITeleporter() { |
| 28 | @Override |
| 29 | public Entity placeEntity(Entity entity, ServerLevel currentWorld, ServerLevel destWorld, float yaw, Function<Boolean, Entity> repositionEntity) { |
| 30 | entity = repositionEntity.apply(false); |
| 31 | int y = pos.getY(); |
| 32 | if (findTop) { |
| 33 | y = destination.getHeight(Heightmap.Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ()); |
| 34 | } |
| 35 | entity.teleportTo(pos.getX(), y, pos.getZ()); |
| 36 | return entity; |
| 37 | } |
| 38 | }); |
| 39 | } |
| 40 |
nothing calls this directly
no test coverage detected